package cn.iocoder.yudao.module.server.dal.mysql.rectifyinforeport;

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

/**
 * 整改结果 Mapper
 *
 * @author TRS
 */
@Mapper
public interface RectifyInfoReportMapper extends BaseMapperX<RectifyInfoReportDO> {

    default PageResult<RectifyInfoReportDO> selectPage(RectifyInfoReportPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RectifyInfoReportDO>()
                .eqIfPresent(RectifyInfoReportDO::getInterviewCount, reqVO.getInterviewCount())
                .eqIfPresent(RectifyInfoReportDO::getWrittenExaminationCount, reqVO.getWrittenExaminationCount())
                .eqIfPresent(RectifyInfoReportDO::getCriticismCount, reqVO.getCriticismCount())
                .eqIfPresent(RectifyInfoReportDO::getWarningCount, reqVO.getWarningCount())
                .eqIfPresent(RectifyInfoReportDO::getDismissalCount, reqVO.getDismissalCount())
                .eqIfPresent(RectifyInfoReportDO::getOtherCount, reqVO.getOtherCount())
                .eqIfPresent(RectifyInfoReportDO::getQuarter, reqVO.getQuarter())
                .likeIfPresent(RectifyInfoReportDO::getReporterName, reqVO.getReporterName())
                .eqIfPresent(RectifyInfoReportDO::getReporterPhone, reqVO.getReporterPhone())
                .betweenIfPresent(RectifyInfoReportDO::getReportTime, reqVO.getReportTime())
                .eqIfPresent(RectifyInfoReportDO::getDepartmentId, reqVO.getDepartmentId())
                .eqIfPresent(RectifyInfoReportDO::getReportStatus, reqVO.getReportStatus())
                .eqIfPresent(RectifyInfoReportDO::getReportRemark, reqVO.getReportRemark())
                .eqIfPresent(RectifyInfoReportDO::getAttachment, reqVO.getAttachment())
                .betweenIfPresent(RectifyInfoReportDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RectifyInfoReportDO::getId));
    }

}