wangyu 6 лет назад
Родитель
Сommit
e1af285bb3

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

@@ -309,9 +309,11 @@ public class ConceptFacade extends ConceptServiceImpl {
             if(bean.getShowType().intValue() == 1) {
                 res.add(bean);
             } else if (bean.getShowType().intValue() == 2) {
-                if(!selfList.contains(bean.getParentId()) && !conceptNameList.contains(bean.getParentName())) {
+                if(!selfList.contains(bean.getParentId()) && !conceptNameList.contains(bean.getParentName()) && retrievalVO.getIsSonShow().intValue() == 0) {
                     conceptNameList.add(bean.getParentName());
                     res.add(bean);
+                }else {
+                    res.add(bean);
                 }
             } else if (bean.getShowType().intValue() == 0) {
                 if(!selfList.contains(bean.getSelfId()) && !subList.contains(bean.getSelfId()) && !conceptNameList.contains(bean.getSelfName())) {
@@ -371,8 +373,14 @@ public class ConceptFacade extends ConceptServiceImpl {
                     retrievalDTO.setConceptId(conceptRetrievalDTO.getParentId());
                     retrievalDTO.setName(conceptRetrievalDTO.getParentName());
                     retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSelfName());
-                    retrievalDTO.setUniqueName(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
-                    uniqueNameList.add(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
+                    if(StringUtil.isNotEmpty(conceptRetrievalDTO.getSelfName())){//如果selfName不为空是:大项(小项)组合
+                        retrievalDTO.setUniqueName(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
+                        uniqueNameList.add(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
+                    }else {//如果selfName为空是:子项推出大项
+                        retrievalDTO.setUniqueName(conceptRetrievalDTO.getParentName());
+                        uniqueNameList.add(conceptRetrievalDTO.getParentName());
+                    }
+
                 }
                 if (StringUtil.isNotEmpty(conceptRetrievalDTO.getSameName())) {//同义词
                     retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSameName());
@@ -385,7 +393,7 @@ public class ConceptFacade extends ConceptServiceImpl {
             }
         }
         List<Concept> conceptDetilList = new ArrayList<>();//化验公表项
-        if(ListUtil.isNotEmpty(uniqueNameList)){
+        if(ListUtil.isNotEmpty(uniqueNameList)){//如果有化验公表项,获取化验公表项id
             QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
             conceptQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
                     .eq("lib_type",LexiconTypeEnum.LIS_TABLES.getKey())
@@ -410,7 +418,7 @@ public class ConceptFacade extends ConceptServiceImpl {
             for (RetrievalDTO retrievalDTOInfo : retrievalDTOS) {
                 if(StringUtil.isNotEmpty(retrievalDTOInfo.getUniqueName())){
                     for (Long concept : existConceptIdList) {
-                        if (null != retrievalDTOInfo.getUniqueId() && retrievalDTOInfo.getUniqueId().intValue() == concept.intValue()){
+                        if (null != retrievalDTOInfo.getUniqueId() && retrievalDTOInfo.getUniqueId().intValue() == concept.intValue()){//如果是化验时返回化验公表项
                             retrievalDTO = new RetrievalDTO();
                             BeanUtil.copyProperties(retrievalDTOInfo,retrievalDTO);
                             staticRetrievalList.add(retrievalDTO);

+ 164 - 3
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -333,7 +333,168 @@
         </if>)
         <if test="detilType != null and detilType != ''">
             UNION
-            (SELECT t1.id 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
+            (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType
+            <if test="isStatic != null and isStatic == 1">
+                ,t1.lib_type libTypeId
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                ,t5.lib_type libTypeId
+            </if> ,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
+            <if test="isStatic != null and isStatic == 1">
+                t6.id = t1.lib_type
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                t6.id = t5.lib_type
+            </if>
+            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'
+            <if test="detilType != null">
+                AND t1.lib_type = #{detilType}
+            </if>
+            <if test="sexType == 3">
+                and t3.sex_type in ('1','2','3')
+            </if>
+            <if test="sexType != 3">
+                and t3.sex_type in ('3',#{sexType})
+            </if>
+            <if test="age != null and age != ''">
+                AND <![CDATA[ t3.min_age <= #{age} ]]>
+                AND <![CDATA[ t3.max_age >= #{age} ]]>
+            </if>
+            AND (t2.spell =  UPPER(#{InputStr}) OR t2.name =  #{InputStr})
+            <if test="inputIds != null and inputIds.size > 0">
+                and t1.id not in
+                <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            AND t4.relation_id = 18
+            <if test="isStatic != null and isStatic == 1">
+                GROUP BY t5.id
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                LIMIT 100
+            </if>)
+            UNION
+            (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType
+            <if test="isStatic != null and isStatic == 1">
+                ,t1.lib_type libTypeId
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                ,t5.lib_type libTypeId
+            </if> ,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
+            <if test="isStatic != null and isStatic == 1">
+                t6.id = t1.lib_type
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                t6.id = t5.lib_type
+            </if>
+            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'
+            <if test="detilType != null">
+                AND t1.lib_type = #{detilType}
+            </if>
+            <if test="sexType == 3">
+                and t3.sex_type in ('1','2','3')
+            </if>
+            <if test="sexType != 3">
+                and t3.sex_type in ('3',#{sexType})
+            </if>
+            <if test="age != null and age != ''">
+                AND <![CDATA[ t3.min_age <= #{age} ]]>
+                AND <![CDATA[ t3.max_age >= #{age} ]]>
+            </if>
+            AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
+            <if test="inputIds != null and inputIds.size > 0">
+                and t1.id not in
+                <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            AND t4.relation_id = 18
+            <if test="isStatic != null and isStatic == 1">
+                GROUP BY t5.id
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                LIMIT 100
+            </if>)
+            UNION
+            (SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType
+            <if test="isStatic != null and isStatic == 1">
+                ,t1.lib_type libTypeId
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                ,t5.lib_type libTypeId
+            </if> ,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
+            <if test="isStatic != null and isStatic == 1">
+                t6.id = t1.lib_type
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                t6.id = t5.lib_type
+            </if>
+            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'
+            <if test="detilType != null">
+                AND t1.lib_type = #{detilType}
+            </if>
+            <if test="sexType == 3">
+                and t3.sex_type in ('1','2','3')
+            </if>
+            <if test="sexType != 3">
+                and t3.sex_type in ('3',#{sexType})
+            </if>
+            <if test="age != null and age != ''">
+                AND <![CDATA[ t3.min_age <= #{age} ]]>
+                AND <![CDATA[ t3.max_age >= #{age} ]]>
+            </if>
+            AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
+            <if test="inputIds != null and inputIds.size > 0">
+                and t1.id not in
+                <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            AND t4.relation_id = 18
+            <if test="isStatic != null and isStatic == 1">
+                GROUP BY t5.id
+            </if>
+            <if test="isStatic == null or isStatic != 1">
+                LIMIT 100
+            </if>)
+        </if>
+        <if test="isStatic != null and isStatic == 1">
+            UNION
+            (SELECT 0 selfId,null 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
@@ -374,7 +535,7 @@
                 LIMIT 100
             </if>)
             UNION
-            (SELECT t1.id 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
+            (SELECT 0 selfId,null 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
@@ -415,7 +576,7 @@
                 LIMIT 100
             </if>)
             UNION
-            (SELECT t1.id 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
+            (SELECT 0 selfId,null 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