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

/**
 * 委检登记分析部门样品明细 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface BusinessSampleEntrustDepartmentDetailMapper extends BaseMapperX<BusinessSampleEntrustDepartmentDetailDO> {

	default PageResult<BusinessSampleEntrustDepartmentDetailDO> selectPage(BusinessSampleEntrustDepartmentDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSampleEntrustDepartmentDetailDO>()
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getBusinessSampleEntrustRegistrationId, reqVO.getBusinessSampleEntrustRegistrationId())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getBusinessSampleEntrustDepartmentId, reqVO.getBusinessSampleEntrustDepartmentId())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getBaseSampleId, reqVO.getBaseSampleId())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getSampleTypeDictionaryBusinessId, reqVO.getSampleTypeDictionaryBusinessId())
                .likeIfPresent(BusinessSampleEntrustDepartmentDetailDO::getSampleName, reqVO.getSampleName())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getSampleCode, reqVO.getSampleCode())
                .likeIfPresent(BusinessSampleEntrustDepartmentDetailDO::getEntrustSampleName, reqVO.getEntrustSampleName())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getEntrustSampleCode, reqVO.getEntrustSampleCode())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getAssayProject, reqVO.getAssayProject())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getAssayStatus, reqVO.getAssayStatus())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getSort, reqVO.getSort())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessSampleEntrustDepartmentDetailDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessSampleEntrustDepartmentDetailDO::getId));
    }
    
    default List<BusinessSampleEntrustDepartmentDetailDO> selectByBusinessSampleEntrustDepartmentId(Long businessSampleEntrustDepartmentId) {
    	return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDepartmentDetailDO>()
    			.eqIfPresent(BusinessSampleEntrustDepartmentDetailDO::getBusinessSampleEntrustDepartmentId, businessSampleEntrustDepartmentId)
    			.orderByAsc(BusinessSampleEntrustDepartmentDetailDO::getId));
    }

	default List<BusinessSampleEntrustDepartmentDetailDO> selectByBusinessSampleEntrustRegistrationIds(List<Long> businessSampleEntrustRegistrationIdList) {
    	return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDepartmentDetailDO>()
    			.inIfPresent(BusinessSampleEntrustDepartmentDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationIdList)
    			.orderByAsc(BusinessSampleEntrustDepartmentDetailDO::getId));
	}

}