package cn.iocoder.yudao.module.system.dal.mysql.holiday.holidaysettingrange;

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.system.controller.admin.holiday.holidaysettingrange.vo.HolidaySettingRangePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.holiday.holidaysettingrange.HolidaySettingRangeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 假期规则人员范围 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface HolidaySettingRangeMapper extends BaseMapperX<HolidaySettingRangeDO> {

    default PageResult<HolidaySettingRangeDO> selectPage(HolidaySettingRangePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HolidaySettingRangeDO>()
                .eqIfPresent(HolidaySettingRangeDO::getHolidaySettingId, reqVO.getHolidaySettingId())
                .eqIfPresent(HolidaySettingRangeDO::getType, reqVO.getType())
                .eqIfPresent(HolidaySettingRangeDO::getObjectId, reqVO.getObjectId())
                .betweenIfPresent(HolidaySettingRangeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HolidaySettingRangeDO::getId));
    }

}
