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

/**
 * 检验委托来源与样品类型配置 Mapper
 *
 * @author 后台管理
 */
@Mapper
public interface ConfigEntrustSourceSampleTypeMapper extends BaseMapperX<ConfigEntrustSourceSampleTypeDO> {

    default PageResult<ConfigEntrustSourceSampleTypeDO> selectPage(ConfigEntrustSourceSampleTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConfigEntrustSourceSampleTypeDO>()
                .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getConfigEntrustSourceId, reqVO.getConfigEntrustSourceId())
                .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
                .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey())
                .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
                .betweenIfPresent(ConfigEntrustSourceSampleTypeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConfigEntrustSourceSampleTypeDO::getRemark, reqVO.getRemark())
                .orderByDesc(ConfigEntrustSourceSampleTypeDO::getId));
    }

}