package com.dcsoft.system.service.impl;

import java.util.List;
import com.dcsoft.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dcsoft.system.mapper.SysPeopleRuleMapper;
import com.dcsoft.system.domain.SysPeopleRule;
import com.dcsoft.system.service.ISysPeopleRuleService;

/**
 * 人员规则关联Service业务层处理
 *
 * @author dcsoft
 * @date 2023-12-22
 */
@Service
public class SysPeopleRuleServiceImpl implements ISysPeopleRuleService
{
    @Autowired
    private SysPeopleRuleMapper sysPeopleRuleMapper;

    /**
     * 查询人员规则关联
     *
     * @param id 人员规则关联主键
     * @return 人员规则关联
     */
    @Override
    public SysPeopleRule selectSysPeopleRuleById(Long id)
    {
        return sysPeopleRuleMapper.selectSysPeopleRuleById(id);
    }

    /**
     * 查询人员规则关联列表
     *
     * @param sysPeopleRule 人员规则关联
     * @return 人员规则关联
     */
    @Override
    public List<SysPeopleRule> selectSysPeopleRuleList(SysPeopleRule sysPeopleRule)
    {
        return sysPeopleRuleMapper.selectSysPeopleRuleList(sysPeopleRule);
    }

    /**
     * 新增人员规则关联
     *
     * @param sysPeopleRule 人员规则关联
     * @return 结果
     */
    @Override
    public int insertSysPeopleRule(SysPeopleRule sysPeopleRule)
    {
        sysPeopleRule.setCreateTime(DateUtils.getNowDate());
        return sysPeopleRuleMapper.insertSysPeopleRule(sysPeopleRule);
    }

    /**
     * 修改人员规则关联
     *
     * @param sysPeopleRule 人员规则关联
     * @return 结果
     */
    @Override
    public int updateSysPeopleRule(SysPeopleRule sysPeopleRule)
    {
        sysPeopleRule.setUpdateTime(DateUtils.getNowDate());
        return sysPeopleRuleMapper.updateSysPeopleRule(sysPeopleRule);
    }

    /**
     * 批量删除人员规则关联
     *
     * @param ids 需要删除的人员规则关联主键
     * @return 结果
     */
    @Override
    public int deleteSysPeopleRuleByIds(Long[] ids)
    {
        return sysPeopleRuleMapper.deleteSysPeopleRuleByIds(ids);
    }

    /**
     * 删除人员规则关联信息
     *
     * @param id 人员规则关联主键
     * @return 结果
     */
    @Override
    public int deleteSysPeopleRuleById(Long id)
    {
        return sysPeopleRuleMapper.deleteSysPeopleRuleById(id);
    }
}
