package com.ruoyi.system.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.ruoyi.system.mapper.KaoqinRecordMapper;
import com.ruoyi.system.domain.KaoqinRecord;
import com.ruoyi.system.service.IKaoqinRecordService;

/**
 * 考勤记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-02
 */
@Service
public class KaoqinRecordServiceImpl implements IKaoqinRecordService 
{
    @Autowired
    private KaoqinRecordMapper kaoqinRecordMapper;

    /**
     * 查询考勤记录
     * 
     * @param recordId 考勤记录主键
     * @return 考勤记录
     */
    @Override
    public KaoqinRecord selectKaoqinRecordByRecordId(Long recordId)
    {
        return kaoqinRecordMapper.selectKaoqinRecordByRecordId(recordId);
    }

    /**
     * 查询考勤记录列表
     * 
     * @param kaoqinRecord 考勤记录
     * @return 考勤记录
     */
    @Override
    public List<KaoqinRecord> selectKaoqinRecordList(KaoqinRecord kaoqinRecord)
    {
        return kaoqinRecordMapper.selectKaoqinRecordList(kaoqinRecord);
    }

    /**
     * 新增考勤记录
     * 
     * @param kaoqinRecord 考勤记录
     * @return 结果
     */
    @Override
    public int insertKaoqinRecord(KaoqinRecord kaoqinRecord)
    {
        kaoqinRecord.setCreateTime(DateUtils.getNowDate());
        return kaoqinRecordMapper.insertKaoqinRecord(kaoqinRecord);
    }

    /**
     * 修改考勤记录
     * 
     * @param kaoqinRecord 考勤记录
     * @return 结果
     */
    @Override
    public int updateKaoqinRecord(KaoqinRecord kaoqinRecord)
    {
        kaoqinRecord.setUpdateTime(DateUtils.getNowDate());
        return kaoqinRecordMapper.updateKaoqinRecord(kaoqinRecord);
    }

    /**
     * 批量删除考勤记录
     * 
     * @param recordIds 需要删除的考勤记录主键
     * @return 结果
     */
    @Override
    public int deleteKaoqinRecordByRecordIds(Long[] recordIds)
    {
        return kaoqinRecordMapper.deleteKaoqinRecordByRecordIds(recordIds);
    }

    /**
     * 删除考勤记录信息
     * 
     * @param recordId 考勤记录主键
     * @return 结果
     */
    @Override
    public int deleteKaoqinRecordByRecordId(Long recordId)
    {
        return kaoqinRecordMapper.deleteKaoqinRecordByRecordId(recordId);
    }
}
