package cn.iocoder.yudao.module.system.dal.mysql.workovertime;

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.system.dal.dataobject.workovertime.WorkOvertimeMoreRuleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.workovertime.vo.*;

/**
 * 加班规则（更多规则） Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface WorkOvertimeMoreRuleMapper extends BaseMapperX<WorkOvertimeMoreRuleDO> {

    default PageResult<WorkOvertimeMoreRuleDO> selectPage(WorkOvertimeMoreRulePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WorkOvertimeMoreRuleDO>()
                .eqIfPresent(WorkOvertimeMoreRuleDO::getRuleId, reqVO.getRuleId())
                .eqIfPresent(WorkOvertimeMoreRuleDO::getUnit, reqVO.getUnit())
                .eqIfPresent(WorkOvertimeMoreRuleDO::getRoundingType, reqVO.getRoundingType())
                .eqIfPresent(WorkOvertimeMoreRuleDO::getRoundingIncrementalValue, reqVO.getRoundingIncrementalValue())
                .eqIfPresent(WorkOvertimeMoreRuleDO::getConversion, reqVO.getConversion())
                .betweenIfPresent(WorkOvertimeMoreRuleDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WorkOvertimeMoreRuleDO::getId));
    }

}