package com.zt.plat.module.qms.business.reportdoc.dal.mapper;

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainCorrelationPageReqVO;
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 检测报告关系表 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ReportDocumentMainCorrelationMapper extends BaseMapperX<ReportDocumentMainCorrelationDO> {

    default PageResult<ReportDocumentMainCorrelationDO> selectPage(ReportDocumentMainCorrelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReportDocumentMainCorrelationDO>()
                .eqIfPresent(ReportDocumentMainCorrelationDO::getMainId, reqVO.getMainId())
                .eqIfPresent(ReportDocumentMainCorrelationDO::getCorrelationId, reqVO.getCorrelationId())
                .eqIfPresent(ReportDocumentMainCorrelationDO::getCorrelationType, reqVO.getCorrelationType())
                .eqIfPresent(ReportDocumentMainCorrelationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ReportDocumentMainCorrelationDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ReportDocumentMainCorrelationDO::getRemark, reqVO.getRemark())
                .orderByDesc(ReportDocumentMainCorrelationDO::getId));
    }

}