package cn.iocoder.byzs.module.bjdx.dal.mysql.reportmanage;

import cn.iocoder.byzs.framework.common.pojo.PageResult;
import cn.iocoder.byzs.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.byzs.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.byzs.module.bjdx.controller.admin.reportmanage.vo.ReportManagePageReqVO;
import cn.iocoder.byzs.module.bjdx.dal.dataobject.reportmanage.ReportManageDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 评估报告-评语 Mapper
 *
 * @author lyb
 */
@Mapper
public interface ReportManageMapper extends BaseMapperX<ReportManageDO> {

    default PageResult<ReportManageDO> selectPage(ReportManagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReportManageDO>()
                .eqIfPresent(ReportManageDO::getBrcReportCourseMin, reqVO.getBrcReportCourseMin())
                .eqIfPresent(ReportManageDO::getBrcReportCourseMax, reqVO.getBrcReportCourseMax())
                .eqIfPresent(ReportManageDO::getBrcReportQuestMin, reqVO.getBrcReportQuestMin())
                .eqIfPresent(ReportManageDO::getBrcReportQuestMax, reqVO.getBrcReportQuestMax())
                .eqIfPresent(ReportManageDO::getBrcReportAiCountMin, reqVO.getBrcReportAiCountMin())
                .eqIfPresent(ReportManageDO::getBrcReportAiCountMax, reqVO.getBrcReportAiCountMax())
                .eqIfPresent(ReportManageDO::getBrcReportLevel, reqVO.getBrcReportLevel())
                .eqIfPresent(ReportManageDO::getBrcReportComment, reqVO.getBrcReportComment())
                .betweenIfPresent(ReportManageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ReportManageDO::getBrcId));
    }

}