package com.dcsoft.system.kq.service.impl;

import com.dcsoft.common.core.utils.DateUtils;
import com.dcsoft.system.kq.domain.KqClasses;
import com.dcsoft.system.kq.mapper.KqClassesMapper;
import com.dcsoft.system.kq.service.IKqClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考勤班次Service业务层处理
 *
 * @author dcsoft
 * @date 2023-01-06
 */
@Service
public class KqClassesServiceImpl implements IKqClassesService
{
    @Autowired
    private KqClassesMapper kqClassesMapper;

    /**
     * 查询考勤班次
     *
     * @param classesId 考勤班次主键
     * @return 考勤班次
     */
    @Override
    public KqClasses selectKqClassesByClassesId(Long classesId)
    {
        return kqClassesMapper.selectKqClassesByClassesId(classesId);
    }

    /**
     * 查询考勤班次列表
     *
     * @param kqClasses 考勤班次
     * @return 考勤班次
     */
    @Override
    public List<KqClasses> selectKqClassesList(KqClasses kqClasses)
    {
        return kqClassesMapper.selectKqClassesList(kqClasses);
    }

    /**
     * 新增考勤班次
     *
     * @param kqClasses 考勤班次
     * @return 结果
     */
    @Override
    public int insertKqClasses(KqClasses kqClasses)
    {
        kqClasses.setCreateTime(DateUtils.getNowDate());
        return kqClassesMapper.insertKqClasses(kqClasses);
    }

    /**
     * 修改考勤班次
     *
     * @param kqClasses 考勤班次
     * @return 结果
     */
    @Override
    public int updateKqClasses(KqClasses kqClasses)
    {
        kqClasses.setUpdateTime(DateUtils.getNowDate());
        return kqClassesMapper.updateKqClasses(kqClasses);
    }

    /**
     * 批量删除考勤班次
     *
     * @param classesIds 需要删除的考勤班次主键
     * @return 结果
     */
    @Override
    public int deleteKqClassesByClassesIds(Long[] classesIds)
    {
        return kqClassesMapper.deleteKqClassesByClassesIds(classesIds);
    }

    /**
     * 删除考勤班次信息
     *
     * @param classesId 考勤班次主键
     * @return 结果
     */
    @Override
    public int deleteKqClassesByClassesId(Long classesId)
    {
        return kqClassesMapper.deleteKqClassesByClassesId(classesId);
    }
}
