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

import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigStandardSampleTypePageReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigStandardSampleTypeDO;
import org.apache.ibatis.annotations.Mapper;
import com.zt.plat.module.qms.business.config.controller.vo.*;

/**
 * 标准样类型配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigStandardSampleTypeMapper extends BaseMapperX<ConfigStandardSampleTypeDO> {

    default PageResult<ConfigStandardSampleTypeDO> selectPage(ConfigStandardSampleTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigStandardSampleTypeDO>()
                .eqIfPresent(ConfigStandardSampleTypeDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId())
                .likeIfPresent(ConfigStandardSampleTypeDO::getName, reqVO.getName())
                .eqIfPresent(ConfigStandardSampleTypeDO::getCodeRule, reqVO.getCodeRule())
                .eqIfPresent(ConfigStandardSampleTypeDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
                .likeIfPresent(ConfigStandardSampleTypeDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
                .eqIfPresent(ConfigStandardSampleTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigStandardSampleTypeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigStandardSampleTypeDO::getRemark, reqVO.getRemark())
                .eqIfPresent(ConfigStandardSampleTypeDO::getVersion, reqVO.getVersion())
                .orderByDesc(ConfigStandardSampleTypeDO::getId));
    }

}