浏览代码

静态知识检索修改

wangyu 6 年之前
父节点
当前提交
46e2dd2245

+ 5 - 76
aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -290,17 +290,11 @@ public class ConceptFacade extends ConceptServiceImpl {
             }
         }
         List<ConceptRetrievalDTO> conceptRetrievalDTOS = Lists.newArrayList();
-        if (retrievalVO.getIsStatic().equals(1)) {
-            conceptRetrievalDTOS = this.staticKnowledge(retrievalVO);
-        } else {
-            conceptRetrievalDTOS = this.retrievalConcept(retrievalVO);
-        }
-
+        conceptRetrievalDTOS = this.retrievalConcept(retrievalVO);
         List<ConceptRetrievalDTO> res = new ArrayList<>();
         List<Long> selfList = new ArrayList<>(); // 本体
         List<Long> subList = new ArrayList<>(); // 子项
         List<String> conceptNameList = new ArrayList<>();//名称结果集保证数据唯一
-        List<Long> uniqueIdList = new ArrayList<>();
         for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
             if (StringUtil.isNotEmpty(bean.getParentName())) { // 重置showType
                 bean.setShowType(2L);
@@ -316,15 +310,6 @@ public class ConceptFacade extends ConceptServiceImpl {
             if (bean.getShowType().intValue() == 1) {
                 if(retrievalVO.getIsSonShow().intValue() == 0){//isSonShow为0执行检索去重逻辑
                     res.add(bean);
-                }else {//sSonShow不为0执行静态知识检索去重逻辑
-                    if(bean.getUniqueId() != null && bean.getUniqueId() != 0){
-                        if(!uniqueIdList.contains(bean.getUniqueId())){
-                            res.add(bean);
-                            uniqueIdList.add(bean.getUniqueId());
-                        }
-                    }else {
-                        res.add(bean);
-                    }
                 }
             } else if (bean.getShowType().intValue() == 2) {
                 if(retrievalVO.getIsSonShow().intValue() == 0){//isSonShow为0执行检索去重逻辑
@@ -332,13 +317,6 @@ public class ConceptFacade extends ConceptServiceImpl {
                         conceptNameList.add(bean.getParentName());
                         res.add(bean);
                     }
-                } else {//sSonShow不为0执行静态知识检索去重逻辑
-                    if(bean.getUniqueId() != null && bean.getUniqueId() != 0){
-                        if(!uniqueIdList.contains(bean.getUniqueId())){
-                            res.add(bean);
-                            uniqueIdList.add(bean.getUniqueId());
-                        }
-                    }
                 }
             } else if (bean.getShowType().intValue() == 0) {
                 if(retrievalVO.getIsSonShow().intValue() == 0){//isSonShow为0执行检索去重逻辑
@@ -346,15 +324,6 @@ public class ConceptFacade extends ConceptServiceImpl {
                         conceptNameList.add(bean.getSelfName());
                         res.add(bean);
                     }
-                }else {//SonShow不为0执行静态知识检索去重逻辑
-                    if(bean.getUniqueId() != null && bean.getUniqueId() != 0){
-                        if(!uniqueIdList.contains(bean.getUniqueId())){
-                            res.add(bean);
-                            uniqueIdList.add(bean.getUniqueId());
-                        }
-                    }else {
-                        res.add(bean);
-                    }
                 }
             }
         }
@@ -376,51 +345,11 @@ public class ConceptFacade extends ConceptServiceImpl {
      * @return
      */
     public List<RetrievalDTO> getStaticKnowledge(GetStaticKnowledgeVO getStaticKnowledgeVO) {
-        List<RetrievalDTO> retrievalDTOS = new ArrayList<>();
         RetrievalVO retrievalVO = new RetrievalVO();
-        RetrievalDTO retrievalDTO = new RetrievalDTO();
-        BeanUtil.copyProperties(getStaticKnowledgeVO, retrievalVO);
-        retrievalVO.setIsSonShow(1);
-        retrievalVO.setIsStatic(1);
-        List<Integer> types = new ArrayList<>();
-        for (Integer type : getStaticKnowledgeVO.getTypes()) {
-            if(type.intValue() == ConceptTypeEnum.Lis.getKey()){//单独设置化验类型
-                retrievalVO.setType(type);
-            }else {//查询时去掉化验
-                types.add(ParamConvertUtil.conceptConvert2Lib(type));
-            }
-        }
-        //设置类型为诊断、药品、辅检
-        retrievalVO.setOtherType(types);
-        //获取标签信息
-        List<ConceptRetrievalDTO> conceptRetrievalDTOList = this.retrivelConceptInfo(retrievalVO);
-        List<RetrievalDTO> staticRetrievalList = new ArrayList<>();
-        if (ListUtil.isNotEmpty(conceptRetrievalDTOList)) {
-            //封装
-            for (ConceptRetrievalDTO conceptRetrievalDTO : conceptRetrievalDTOList) {
-                retrievalDTO = new RetrievalDTO();
-                retrievalDTO.setConceptId(conceptRetrievalDTO.getSelfId());
-                retrievalDTO.setName(conceptRetrievalDTO.getSelfName());
-                retrievalDTO.setUniqueName(conceptRetrievalDTO.getUniqueName());
-                if (StringUtil.isNotEmpty(conceptRetrievalDTO.getParentName())) {//parent不为空时说明有子项,返回父级id
-                    retrievalDTO.setConceptId(conceptRetrievalDTO.getParentId());
-                    retrievalDTO.setName(conceptRetrievalDTO.getParentName());
-                    retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSelfName());
-                }
-                if (StringUtil.isNotEmpty(conceptRetrievalDTO.getSameName())) {//同义词
-                    retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSameName());
-                }
-                retrievalDTO.setLibTypeId(conceptRetrievalDTO.getLibTypeId());
-                retrievalDTO.setLibTypeName(conceptRetrievalDTO.getLibTypeName());
-                retrievalDTO.setType(conceptRetrievalDTO.getType());
-                retrievalDTO.setShowType(conceptRetrievalDTO.getShowType());
-                retrievalDTOS.add(retrievalDTO);
-            }
-        }
-        for (RetrievalDTO retrievalDTOInfo : retrievalDTOS) {
-            retrievalDTO = new RetrievalDTO();
-            BeanUtil.copyProperties(retrievalDTOInfo, retrievalDTO);
-            staticRetrievalList.add(retrievalDTO);
+        BeanUtil.copyProperties(getStaticKnowledgeVO,retrievalVO);
+        List<RetrievalDTO> staticRetrievalList = this.staticKnowledge(retrievalVO);
+        for (RetrievalDTO retrievalDTO : staticRetrievalList) {
+            retrievalDTO.setType(ParamConvertUtil.libConvert2Concept(retrievalDTO.getLibTypeId().intValue()));
         }
         return staticRetrievalList;
     }

+ 2 - 1
aipt-service/src/main/java/com/diagbot/mapper/ConceptMapper.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.ConceptRetrievalDTO;
 import com.diagbot.dto.ConceptWithOrderRes;
+import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.vo.ConceptBaseVO;
@@ -53,7 +54,7 @@ public interface ConceptMapper extends BaseMapper<Concept> {
      * @param retrievalVO
      * @return
      */
-    List<ConceptRetrievalDTO> staticKnowledge(RetrievalVO retrievalVO);
+    List<RetrievalDTO> staticKnowledge(RetrievalVO retrievalVO);
 
     List<ConceptBaseDTO> getConceptConMap(ConceptFindVO conceptFindVO);
 

+ 2 - 1
aipt-service/src/main/java/com/diagbot/service/ConceptService.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.ConceptRetrievalDTO;
 import com.diagbot.dto.ConceptWithOrderRes;
+import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.vo.ConceptBaseVO;
@@ -53,7 +54,7 @@ public interface ConceptService extends IService<Concept> {
      * @param retrievalVO
      * @return
      */
-    List<ConceptRetrievalDTO> staticKnowledge(RetrievalVO retrievalVO);
+    List<RetrievalDTO> staticKnowledge(RetrievalVO retrievalVO);
 
     List<ConceptBaseDTO> getConceptConMap(ConceptFindVO conceptFindVO);
 

+ 2 - 1
aipt-service/src/main/java/com/diagbot/service/impl/ConceptServiceImpl.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.ConceptRetrievalDTO;
 import com.diagbot.dto.ConceptWithOrderRes;
+import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.mapper.ConceptMapper;
@@ -56,7 +57,7 @@ public class ConceptServiceImpl extends ServiceImpl<ConceptMapper, Concept> impl
      * @return
      */
     @Override
-    public List<ConceptRetrievalDTO> staticKnowledge(RetrievalVO retrievalVO){
+    public List<RetrievalDTO> staticKnowledge(RetrievalVO retrievalVO){
         return baseMapper.staticKnowledge(retrievalVO);
     }
 

+ 625 - 289
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -415,295 +415,631 @@
         LIMIT 100
     </select>
 
-    <select id="staticKnowledge" resultType="com.diagbot.dto.ConceptRetrievalDTO">
-        -- 除化验外其他类型标签
-        (SELECT b1.*,0 uniqueId,null uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t7.is_deleted = 'N'
-        <if test="otherType != null and otherType.size > 0">
-            AND t1.lib_type in
-            <foreach item="type" collection="otherType" open="(" separator="," close=")">
-                #{type}
-            </foreach>
-        </if>
-        AND (t2.spell = UPPER(#{InputStr}) OR t2.name = (#{InputStr}))
-        GROUP BY t1.id) b1)
-        UNION
-        (SELECT b1.*,0 uniqueId,null uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t7.is_deleted = 'N'
-        <if test="otherType != null and otherType.size > 0">
-            AND t1.lib_type in
-            <foreach item="type" collection="otherType" open="(" separator="," close=")">
-                #{type}
-            </foreach>
-        </if>
-        AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT((#{InputStr}),'%'))
-        GROUP BY t1.id) b1)
-        UNION
-        (SELECT b1.*,0 uniqueId,null uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-                LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
-                WHERE
-                t1.is_deleted = 'N'
-                AND t2.is_deleted = 'N'
-                AND t3.is_deleted = 'N'
-                AND t6.is_deleted = 'N'
-                AND t7.is_deleted = 'N'
-                <if test="otherType != null and otherType.size > 0">
-                    AND t1.lib_type in
-                    <foreach item="type" collection="otherType" open="(" separator="," close=")">
-                        #{type}
-                    </foreach>
-                </if>
-                AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',(#{InputStr}),'%'))
-                GROUP BY t1.id) b1)
-
-        -- 化验本体标签公表项匹配静态知识
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t1.lib_type = #{type}
-        AND (t2.spell = UPPER(#{InputStr}) OR t2.name = (#{InputStr}))
-        GROUP BY t1.id) b1,
-        kl_concept b2,
-        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and b1.selfName = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t1.lib_type = #{type}
-        AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT((#{InputStr}),'%'))
-        GROUP BY t1.id) b1,
-        kl_concept b2,
-        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and b1.selfName = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-                WHERE
-                t1.is_deleted = 'N'
-                AND t2.is_deleted = 'N'
-                AND t3.is_deleted = 'N'
-                AND t6.is_deleted = 'N'
-                AND t1.lib_type = #{type}
-                AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',(#{InputStr}),'%'))
-                GROUP BY t1.id) b1,
-                        kl_concept b2,
-                        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and b1.selfName = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-
-        -- 化验子项推父项,父项公表项匹配静态知识
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT 0 selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
-        LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
-        LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
-        AND t5.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t1.lib_type = #{detailType}
-        AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
-        AND t4.relation_id = 18
-        GROUP BY t5.id) b1,
-        kl_concept b2,
-        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and b1.parentName = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT 0 selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
-        LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
-        LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
-        AND t5.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t1.lib_type = #{detailType}
-        AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT(#{InputStr},'%'))
-        AND t4.relation_id = 18
-        GROUP BY t5.id) b1,
-        kl_concept b2,
-        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and b1.parentName = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT 0 selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-                    LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-                    LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
-                    LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-                    LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
-                    LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
-                    WHERE
-                    t1.is_deleted = 'N'
-                    AND t2.is_deleted = 'N'
-                    AND t3.is_deleted = 'N'
-                    AND t4.is_deleted = 'N'
-                    AND t5.is_deleted = 'N'
-                    AND t6.is_deleted = 'N'
-                    AND t1.lib_type = #{detailType}
-                    AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
-                    AND t4.relation_id = 18
-                    GROUP BY t5.id) b1,
-                        kl_concept b2,
-                        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and b1.parentName = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-
-        -- 化验子项推父项,父项--子项组合公表项匹配静态知识
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
-        LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
-        AND t5.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t1.lib_type = #{detailType}
-        AND (t2.spell = UPPER(#{InputStr}) OR t2.name = #{InputStr})
-        AND t4.relation_id = 18
-        GROUP BY t5.id,t1.id) b1,
-        kl_concept b2,
-        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and CONCAT(b1.parentName,'--',b1.selfName) = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
-        LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
-        AND t5.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t1.lib_type = #{detailType}
-        AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT(#{InputStr},'%'))
-        AND t4.relation_id = 18
-        GROUP BY t5.id,t1.id) b1,
-        kl_concept b2,
-        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and CONCAT(b1.parentName,'--',b1.selfName) = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
-        UNION
-        (SELECT b1.*,b2.id uniqueId,b2.lib_name uniqueName
-        FROM (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-                    LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-                    LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
-                    LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-                    LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-                    LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-                    WHERE
-                    t1.is_deleted = 'N'
-                    AND t2.is_deleted = 'N'
-                    AND t3.is_deleted = 'N'
-                    AND t4.is_deleted = 'N'
-                    AND t5.is_deleted = 'N'
-                    AND t6.is_deleted = 'N'
-                    AND t1.lib_type = #{detailType}
-                    AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
-                    AND t4.relation_id = 18
-                    GROUP BY t5.id,t1.id) b1,
-                        kl_concept b2,
-                        kl_concept_detail b3
-        WHERE b2.is_deleted = 'N'
-        and b3.is_deleted = 'N'
-        and CONCAT(b1.parentName,'--',b1.selfName) = b2.lib_name
-        and b2.lib_type = 46
-        and b2.id = b3.concept_id)
+    <select id="staticKnowledge" resultType="com.diagbot.dto.RetrievalDTO">
+        SELECT
+            a1.*
+        FROM
+            (
+                -- 除化验外其他类型标签
+                (
+                    SELECT
+                        b1.*, 0 uniqueId,
+                        NULL uniqueName
+                    FROM
+                        (
+                            SELECT
+                                t1.id conceptId,
+                                t1.lib_name `name`,
+                                (
+                                    CASE t1.lib_type
+                                    WHEN 18 THEN
+                                        10
+                                    WHEN 10 THEN
+                                        20
+                                    ELSE
+                                        50
+                                    END
+                                ) + 1 AS orderNo,
+                                t2.`name` retrievalName,
+                                t2.is_concept showType,
+                                t1.lib_type libTypeId,
+                                t6.`name` libTypeName
+                            FROM
+                                kl_concept t1
+                            LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                            LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                            LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                            LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
+                            WHERE
+                                t1.is_deleted = 'N'
+                            AND t2.is_deleted = 'N'
+                            AND t3.is_deleted = 'N'
+                            AND t6.is_deleted = 'N'
+                            AND t7.is_deleted = 'N'
+                            AND t1.lib_type IN (18, 10, 16)
+                            AND (
+                                t2.spell = UPPER(#{InputStr})
+                                OR t2. NAME = (#{InputStr})
+                            )
+                        ) b1
+                )
+                UNION
+                    (
+                        SELECT
+                            b1.*, 0 uniqueId,
+                            NULL uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id conceptId,
+                                    t1.lib_name `name`,
+                                    (
+                                        CASE t1.lib_type
+                                        WHEN 18 THEN
+                                            10
+                                        WHEN 10 THEN
+                                            20
+                                        ELSE
+                                            50
+                                        END
+                                    ) + 2 AS orderNo,
+                                    t2.`name` retrievalName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t7.is_deleted = 'N'
+                                AND t1.lib_type IN (18, 10, 16)
+                                AND (
+                                    t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT((#{InputStr}), '%')
+                                )
+                            ) b1
+                    )
+                UNION
+                    (
+                        SELECT
+                            b1.*, 0 uniqueId,
+                            NULL uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id conceptId,
+                                    t1.lib_name `name`,
+                                    (
+                                        CASE t1.lib_type
+                                        WHEN 18 THEN
+                                            10
+                                        WHEN 10 THEN
+                                            20
+                                        ELSE
+                                            50
+                                        END
+                                    ) + 3 AS orderNo,
+                                    t2.`name` retrievalName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                LEFT JOIN kl_concept_detail t7 ON t7.concept_id = t1.id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t7.is_deleted = 'N'
+                                AND t1.lib_type IN (18, 10, 16)
+                                AND (
+                                    t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT('%',(#{InputStr}), '%')
+                                )
+                            ) b1
+                    ) -- 化验本体标签公表项匹配静态知识
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            b1.selfName `name`,
+                            31 AS orderNo,
+                            b1.retrievalName retrievalName,
+                            b1.showType showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id selfId,
+                                    t1.lib_name selfName,
+                                    t2.`name` retrievalName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 12
+                                AND (
+                                    t2.spell = UPPER(#{InputStr})
+                                    OR t2. NAME = (#{InputStr})
+                                )
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND b1.selfName = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    )
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            b1.selfName `name`,
+                            32 AS orderNo,
+                            b1.retrievalName retrievalName,
+                            b1.showType showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id selfId,
+                                    t1.lib_name selfName,
+                                    t2.`name` retrievalName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 12
+                                AND (
+                                    t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT((#{InputStr}), '%')
+                                )
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND b1.selfName = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    )
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            b1.selfName `name`,
+                            33 AS orderNo,
+                            b1.retrievalName retrievalName,
+                            b1.showType showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id selfId,
+                                    t1.lib_name selfName,
+                                    t2.`name` retrievalName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 13
+                                AND (
+                                    t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT('%',(#{InputStr}), '%')
+                                )
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND b1.selfName = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    ) -- 化验子项推父项,父项公表项匹配静态知识
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            b1.parentName `name`,
+                            34 AS orderNo,
+                            b1.selfName retrievalName,
+                            b1.showType + 10 showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    0 selfId,
+                                    t1.lib_name selfName,
+                                    t5.id parentId,
+                                    t5.lib_name parentName,
+                                    NULL sameName,
+                                    t2.is_concept showType,
+                                    t5.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
+                                LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
+                                LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t4.is_deleted = 'N'
+                                AND t5.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 13
+                                AND (
+                                    t2.spell = UPPER(#{InputStr})
+                                    OR t2. NAME = #{InputStr}
+                                )
+                                AND t4.relation_id = 18
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND b1.parentName = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    )
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            b1.parentName `name`,
+                            35 AS orderNo,
+                            b1.selfName retrievalName,
+                            b1.showType + 10 showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    0 selfId,
+                                    t1.lib_name selfName,
+                                    t5.id parentId,
+                                    t5.lib_name parentName,
+                                    NULL sameName,
+                                    t2.is_concept showType,
+                                    t5.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
+                                LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
+                                LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t4.is_deleted = 'N'
+                                AND t5.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 13
+                                AND (
+                                    t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT(#{InputStr}, '%')
+                                )
+                                AND t4.relation_id = 18
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND b1.parentName = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    )
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            b1.parentName `name`,
+                            36 AS orderNo,
+                            b1.selfName retrievalName,
+                            b1.showType + 10 showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    0 selfId,
+                                    t1.lib_name selfName,
+                                    t5.id parentId,
+                                    t5.lib_name parentName,
+                                    NULL sameName,
+                                    t2.is_concept showType,
+                                    t5.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
+                                LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
+                                LEFT JOIN kl_concept_common t3 ON t5.id = t3.concept_id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t4.is_deleted = 'N'
+                                AND t5.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 13
+                                AND (
+                                    t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT('%', #{InputStr}, '%')
+                                )
+                                AND t4.relation_id = 18
+                                GROUP BY
+                                    t5.id
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND b1.parentName = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    ) -- 化验子项推父项,父项--子项组合公表项匹配静态知识
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            CONCAT(
+                                b1.parentName,
+                                '(',
+                                b1.selfName,
+                                ')'
+                            ) `name`,
+                            41 AS orderNo,
+                            b1.selfName retrievalName,
+                            b1.showType + 20 showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id selfId,
+                                    t1.lib_name selfName,
+                                    t5.id parentId,
+                                    t5.lib_name parentName,
+                                    NULL sameName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
+                                LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t4.is_deleted = 'N'
+                                AND t5.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 13
+                                AND (
+                                    t2.spell = UPPER(#{InputStr})
+                                    OR t2. NAME = #{InputStr}
+                                )
+                                AND t4.relation_id = 18
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND CONCAT(
+                            b1.parentName,
+                            '--',
+                            b1.selfName
+                        ) = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    )
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            CONCAT(
+                                b1.parentName,
+                                '(',
+                                b1.selfName,
+                                ')'
+                            ) `name`,
+                            42 AS orderNo,
+                            b1.selfName retrievalName,
+                            b1.showType + 20 showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id selfId,
+                                    t1.lib_name selfName,
+                                    t5.id parentId,
+                                    t5.lib_name parentName,
+                                    NULL sameName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
+                                LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t4.is_deleted = 'N'
+                                AND t5.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 13
+                                AND (
+                                    t2.spell LIKE CONCAT(UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT(#{InputStr}, '%')
+                                )
+                                AND t4.relation_id = 18
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND CONCAT(
+                            b1.parentName,
+                            '--',
+                            b1.selfName
+                        ) = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    )
+                UNION
+                    (
+                        SELECT
+                            b2.id conceptId,
+                            CONCAT(
+                                b1.parentName,
+                                '(',
+                                b1.selfName,
+                                ')'
+                            ) `name`,
+                            43 AS orderNo,
+                            b1.selfName retrievalName,
+                            b1.showType + 20 showType,
+                            b1.libTypeId libTypeId,
+                            b1.libTypeName libTypeName,
+                            b2.id uniqueId,
+                            b2.lib_name uniqueName
+                        FROM
+                            (
+                                SELECT
+                                    t1.id selfId,
+                                    t1.lib_name selfName,
+                                    t5.id parentId,
+                                    t5.lib_name parentName,
+                                    NULL sameName,
+                                    t2.is_concept showType,
+                                    t1.lib_type libTypeId,
+                                    t6.`name` libTypeName
+                                FROM
+                                    kl_concept t1
+                                LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+                                LEFT JOIN kl_relation t4 ON t4.end_id = t1.id
+                                LEFT JOIN kl_concept t5 ON t5.id = t4.start_id
+                                LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
+                                LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+                                WHERE
+                                    t1.is_deleted = 'N'
+                                AND t2.is_deleted = 'N'
+                                AND t3.is_deleted = 'N'
+                                AND t4.is_deleted = 'N'
+                                AND t5.is_deleted = 'N'
+                                AND t6.is_deleted = 'N'
+                                AND t1.lib_type = 13
+                                AND (
+                                    t2.spell LIKE CONCAT('%', UPPER(#{InputStr}), '%')
+                                    OR t2. NAME LIKE CONCAT('%', #{InputStr}, '%')
+                                )
+                                AND t4.relation_id = 18
+                            ) b1,
+                            kl_concept b2,
+                            kl_concept_detail b3
+                        WHERE
+                            b2.is_deleted = 'N'
+                        AND b3.is_deleted = 'N'
+                        AND CONCAT(
+                            b1.parentName,
+                            '--',
+                            b1.selfName
+                        ) = b2.lib_name
+                        AND b2.lib_type = 46
+                        AND b2.id = b3.concept_id
+                    )
+            ) a1
+        GROUP BY
+            a1.conceptId
+        ORDER BY
+            a1.orderNo ASC,
+            a1.showType DESC
     </select>
 
     <select id="getConceptConMap" resultType="com.diagbot.dto.ConceptBaseDTO" parameterType="com.diagbot.vo.ConceptFindVO">

+ 0 - 19
icss-service/src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -3,7 +3,6 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.AiptServiceClient;
 import com.diagbot.dto.ConceptRetrievalDTO;
-import com.diagbot.dto.OrderRetrivevalDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.entity.QuestionInfo;
@@ -131,7 +130,6 @@ public class RetrievalFacade {
         //调用aipt-service获取有静态知识的标签
         RespDTO<List<RetrievalDTO>> retrievalDTOList = aiptServiceClient.getStaticKnowledge(getStaticKnowledgeVO);
         RespDTOUtil.respNGDeal(retrievalDTOList,"获取静态知识失败");
-        List<OrderRetrivevalDTO> orderRetrivevalDTOS  = new ArrayList<>();
         if(ListUtil.isNotEmpty(retrievalDTOList.data)){
             List<String> questionNames = new ArrayList<>();
             for (RetrievalDTO retrievalDTOInfo : retrievalDTOList.data) {
@@ -152,25 +150,8 @@ public class RetrievalFacade {
                 if(null != questionInfoMap.get(retrievalDTOInfo.getName())){//设置questionId
                     retrievalDTOInfo.setQuestionId(questionInfoMap.get(retrievalDTOInfo.getName()).getId());
                 }
-                OrderRetrivevalDTO orderRetrivevalDTO = new OrderRetrivevalDTO();
-                BeanUtil.copyProperties(retrievalDTOInfo, orderRetrivevalDTO);
-                //排序号设定
-                if(orderRetrivevalDTO.getType().intValue() == ConceptTypeEnum.Disease.getKey()){//诊断
-                    orderRetrivevalDTO.setOrderNo(1);
-                }else if(orderRetrivevalDTO.getType().intValue() == ConceptTypeEnum.Drug.getKey()){//药品
-                    orderRetrivevalDTO.setOrderNo(2);
-                }else if(orderRetrivevalDTO.getType().intValue() == ConceptTypeEnum.Lis.getKey() || orderRetrivevalDTO.getType().intValue() == ConceptTypeEnum.LisDetail.getKey()){//化验
-                    orderRetrivevalDTO.setOrderNo(3);
-                }else {//辅检
-                    orderRetrivevalDTO.setOrderNo(4);
-                }
-                orderRetrivevalDTOS.add(orderRetrivevalDTO);
             }
-
-            //给结果排序:诊断 > 药品 > 化验 > 辅检
-            orderRetrivevalDTOS.sort((OrderRetrivevalDTO o1, OrderRetrivevalDTO o2) -> o1.getOrderNo().compareTo(o2.getOrderNo()));
         }
-        retrievalDTOList.data = BeanUtil.listCopyTo(orderRetrivevalDTOS,RetrievalDTO.class);
         return retrievalDTOList.data;
     }
 }