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

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
/**
 * 荧光采集记录 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface BusinessXRFDataMapper extends BaseMapperX<BusinessXRFDataDO> {

    default PageResult<BusinessXRFDataDO> selectPage(BusinessXRFDataPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessXRFDataDO>()
                .eqIfPresent(BusinessXRFDataDO::getDeviceNo, reqVO.getDeviceNo())
                .likeIfPresent(BusinessXRFDataDO::getLineName, reqVO.getLineName())
                .eqIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleId())
                .eqIfPresent(BusinessXRFDataDO::getSampleCode, reqVO.getSampleCode())
                .likeIfPresent(BusinessXRFDataDO::getSampleName, reqVO.getSampleName())
                .betweenIfPresent(BusinessXRFDataDO::getSampleTime, reqVO.getSampleTime())
                .eqIfPresent(BusinessXRFDataDO::getAssayOperator, reqVO.getAssayOperator())
                .eqIfPresent(BusinessXRFDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId())
                .eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
                .eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
                .eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
                .eqIfPresent(BusinessXRFDataDO::getIsReported, reqVO.getIsReported())
                .eqIfPresent(BusinessXRFDataDO::getReporter, reqVO.getReporter())
                .betweenIfPresent(BusinessXRFDataDO::getReportTime, reqVO.getReportTime())
                .eqIfPresent(BusinessXRFDataDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessXRFDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessXRFDataDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessXRFDataDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessXRFDataDO::getId));
    }

    default List<BusinessXRFDataDO> selectList(BusinessXRFDataReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BusinessXRFDataDO>()
                .eqIfPresent(BusinessXRFDataDO::getDeviceNo, reqVO.getDeviceNo())
                .likeIfPresent(BusinessXRFDataDO::getLineName, reqVO.getLineName())
                .eqIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleId())
                .inIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleIdList())
                .eqIfPresent(BusinessXRFDataDO::getSampleCode, reqVO.getSampleCode())
                .likeIfPresent(BusinessXRFDataDO::getSampleName, reqVO.getSampleName())
                .betweenIfPresent(BusinessXRFDataDO::getSampleTime, reqVO.getSampleTime())
                .eqIfPresent(BusinessXRFDataDO::getAssayOperator, reqVO.getAssayOperator())
                .eqIfPresent(BusinessXRFDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
                .eqIfPresent(BusinessXRFDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId())
                .eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
                .eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
                .eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
                .eqIfPresent(BusinessXRFDataDO::getIsReported, reqVO.getIsReported())
                .eqIfPresent(BusinessXRFDataDO::getReporter, reqVO.getReporter())
                .betweenIfPresent(BusinessXRFDataDO::getReportTime, reqVO.getReportTime())
                .eqIfPresent(BusinessXRFDataDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessXRFDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessXRFDataDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessXRFDataDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessXRFDataDO::getId));
    }

}