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.ClockUserInfoMapper;
import com.ruoyi.system.domain.ClockUserInfo;
import com.ruoyi.system.service.IClockUserInfoService;

/**
 * 打卡人员信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-06
 */
@Service
public class ClockUserInfoServiceImpl implements IClockUserInfoService 
{
    @Autowired
    private ClockUserInfoMapper clockUserInfoMapper;

    /**
     * 查询打卡人员信息
     * 
     * @param userId 打卡人员信息主键
     * @return 打卡人员信息
     */
    @Override
    public ClockUserInfo selectClockUserInfoByUserId(Long userId)
    {
        return clockUserInfoMapper.selectClockUserInfoByUserId(userId);
    }

    /**
     * 查询打卡人员信息列表
     * 
     * @param clockUserInfo 打卡人员信息
     * @return 打卡人员信息
     */
    @Override
    public List<ClockUserInfo> selectClockUserInfoList(ClockUserInfo clockUserInfo)
    {
        return clockUserInfoMapper.selectClockUserInfoList(clockUserInfo);
    }

    /**
     * 新增打卡人员信息
     * 
     * @param clockUserInfo 打卡人员信息
     * @return 结果
     */
    @Override
    public int insertClockUserInfo(ClockUserInfo clockUserInfo)
    {
        clockUserInfo.setCreateTime(DateUtils.getNowDate());
        return clockUserInfoMapper.insertClockUserInfo(clockUserInfo);
    }

    /**
     * 修改打卡人员信息
     * 
     * @param clockUserInfo 打卡人员信息
     * @return 结果
     */
    @Override
    public int updateClockUserInfo(ClockUserInfo clockUserInfo)
    {
        clockUserInfo.setUpdateTime(DateUtils.getNowDate());
        return clockUserInfoMapper.updateClockUserInfo(clockUserInfo);
    }

    /**
     * 批量删除打卡人员信息
     * 
     * @param userIds 需要删除的打卡人员信息主键
     * @return 结果
     */
    @Override
    public int deleteClockUserInfoByUserIds(Long[] userIds)
    {
        return clockUserInfoMapper.deleteClockUserInfoByUserIds(userIds);
    }

    /**
     * 删除打卡人员信息信息
     * 
     * @param userId 打卡人员信息主键
     * @return 结果
     */
    @Override
    public int deleteClockUserInfoByUserId(Long userId)
    {
        return clockUserInfoMapper.deleteClockUserInfoByUserId(userId);
    }
}
