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

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

    default PageResult<BusinessQualityControlSampleProjectDO> selectPage(BusinessQualityControlSampleProjectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessQualityControlSampleProjectDO>()
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getConfigStandardSampleProjectId, reqVO.getConfigStandardSampleProjectId())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
                .likeIfPresent(BusinessQualityControlSampleProjectDO::getDictionaryProjectName, reqVO.getDictionaryProjectName())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getDictionaryProjectUnit, reqVO.getDictionaryProjectUnit())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getStandardValue, reqVO.getStandardValue())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getToleraanceValue, reqVO.getToleraanceValue())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getQualityControlValue, reqVO.getQualityControlValue())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getDataType, reqVO.getDataType())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getDecimalPosition, reqVO.getDecimalPosition())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getSortNo, reqVO.getSortNo())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(BusinessQualityControlSampleProjectDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getUpdateCount, reqVO.getUpdateCount())
                .eqIfPresent(BusinessQualityControlSampleProjectDO::getRemark, reqVO.getRemark())
                .orderByDesc(BusinessQualityControlSampleProjectDO::getId));
    }

}