Browse Source

静态知识维护修改

rgb 6 years ago
parent
commit
18e4020e46

+ 15 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/ConceptIndexDTO.java

@@ -16,6 +16,21 @@ public class ConceptIndexDTO {
      * 名称
      */
     private String name;
+    
+    /**
+     * 名称(类型)
+     */
+    private String nameType;
+    
+    /**
+     * 类型id
+     */
+    private Long typeId;
+    
+    /**
+     * 类型
+     */
+    private String type;
 
     /**
      * 量表概念id

+ 6 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/GetAllForRelationDTO.java

@@ -25,6 +25,12 @@ public class GetAllForRelationDTO {
 	@ApiModelProperty(value="概念名称")
 	private String conceptName;
 	
+	/**
+	 * 概念名称(类型)
+	 */
+	@ApiModelProperty(value="概念名称(类型)")
+	private String conceptNameType;
+	
 	
 
 }

+ 7 - 1
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -10,6 +10,7 @@ import com.diagbot.dto.ConceptIndexDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.ConceptDetail;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.ConceptDetailService;
@@ -151,7 +152,12 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
      * @return
      */
     public List<ConceptIndexDTO> indexFac(ConceptIndexVO conceptIndexVO) {
-        return this.index(conceptIndexVO);
+    	List<ConceptIndexDTO> retList = this.index(conceptIndexVO);
+    	retList.forEach(i->{
+    		i.setType(LexiconTypeEnum.getName(i.getTypeId().intValue()));
+    		i.setNameType(i.getName()+"("+LexiconTypeEnum.getName(i.getTypeId().intValue())+")");
+    	});
+        return retList;
     }
 
 }

+ 1 - 0
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -218,6 +218,7 @@ public class ConceptFacade extends ConceptServiceImpl {
             GetAllForRelationDTO getAllForRelationDTO = new GetAllForRelationDTO();
             getAllForRelationDTO.setConceptId(i.getId());
             getAllForRelationDTO.setConceptName(i.getLibName());
+            getAllForRelationDTO.setConceptNameType(i.getLibName()+"("+LexiconTypeEnum.getName(i.getLibType().intValue())+")");
             retList.add(getAllForRelationDTO);
         }
 

+ 1 - 1
knowledgeman-service/src/main/java/com/diagbot/vo/ConceptIndexVO.java

@@ -14,7 +14,7 @@ import javax.validation.constraints.NotBlank;
 @Getter
 @Setter
 public class ConceptIndexVO {
-    @ApiModelProperty(value = "检索名称")
+    @ApiModelProperty(value = "检索名称",required=true)
     @NotBlank(message="名称不能为空")
     private String name;
 

+ 11 - 6
knowledgeman-service/src/main/resources/mapper/ConceptDetailMapper.xml

@@ -43,12 +43,17 @@
 
 
     <select id="index" resultType="com.diagbot.dto.ConceptIndexDTO">
-        SELECT a.lib_name name, a.id concept_id FROM `kl_concept` a
-        where a.is_deleted = 'N'
-        <if test="name != null and name != ''">
-            and a.lib_name like concat('%',#{name} ,'%' )
+        SELECT
+			DISTINCT 
+			a.id AS conceptId,
+			a.lib_name AS name,
+			a.lib_type AS typeId
+		FROM kl_concept a LEFT JOIN kl_concept_detail b
+		ON a.id=b.concept_id
+		WHERE b.id IS NULL 
+		<if test="name != null and name != ''">
+            AND a.lib_name like concat('%',#{name} ,'%' )
         </if>
-        and not EXISTS(select 1 from kl_concept_detail where a.id = concept_id)
-        order by a.gmt_modified desc
+		ORDER BY a.gmt_modified DESC
     </select>
 </mapper>