Sfoglia il codice sorgente

术语查询,添加新增,修改标志

kongwz 3 anni fa
parent
commit
7388c5403e

+ 6 - 1
src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -387,10 +387,15 @@ public class KlConceptFacade extends KlConceptServiceImpl {
         List<GetAllForRelationDTO> getAllForRelationDTOS = Lists.newArrayList();
         String name = searchConceptVO.getName();
         Integer libType = searchConceptVO.getLibType();
+        Integer sign = searchConceptVO.getSign();
         List<Long> excludedConceptIds = searchConceptVO.getExcludedConceptIds();
         if (StringUtils.isNotBlank(name) && libType != null) {
             if(libType >= 308 && libType <= 328){
-                getAllForRelationDTOS = this.searchByTypeAndName(searchConceptVO);
+                if(sign == 1){
+                    getAllForRelationDTOS = this.searchByTypeAndNameAdd(searchConceptVO);
+                }else if(sign == 2){
+                    getAllForRelationDTOS = this.searchByTypeAndName(searchConceptVO);
+                }
             }else {
                 List<KlConcept> conceptList = this.list(new QueryWrapper<KlConcept>()
                         .eq("is_deleted", IsDeleteEnum.N.getKey())

+ 1 - 0
src/main/java/com/diagbot/mapper/KlConceptMapper.java

@@ -31,4 +31,5 @@ public interface KlConceptMapper extends BaseMapper<KlConcept> {
 
     List<GetAllForRelationDTO> searchByTypeAndName(SearchConceptVO searchConceptVO);
 
+    List<GetAllForRelationDTO> searchByTypeAndNameAdd(SearchConceptVO searchConceptVO);
 }

+ 4 - 0
src/main/java/com/diagbot/service/KlConceptService.java

@@ -29,6 +29,10 @@ public interface KlConceptService extends IService<KlConcept> {
 
     List<KllisDetailDTO> getLisDetaisByNames(KllisDetailVO kllisDetailVO);
 
+    //查找(修改)
     List<GetAllForRelationDTO> searchByTypeAndName(SearchConceptVO searchConceptVO);
 
+    //查找(新增)
+    List<GetAllForRelationDTO> searchByTypeAndNameAdd(SearchConceptVO searchConceptVO);
+
 }

+ 5 - 0
src/main/java/com/diagbot/service/impl/KlConceptServiceImpl.java

@@ -49,4 +49,9 @@ public class KlConceptServiceImpl extends ServiceImpl<KlConceptMapper, KlConcept
         return baseMapper.searchByTypeAndName(searchConceptVO);
     }
 
+    @Override
+    public List<GetAllForRelationDTO> searchByTypeAndNameAdd(SearchConceptVO searchConceptVO) {
+        return baseMapper.searchByTypeAndNameAdd(searchConceptVO);
+    }
+
 }

+ 6 - 0
src/main/java/com/diagbot/vo/SearchConceptVO.java

@@ -30,4 +30,10 @@ public class SearchConceptVO {
      */
     @ApiModelProperty(value="需要排除的概念id集合")
     private List<Long> excludedConceptIds;
+
+    /**
+     * 标志(新增 -1 修改 2)
+     */
+    @ApiModelProperty(value="新增修改标志")
+    private Integer sign;
 }

+ 2 - 1
src/main/java/com/diagbot/web/KlDiseaseController.java

@@ -37,7 +37,8 @@ public class KlDiseaseController {
     @ApiOperation(value = "查询诊断依据相关的类型术语[by:kongwz]",
             notes = "name: 查询术语的名称<br>" +
                     "libType: 查询术语的词性<br>" +
-                    "excludedConceptIds: 需要排除的概念id集合")
+                    "excludedConceptIds: 需要排除的概念id集合"+
+                    "sign: 新增 -1 修改 2")
     @PostMapping("/searchConcept")
     @SysLogger("searchConcept")
     public RespDTO<List<GetAllForRelationDTO>> searchConcept(@Valid @RequestBody SearchConceptVO searchConceptVO) {

+ 40 - 0
src/main/resources/mapper/KlConceptMapper.xml

@@ -754,4 +754,44 @@
         </if>
     </select>
 
+    <select id="searchByTypeAndNameAdd" parameterType="com.diagbot.vo.SearchConceptVO"
+            resultType="com.diagbot.dto.GetAllForRelationDTO">
+        SELECT
+	kc.id AS conceptId,
+	kc.lib_name AS conceptName,
+	kc.lib_type AS libType,
+	kc.lib_name AS conceptNameType,
+	kli.remark
+FROM
+	`kl_concept` kc,
+kl_library_info kli
+WHERE
+        <if test="libType!=null">
+            kc.lib_type = #{libType}
+        </if>
+AND kc.`status` = 1
+AND kc.is_deleted = 'N'
+        <if test="name != null and name != ''">
+            AND UPPER(kc.lib_name) LIKE CONCAT('%', UPPER(trim(#{name})), '%')
+        </if>
+        <if test="excludedConceptIds != null and excludedConceptIds.size > 0">
+            AND kc.id not in
+            <foreach item="id" collection="excludedConceptIds" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+AND kc.id NOT IN (
+	SELECT DISTINCT
+		start_id
+	FROM
+		kl_relation
+	WHERE
+		is_deleted = 'N'
+	AND relation_id = 600
+)
+AND kc.id = kli.concept_id
+AND kli.is_deleted = 'N'
+
+    </select>
+
 </mapper>