package cn.hnthyy.thmz.service.impl.thmz;

import cn.hnthyy.thmz.entity.thmz.Holidays;
import cn.hnthyy.thmz.mapper.thmz.HolidaysMapper;
import cn.hnthyy.thmz.service.thmz.HolidaysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class HolidaysServiceImpl implements HolidaysService {
    @SuppressWarnings("all")
    @Autowired
    private HolidaysMapper holidaysMapper;
    @Override
    public int saveHolidays(Holidays holidays) {
        return holidaysMapper.insertHolidays(holidays);
    }

    @Override
    public int removeHolidays(Long id) {
        return holidaysMapper.deleteHolidays(id);
    }

    @Override
    public List<Holidays> queryHolidaysWithPage(Holidays holidays) {
        return holidaysMapper.selectHolidaysWithPage(holidays);
    }

    @Override
    public Integer queryCountHolidays(Holidays holidays) {
        return holidaysMapper.selectCountHolidays(holidays);
    }

    @Override
    public Holidays queryById(Long id) {
        return holidaysMapper.selectById(id);
    }

    @Override
    public List<Holidays> queryHolidaysByDate(Date beginDate) {
        return holidaysMapper.selectHolidaysByDate(beginDate);
    }
}
