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

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

/**
 * 假期余额设置 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface HolidayBalanceSettingMapper extends BaseMapperX<HolidayBalanceSettingDO> {

    default PageResult<HolidayBalanceSettingDO> selectPage(HolidayBalanceSettingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HolidayBalanceSettingDO>()
                .eqIfPresent(HolidayBalanceSettingDO::getHolidaySettingId, reqVO.getHolidaySettingId())
                .eqIfPresent(HolidayBalanceSettingDO::getStatus, reqVO.getStatus())
                .eqIfPresent(HolidayBalanceSettingDO::getType, reqVO.getType())
                .eqIfPresent(HolidayBalanceSettingDO::getIssueTimeType, reqVO.getIssueTimeType())
                .betweenIfPresent(HolidayBalanceSettingDO::getIssueTime, reqVO.getIssueTime())
                .eqIfPresent(HolidayBalanceSettingDO::getQuotaRule, reqVO.getQuotaRule())
                .eqIfPresent(HolidayBalanceSettingDO::getQuota, reqVO.getQuota())
                .eqIfPresent(HolidayBalanceSettingDO::getActualWorkFlag, reqVO.getActualWorkFlag())
                .eqIfPresent(HolidayBalanceSettingDO::getValidityPeriod, reqVO.getValidityPeriod())
                .eqIfPresent(HolidayBalanceSettingDO::getFixedEveryYearInvalid, reqVO.getFixedEveryYearInvalid())
                .eqIfPresent(HolidayBalanceSettingDO::getFixedEveryMonthInvalid, reqVO.getFixedEveryMonthInvalid())
                .eqIfPresent(HolidayBalanceSettingDO::getExtensionAllowedFlag, reqVO.getExtensionAllowedFlag())
                .eqIfPresent(HolidayBalanceSettingDO::getExtendNum, reqVO.getExtendNum())
                .eqIfPresent(HolidayBalanceSettingDO::getExpirationReminderFlag, reqVO.getExpirationReminderFlag())
                .eqIfPresent(HolidayBalanceSettingDO::getReminderTimeNum, reqVO.getReminderTimeNum())
                .eqIfPresent(HolidayBalanceSettingDO::getReminderRange, reqVO.getReminderRange())
                .betweenIfPresent(HolidayBalanceSettingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HolidayBalanceSettingDO::getId));
    }

}
