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

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.holidayworkingage.vo.HolidayWorkingAgePageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.holiday.holidayworkingage.HolidayWorkingAgeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 假期额度工龄配置 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface HolidayWorkingAgeMapper extends BaseMapperX<HolidayWorkingAgeDO> {

    default PageResult<HolidayWorkingAgeDO> selectPage(HolidayWorkingAgePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HolidayWorkingAgeDO>()
                .eqIfPresent(HolidayWorkingAgeDO::getHolidaySettingId, reqVO.getHolidaySettingId())
                .eqIfPresent(HolidayWorkingAgeDO::getHolidayBalanceSettingId, reqVO.getHolidayBalanceSettingId())
                .eqIfPresent(HolidayWorkingAgeDO::getYears, reqVO.getYears())
                .eqIfPresent(HolidayWorkingAgeDO::getNum, reqVO.getNum())
                .betweenIfPresent(HolidayWorkingAgeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HolidayWorkingAgeDO::getId));
    }

}
