package cn.iocoder.yudao.module.member.dal.mysql.holiday;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.holiday.HolidayDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.holiday.vo.*;

/**
 * 假期 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface HolidayMapper extends BaseMapperX<HolidayDO> {

    default PageResult<HolidayDO> selectPage(HolidayPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HolidayDO>()
                .eqIfPresent(HolidayDO::getHoliday, reqVO.getHoliday())
                .likeIfPresent(HolidayDO::getName, reqVO.getName())
                .betweenIfPresent(HolidayDO::getDate, reqVO.getDate())
                .betweenIfPresent(HolidayDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HolidayDO::getId));
    }

}