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

/**
 * 加班扣除规则 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface WorkOvertimeDeductRuleMapper extends BaseMapperX<WorkOvertimeDeductRuleDO> {

    default PageResult<WorkOvertimeDeductRuleDO> selectPage(WorkOvertimeDeductRulePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WorkOvertimeDeductRuleDO>()
                .eqIfPresent(WorkOvertimeDeductRuleDO::getRuleId, reqVO.getRuleId())
                .eqIfPresent(WorkOvertimeDeductRuleDO::getThreshold, reqVO.getThreshold())
                .eqIfPresent(WorkOvertimeDeductRuleDO::getDeductNum, reqVO.getDeductNum())
                .betweenIfPresent(WorkOvertimeDeductRuleDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WorkOvertimeDeductRuleDO::getId));
    }

}