瀏覽代碼

关系维护筛选修改

rgb 6 年之前
父節點
當前提交
a23a5fb4e4

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

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description
+ * @author rgb
+ * @time 2018年12月5日下午5:00:34
+ */
+@Getter
+@Setter
+public class GetAllForRelationDTO {
+	
+	/**
+	 * 概念id
+	 */
+	@ApiModelProperty(value="概念id")
+	private Long conceptId;
+	
+	/**
+	 * 概念名称
+	 */
+	@ApiModelProperty(value="概念名称")
+	private String conceptName;
+	
+	
+
+}

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

@@ -28,6 +28,7 @@ import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.GetAllConceptDTO;
+import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.GetAllInformationDTO;
 import com.diagbot.dto.GetAllLisConceptDTO;
 import com.diagbot.dto.GetConceptInfoDTO;
@@ -62,6 +63,7 @@ import com.diagbot.vo.ConceptExistVO;
 import com.diagbot.vo.ConceptSearchVO;
 import com.diagbot.vo.ConceptTypeVO;
 import com.diagbot.vo.GetAllConceptVO;
+import com.diagbot.vo.GetAllForRelationVO;
 import com.diagbot.vo.GetAllInformationVO;
 import com.diagbot.vo.GetAllLisConceptVO;
 import com.diagbot.vo.GetConceptInfoDetailVO;
@@ -157,6 +159,16 @@ public class ConceptFacade extends ConceptServiceImpl {
 
         return getAllConceptDTOList;
     }
+    
+    /**
+     * 获取所有概念(术语关系维护时筛选使用)
+     *
+     * @param getAllForRelationVO
+     * @return
+     */
+    public List<GetAllForRelationDTO> getAllForRelation(GetAllForRelationVO getAllForRelationVO) {
+    	return this.baseMapper.getAllForRelation(getAllForRelationVO);
+    }
 
     /**
      * 获取医学术语命名列表

+ 11 - 2
knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptMapper.java

@@ -1,17 +1,19 @@
 package com.diagbot.mapper;
 
+import java.util.List;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.ConceptWithOrderRes;
+import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.GetAllLisConceptDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.wrapper.ConceptWrapper;
+import com.diagbot.vo.GetAllForRelationVO;
 import com.diagbot.vo.GetAllLisConceptVO;
 import com.diagbot.vo.IndexVO;
 
-import java.util.List;
-
 /**
  * <p>
  * Mapper 接口
@@ -55,4 +57,11 @@ public interface ConceptMapper extends BaseMapper<Concept> {
      * @return 检索结果
      */
     List<ConceptBaseDTO> index(IndexVO indexVO);
+    
+    /**
+     * 获取所有概念(术语关系维护时筛选使用)
+     * @param getAllForRelationVO
+     * @return
+     */
+    List<GetAllForRelationDTO> getAllForRelation(GetAllForRelationVO getAllForRelationVO);
 }

+ 53 - 0
knowledgeman-service/src/main/java/com/diagbot/vo/GetAllForRelationVO.java

@@ -0,0 +1,53 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotNull;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: Weixuan Huang
+ * @time: 2019/3/14 16:03
+ */
+@Getter
+@Setter
+public class GetAllForRelationVO {
+    
+    /**
+     * 名称
+     */
+    @ApiModelProperty(value="名称")
+    private String name;
+    
+    /**
+     * 词性id
+     */
+    @ApiModelProperty(value="词性id")
+    private Long typeId;
+    
+    /**
+     * 相关联的概念id
+     */
+    @ApiModelProperty(value="相关联的概念id")
+    @NotNull(message="相关联的概念id必传")
+    private Long conceptId;
+    
+    /**
+     * 关系类型id
+     */
+    @ApiModelProperty(value="关系类型id")
+    @NotNull(message="关系类型id必传")
+    private Long relationId;
+    
+    
+    /**
+     * 是否起始术语,1-是,0-否
+     */
+    @ApiModelProperty(value="是否起始术语,1-是,0-否")
+    @NotNull(message="是否起始术语必传")
+    private Integer isStart;
+
+    
+}

+ 9 - 0
knowledgeman-service/src/main/java/com/diagbot/web/ConceptController.java

@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.GetAllConceptDTO;
+import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.GetAllInformationDTO;
 import com.diagbot.dto.GetAllLisConceptDTO;
 import com.diagbot.dto.GetConceptInfoDTO;
@@ -28,6 +29,7 @@ import com.diagbot.vo.AddConceptInfoVO;
 import com.diagbot.vo.ConceptSearchVO;
 import com.diagbot.vo.ConceptTypeVO;
 import com.diagbot.vo.GetAllConceptVO;
+import com.diagbot.vo.GetAllForRelationVO;
 import com.diagbot.vo.GetAllInformationVO;
 import com.diagbot.vo.GetAllLisConceptVO;
 import com.diagbot.vo.GetConceptInfoDetailVO;
@@ -66,6 +68,13 @@ public class ConceptController {
     public RespDTO<List<GetAllConceptDTO>> getAllConcept(@RequestBody GetAllConceptVO getAllConceptVO) {
         return RespDTO.onSuc(conceptFacade.getAllConcept(getAllConceptVO));
     }
+    
+    @ApiOperation(value = "获取所有概念(术语关系维护时筛选使用)[by:rengb]")
+    @PostMapping("/getAllForRelation")
+    @SysLogger("getAllForRelation")
+    public RespDTO<List<GetAllForRelationDTO>> getAllForRelation(@RequestBody GetAllForRelationVO getAllForRelationVO) {
+        return RespDTO.onSuc(conceptFacade.getAllForRelation(getAllForRelationVO));
+    }
 
     @ApiOperation(value = "获取医学术语命名列表[by:rengb]")
     @PostMapping("/getAllInformation")

+ 30 - 1
knowledgeman-service/src/main/resources/mapper/ConceptMapper.xml

@@ -59,7 +59,34 @@
 			)
 		</if>
     </select>
-
+    
+    <select id="getAllForRelation" parameterType="com.diagbot.vo.GetAllForRelationVO" resultType="com.diagbot.dto.GetAllForRelationDTO">
+    	SELECT
+		t1.*
+		FROM
+		(SELECT
+		id AS conceptId,
+		lib_name AS conceptName
+		FROM kl_concept
+		WHERE is_deleted='N' 
+		<if test="name!=null and name!=''">
+			AND lib_name LIKE CONCAT('%',#{name},'%')
+		</if>
+		<if test="typeId!=null">
+			AND lib_type=typeId
+		</if>
+		) t1 
+		LEFT JOIN kl_relation t2
+		<if test="isStart==1">
+			ON t1.conceptId=t2.start_id
+		</if>
+		<if test="isStart==0">
+			ON t1.conceptId=t2.end_id
+		</if>
+		WHERE 1=1 
+		AND t2.relation_id=#{relationId}
+		AND t2.id IS NULL
+    </select>
 
 	<select id="getConcept" resultType="com.diagbot.dto.ConceptRes" parameterType="com.diagbot.entity.wrapper.ConceptWrapper">
 		SELECT
@@ -243,4 +270,6 @@
         and (a.name like concat('%',#{name},'%')
               or a.spell like concat('%',#{name},'%'))
     </select>
+    
+    
 </mapper>