package com.zt.plat.module.qms.business.config.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.config.controller.vo.*;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * 检测方法分析项目补正系数 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigAssayMethodProjectCoefficientMapper extends BaseMapperX<ConfigAssayMethodProjectCoefficientDO> {

    default PageResult<ConfigAssayMethodProjectCoefficientDO> selectPage(ConfigAssayMethodProjectCoefficientPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigAssayMethodProjectCoefficientDO>()
        		.eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
                .likeIfPresent(ConfigAssayMethodProjectCoefficientDO::getProjectSimpleName, reqVO.getProjectSimpleName())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getRange, reqVO.getRange())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getMinimumValue, reqVO.getMinimumValue())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getMaximumValue, reqVO.getMaximumValue())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getCoefficient, reqVO.getCoefficient())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigAssayMethodProjectCoefficientDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getRemark, reqVO.getRemark())
                .eqIfPresent(ConfigAssayMethodProjectCoefficientDO::getVersion, reqVO.getVersion())
                .orderByDesc(ConfigAssayMethodProjectCoefficientDO::getId));
    }

	default List<ConfigAssayMethodProjectCoefficientDO> selectByConfigBaseSampleIds(List<Long> configBaseSampleIdList){
		return selectList(new LambdaQueryWrapperX<ConfigAssayMethodProjectCoefficientDO>()
				.in(ConfigAssayMethodProjectCoefficientDO::getConfigBaseSampleId, configBaseSampleIdList));
	}

}