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

/**
 * 质控样检测项目数据业务 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface BusinessQCProjectDataMapper extends BaseMapperX<BusinessQCProjectDataDO> {

    default PageResult<BusinessQCProjectDataDO> selectPage(BusinessQCProjectDataPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessQCProjectDataDO>()
                .eqIfPresent(BusinessQCProjectDataDO::getBusinessQCDataId, reqVO.getBusinessQCDataId())
                .eqIfPresent(BusinessQCProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
                .eqIfPresent(BusinessQCProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
                .eqIfPresent(BusinessQCProjectDataDO::getUsage, reqVO.getUsage())
                .eqIfPresent(BusinessQCProjectDataDO::getSymbol, reqVO.getSymbol())
                .eqIfPresent(BusinessQCProjectDataDO::getValue, reqVO.getValue())
                .eqIfPresent(BusinessQCProjectDataDO::getDataType, reqVO.getDataType())
                .eqIfPresent(BusinessQCProjectDataDO::getDecimalPosition, reqVO.getDecimalPosition())
                .eqIfPresent(BusinessQCProjectDataDO::getIsNotAssessment, reqVO.getIsNotAssessment())
                .eqIfPresent(BusinessQCProjectDataDO::getIsEnabled, reqVO.getIsEnabled())
                .eqIfPresent(BusinessQCProjectDataDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessQCProjectDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessQCProjectDataDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessQCProjectDataDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessQCProjectDataDO::getId));
    }
    
    default List<BusinessQCProjectDataDO> selectByBusinessQCDataIds(List<Long> businessQCDataIds) {
    	return selectList(new LambdaQueryWrapperX<BusinessQCProjectDataDO>()
    			.in(BusinessQCProjectDataDO::getBusinessQCDataId, businessQCDataIds));
    }

}