package com.xinda.itsm.service.impl;

import java.util.List;
import com.xinda.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xinda.itsm.mapper.StandardInfoMapper;
import com.xinda.itsm.domain.StandardInfo;
import com.xinda.itsm.service.IStandardInfoService;

/**
 * 作业规范Service业务层处理
 * 
 * @author kerwincui
 * @date 2025-04-27
 */
@Service
public class StandardInfoServiceImpl implements IStandardInfoService 
{
    @Autowired
    private StandardInfoMapper standardInfoMapper;

    /**
     * 查询作业规范
     * 
     * @param standardId 作业规范主键
     * @return 作业规范
     */
    @Override
    public StandardInfo selectStandardInfoByStandardId(Long standardId)
    {
        return standardInfoMapper.selectStandardInfoByStandardId(standardId);
    }

    /**
     * 查询作业规范列表
     * 
     * @param standardInfo 作业规范
     * @return 作业规范
     */
    @Override
    public List<StandardInfo> selectStandardInfoList(StandardInfo standardInfo)
    {
        return standardInfoMapper.selectStandardInfoList(standardInfo);
    }

    /**
     * 新增作业规范
     * 
     * @param standardInfo 作业规范
     * @return 结果
     */
    @Override
    public int insertStandardInfo(StandardInfo standardInfo)
    {
        standardInfo.setCreateTime(DateUtils.getNowDate());
        return standardInfoMapper.insertStandardInfo(standardInfo);
    }

    /**
     * 修改作业规范
     * 
     * @param standardInfo 作业规范
     * @return 结果
     */
    @Override
    public int updateStandardInfo(StandardInfo standardInfo)
    {
        standardInfo.setUpdateTime(DateUtils.getNowDate());
        return standardInfoMapper.updateStandardInfo(standardInfo);
    }

    /**
     * 批量删除作业规范
     * 
     * @param standardIds 需要删除的作业规范主键
     * @return 结果
     */
    @Override
    public int deleteStandardInfoByStandardIds(Long[] standardIds)
    {
        return standardInfoMapper.deleteStandardInfoByStandardIds(standardIds);
    }

    /**
     * 删除作业规范信息
     * 
     * @param standardId 作业规范主键
     * @return 结果
     */
    @Override
    public int deleteStandardInfoByStandardId(Long standardId)
    {
        return standardInfoMapper.deleteStandardInfoByStandardId(standardId);
    }
}
