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.RegulationInfoMapper;
import com.xinda.itsm.domain.RegulationInfo;
import com.xinda.itsm.service.IRegulationInfoService;

/**
 * 制度管理Service业务层处理
 * 
 * @author kerwincui
 * @date 2025-04-27
 */
@Service
public class RegulationInfoServiceImpl implements IRegulationInfoService 
{
    @Autowired
    private RegulationInfoMapper regulationInfoMapper;

    /**
     * 查询制度管理
     * 
     * @param regulationId 制度管理主键
     * @return 制度管理
     */
    @Override
    public RegulationInfo selectRegulationInfoByRegulationId(Long regulationId)
    {
        return regulationInfoMapper.selectRegulationInfoByRegulationId(regulationId);
    }

    /**
     * 查询制度管理列表
     * 
     * @param regulationInfo 制度管理
     * @return 制度管理
     */
    @Override
    public List<RegulationInfo> selectRegulationInfoList(RegulationInfo regulationInfo)
    {
        return regulationInfoMapper.selectRegulationInfoList(regulationInfo);
    }

    /**
     * 新增制度管理
     * 
     * @param regulationInfo 制度管理
     * @return 结果
     */
    @Override
    public int insertRegulationInfo(RegulationInfo regulationInfo)
    {
        regulationInfo.setCreateTime(DateUtils.getNowDate());
        return regulationInfoMapper.insertRegulationInfo(regulationInfo);
    }

    /**
     * 修改制度管理
     * 
     * @param regulationInfo 制度管理
     * @return 结果
     */
    @Override
    public int updateRegulationInfo(RegulationInfo regulationInfo)
    {
        regulationInfo.setUpdateTime(DateUtils.getNowDate());
        return regulationInfoMapper.updateRegulationInfo(regulationInfo);
    }

    /**
     * 批量删除制度管理
     * 
     * @param regulationIds 需要删除的制度管理主键
     * @return 结果
     */
    @Override
    public int deleteRegulationInfoByRegulationIds(Long[] regulationIds)
    {
        return regulationInfoMapper.deleteRegulationInfoByRegulationIds(regulationIds);
    }

    /**
     * 删除制度管理信息
     * 
     * @param regulationId 制度管理主键
     * @return 结果
     */
    @Override
    public int deleteRegulationInfoByRegulationId(Long regulationId)
    {
        return regulationInfoMapper.deleteRegulationInfoByRegulationId(regulationId);
    }
}
