package cn.iocoder.yudao.module.crm.dal.mysql.salesperformanceassessment;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.crm.controller.admin.salesperformanceassessment.vo.SalesPerformanceAssessmentPageReqVO;
import cn.iocoder.yudao.module.crm.dal.dataobject.salesperformanceassessment.SalesPerformanceAssessmentDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 绩效考核设置 Mapper
 *
 * @author 艾楷
 */
@Mapper
public interface SalesPerformanceAssessmentMapper extends BaseMapperX<SalesPerformanceAssessmentDO> {

    default PageResult<SalesPerformanceAssessmentDO> selectPage(SalesPerformanceAssessmentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SalesPerformanceAssessmentDO>()
                .eqIfPresent(SalesPerformanceAssessmentDO::getCalculationExpression, reqVO.getCalculationExpression())
                .eqIfPresent(SalesPerformanceAssessmentDO::getProportion, reqVO.getProportion())
                .betweenIfPresent(SalesPerformanceAssessmentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SalesPerformanceAssessmentDO::getId));
    }

}
