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


import com.dcsoft.common.core.utils.DateUtils;
import com.dcsoft.system.kq.domain.KqHoliday;
import com.dcsoft.system.kq.mapper.KqHolidayMapper;
import com.dcsoft.system.kq.service.IKqHolidayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 假期设置Service业务层处理
 *
 * @author dcsoft
 * @date 2023-01-11
 */
@Service
public class KqHolidayServiceImpl implements IKqHolidayService
{
    @Autowired
    private KqHolidayMapper kqHolidayMapper;

    /**
     * 查询假期设置
     *
     * @param holidayId 假期设置主键
     * @return 假期设置
     */
    @Override
    public KqHoliday selectKqHolidayByHolidayId(Long holidayId)
    {
        return kqHolidayMapper.selectKqHolidayByHolidayId(holidayId);
    }

    /**
     * 查询假期设置列表
     *
     * @param kqHoliday 假期设置
     * @return 假期设置
     */
    @Override
    public List<KqHoliday> selectKqHolidayList(KqHoliday kqHoliday)
    {
        return kqHolidayMapper.selectKqHolidayList(kqHoliday);
    }

    /**
     * 新增假期设置
     *
     * @param kqHoliday 假期设置
     * @return 结果
     */
    @Override
    public int insertKqHoliday(KqHoliday kqHoliday)
    {
        kqHoliday.setCreateTime(DateUtils.getNowDate());
        return kqHolidayMapper.insertKqHoliday(kqHoliday);
    }

    /**
     * 修改假期设置
     *
     * @param kqHoliday 假期设置
     * @return 结果
     */
    @Override
    public int updateKqHoliday(KqHoliday kqHoliday)
    {
        kqHoliday.setUpdateTime(DateUtils.getNowDate());
        return kqHolidayMapper.updateKqHoliday(kqHoliday);
    }

    /**
     * 批量删除假期设置
     *
     * @param holidayIds 需要删除的假期设置主键
     * @return 结果
     */
    @Override
    public int deleteKqHolidayByHolidayIds(Long[] holidayIds)
    {
        return kqHolidayMapper.deleteKqHolidayByHolidayIds(holidayIds);
    }

    /**
     * 删除假期设置信息
     *
     * @param holidayId 假期设置主键
     * @return 结果
     */
    @Override
    public int deleteKqHolidayByHolidayId(Long holidayId)
    {
        return kqHolidayMapper.deleteKqHolidayByHolidayId(holidayId);
    }

    @Override
    public KqHoliday selectKqHolidayByHolidayTimeStamp(Long timeStamp) {
        return kqHolidayMapper.selectKqHolidayByHolidayTimeStamp(timeStamp);
    }

    /**
     * 删除假期设置信息
     *
     * @param timeStamp 假期设置主键
     * @return 结果
     */
    @Override
    public int deleteKqHolidayByHolidayTimeStamp(Long timeStamp)
    {
        return kqHolidayMapper.deleteKqHolidayByHolidayTimeStamp(timeStamp);

    }

}
