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

import java.util.*;

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.BusinessSubSampleParentRetestDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 分样复测业务数据 Mapper
 *
 * @author 后台管理-1
 */
@Mapper
public interface BusinessSubSampleParentRetestMapper extends BaseMapperX<BusinessSubSampleParentRetestDO> {

    default PageResult<BusinessSubSampleParentRetestDO> selectPage(BusinessSubSampleParentRetestPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSubSampleParentRetestDO>()
                .eqIfPresent(BusinessSubSampleParentRetestDO::getSampleId, reqVO.getSampleId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getBusinessSubParentSampleAssessmentId, reqVO.getBusinessSubParentSampleAssessmentId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestCount, reqVO.getRetestCount())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestBusinessBaseSampleId, reqVO.getRetestBusinessBaseSampleId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestBusinessSubParentSampleId, reqVO.getRetestBusinessSubParentSampleId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestConfigAssayMethodId, reqVO.getRetestConfigAssayMethodId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getRetestBusinessSubParentSampleAssessmentId, reqVO.getRetestBusinessSubParentSampleAssessmentId())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessSubSampleParentRetestDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessSubSampleParentRetestDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessSubSampleParentRetestDO::getId));
    }

	default List<BusinessSubSampleParentRetestDO> selectByRetestBusinessSubParentSampleIdsAndRetestConfigAssayMethodId(List<Long> retestBusinessSubParentSampleIds, Long retestConfigAssayMethodId) {
		return selectList(new LambdaQueryWrapperX<BusinessSubSampleParentRetestDO>()
				.in(BusinessSubSampleParentRetestDO::getRetestBusinessSubParentSampleId, retestBusinessSubParentSampleIds)
				.eq(BusinessSubSampleParentRetestDO::getRetestConfigAssayMethodId, retestConfigAssayMethodId));
	}

}