package com.yanzhu.jh.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.jh.project.mapper.SurProjectAttendanceCfgMapper;
import com.yanzhu.jh.project.domain.SurProjectAttendanceCfg;
import com.yanzhu.jh.project.service.ISurProjectAttendanceCfgService;
import com.ruoyi.common.utils.SecurityUtils;
/**
 * 项目考勤配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-24
 */
@Service
public class SurProjectAttendanceCfgServiceImpl implements ISurProjectAttendanceCfgService 
{
    @Autowired
    private SurProjectAttendanceCfgMapper surProjectAttendanceCfgMapper;

    /**
     * 查询项目考勤配置
     * 
     * @param id 项目考勤配置主键
     * @return 项目考勤配置
     */
    @Override
    public SurProjectAttendanceCfg selectSurProjectAttendanceCfgById(Long id)
    {
        return surProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgById(id);
    }

    /**
     * 查询项目考勤配置列表
     * 
     * @param surProjectAttendanceCfg 项目考勤配置
     * @return 项目考勤配置
     */
    @Override
    public List<SurProjectAttendanceCfg> selectSurProjectAttendanceCfgList(SurProjectAttendanceCfg surProjectAttendanceCfg)
    {
        return surProjectAttendanceCfgMapper.selectSurProjectAttendanceCfgList(surProjectAttendanceCfg);
    }

    /**
     * 新增项目考勤配置
     * 
     * @param surProjectAttendanceCfg 项目考勤配置
     * @return 结果
     */
    @Override
    public int insertSurProjectAttendanceCfg(SurProjectAttendanceCfg surProjectAttendanceCfg)
    {
        surProjectAttendanceCfg.setCreateBy(SecurityUtils.getUsername());
        surProjectAttendanceCfg.setCreateTime(DateUtils.getNowDate());
        return surProjectAttendanceCfgMapper.insertSurProjectAttendanceCfg(surProjectAttendanceCfg);
    }

    /**
     * 修改项目考勤配置
     * 
     * @param surProjectAttendanceCfg 项目考勤配置
     * @return 结果
     */
    @Override
    public int updateSurProjectAttendanceCfg(SurProjectAttendanceCfg surProjectAttendanceCfg)
    {
        surProjectAttendanceCfg.setUpdateBy(SecurityUtils.getUsername());
        surProjectAttendanceCfg.setUpdateTime(DateUtils.getNowDate());
        return surProjectAttendanceCfgMapper.updateSurProjectAttendanceCfg(surProjectAttendanceCfg);
    }

    /**
     * 批量删除项目考勤配置
     * 
     * @param ids 需要删除的项目考勤配置主键
     * @return 结果
     */
    @Override
    public int deleteSurProjectAttendanceCfgByIds(Long[] ids)
    {
        return surProjectAttendanceCfgMapper.deleteSurProjectAttendanceCfgByIds(ids);
    }

    /**
     * 删除项目考勤配置信息
     * 
     * @param id 项目考勤配置主键
     * @return 结果
     */
    @Override
    public int deleteSurProjectAttendanceCfgById(Long id)
    {
        return surProjectAttendanceCfgMapper.deleteSurProjectAttendanceCfgById(id);
    }
}
