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


import com.dcsoft.common.core.utils.DateUtils;
import com.dcsoft.system.kq.domain.KqClassesItem;
import com.dcsoft.system.kq.mapper.KqClassesItemMapper;
import com.dcsoft.system.kq.service.IKqClassesItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考勤班次Service业务层处理
 *
 * @author dcsoft
 * @date 2023-01-09
 */
@Service
public class KqClassesItemServiceImpl implements IKqClassesItemService
{
    @Autowired
    private KqClassesItemMapper kqClassesItemMapper;

    /**
     * 查询考勤班次
     *
     * @param itemId 考勤班次主键
     * @return 考勤班次
     */
    @Override
    public KqClassesItem selectKqClassesItemByItemId(Long itemId)
    {
        return kqClassesItemMapper.selectKqClassesItemByItemId(itemId);
    }

    /**
     * 查询考勤班次列表
     *
     * @param kqClassesItem 考勤班次
     * @return 考勤班次
     */
    @Override
    public List<KqClassesItem> selectKqClassesItemList(KqClassesItem kqClassesItem)
    {
        return kqClassesItemMapper.selectKqClassesItemList(kqClassesItem);
    }

    /**
     * 新增考勤班次
     *
     * @param kqClassesItem 考勤班次
     * @return 结果
     */
    @Override
    public int insertKqClassesItem(KqClassesItem kqClassesItem)
    {
        kqClassesItem.setCreateTime(DateUtils.getNowDate());
        return kqClassesItemMapper.insertKqClassesItem(kqClassesItem);
    }

    /**
     * 修改考勤班次
     *
     * @param kqClassesItem 考勤班次
     * @return 结果
     */
    @Override
    public int updateKqClassesItem(KqClassesItem kqClassesItem)
    {
        kqClassesItem.setUpdateTime(DateUtils.getNowDate());
        return kqClassesItemMapper.updateKqClassesItem(kqClassesItem);
    }

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

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

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