Browse Source

Merge remote-tracking branch 'origin/dev/KLBstand' into dev/KLBstand

gaodm 6 years ago
parent
commit
2ceb1a58db

+ 1 - 1
aipt-service/src/main/java/com/diagbot/dto/DisDTO.java

@@ -16,5 +16,5 @@ public class DisDTO {
     private Long conceptId;// 概念id
     private Long conceptId;// 概念id
     private String name;//内容
     private String name;//内容
     @JsonIgnore
     @JsonIgnore
-    private Integer type;//类型,19:慢病,20:急诊
+    private String typeName;//类型:慢病,急诊
 }
 }

+ 10 - 26
aipt-service/src/main/java/com/diagbot/enums/DisTypeEnum.java

@@ -1,6 +1,5 @@
 package com.diagbot.enums;
 package com.diagbot.enums;
 
 
-import com.diagbot.core.KeyedNamed;
 import lombok.Setter;
 import lombok.Setter;
 
 
 /**
 /**
@@ -9,43 +8,28 @@ import lombok.Setter;
  * @Description: 诊断类型
  * @Description: 诊断类型
  * @date 2018年11月21日 下午2:31:42
  * @date 2018年11月21日 下午2:31:42
  */
  */
-public enum DisTypeEnum implements KeyedNamed {
-    CHRONIC(19, "慢病"),
-    EMERGENCY(20, "急诊");
+public enum DisTypeEnum  {
+    CHRONIC("慢病"),
+    EMERGENCY("急诊");
 
 
     @Setter
     @Setter
-    private Integer key;
+    private String typeName;
 
 
-    @Setter
-    private String name;
-
-    DisTypeEnum(Integer key, String name) {
-        this.key = key;
-        this.name = name;
+    DisTypeEnum(String typeName) {
+        this.typeName = typeName;
     }
     }
 
 
-    public static DisTypeEnum getEnum(Integer key) {
+    public static DisTypeEnum getEnum(String typeName) {
         for (DisTypeEnum item : DisTypeEnum.values()) {
         for (DisTypeEnum item : DisTypeEnum.values()) {
-            if (item.key == key) {
+            if (item.typeName.equals(typeName)) {
                 return item;
                 return item;
             }
             }
         }
         }
         return null;
         return null;
     }
     }
 
 
-    public static String getName(Integer key) {
-        DisTypeEnum item = getEnum(key);
-        return item != null ? item.name : null;
-    }
-
-    @Override
-    public int getKey() {
-        return key;
-    }
-
-    @Override
-    public String getName() {
-        return name;
+    public String getTypeName() {
+        return this.typeName;
     }
     }
 }
 }
 
 

+ 3 - 3
aipt-service/src/main/java/com/diagbot/facade/DisTypeFacade.java

@@ -28,13 +28,13 @@ public class DisTypeFacade extends DisTypeServiceImpl {
     public DisTypeDTO getDisTypeFac() {
     public DisTypeDTO getDisTypeFac() {
         DisTypeDTO res = new DisTypeDTO();
         DisTypeDTO res = new DisTypeDTO();
         List<DisDTO> data = this.getDisType();
         List<DisDTO> data = this.getDisType();
-        Map<String, List<DisDTO>> map = EntityUtil.makeEntityListMap(data, "type");
+        Map<String, List<DisDTO>> map = EntityUtil.makeEntityListMap(data, "typeName");
         if (map != null) {
         if (map != null) {
-            List<DisDTO> chr = map.get(DisTypeEnum.CHRONIC.getKey()); //放入慢病列表
+            List<DisDTO> chr = map.get(DisTypeEnum.CHRONIC.getTypeName()); //放入慢病列表
             if (ListUtil.isNotEmpty(chr)) {
             if (ListUtil.isNotEmpty(chr)) {
                 res.setChronic(chr);
                 res.setChronic(chr);
             }
             }
-            List<DisDTO> eme = map.get(DisTypeEnum.EMERGENCY.getKey()); //放入急诊列表
+            List<DisDTO> eme = map.get(DisTypeEnum.EMERGENCY.getTypeName()); //放入急诊列表
             if (ListUtil.isNotEmpty(eme)) {
             if (ListUtil.isNotEmpty(eme)) {
                 res.setEmergency(eme);
                 res.setEmergency(eme);
             }
             }

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

@@ -3,8 +3,8 @@
 <mapper namespace="com.diagbot.mapper.DisTypeMapper">
 <mapper namespace="com.diagbot.mapper.DisTypeMapper">
 
 
     <select id="getDisType" resultType="com.diagbot.dto.DisDTO">
     <select id="getDisType" resultType="com.diagbot.dto.DisDTO">
-        SELECT a.lib_name name, a.id concept_id, b.relation_id type FROM `kl_concept` a, kl_relation b
-        where a.is_deleted = 'N' and b.is_deleted = 'N'
-        and b.relation_id in (19,20) and b.end_id = a.id and a.lib_type = 18
+        SELECT a.lib_name name, a.id concept_id, c.lib_name type_name FROM `kl_concept` a, kl_relation b, kl_concept c
+        where a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N'
+        and b.start_id = a.id and b.end_id = c.id and c.lib_type = 51
     </select>
     </select>
 </mapper>
 </mapper>