Browse Source

医学术语命名维护列表搜索条件,医学标准术语和同义词去空格、去大小写。

rengb 5 years ago
parent
commit
4186a71a9b

+ 13 - 7
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -312,7 +312,10 @@ public class ConceptFacade extends ConceptServiceImpl {
         if (StringUtil.isNotBlank(getAllInformationVO.getLibName())) {
             QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
             libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-            libraryInfoQe.like("name", getAllInformationVO.getLibName());
+            libraryInfoQe.apply(
+                    "LOWER(`name`) LIKE CONCAT('%',trim('"
+                            + getAllInformationVO.getLibName().toLowerCase()
+                            + "'),'%')");
             libraryInfoQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),
                     "type_id", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
             List<Long> conceptIdList = libraryinfoFacade.list(libraryInfoQe)
@@ -323,8 +326,10 @@ public class ConceptFacade extends ConceptServiceImpl {
                 conceptQe.eq("id", -999999999);
             }
         }
-        conceptQe.like(StringUtil.isNotBlank(getAllInformationVO.getName()),
-                "lib_name", getAllInformationVO.getName());
+        conceptQe.apply(StringUtil.isNotBlank(getAllInformationVO.getName()),
+                "LOWER(lib_name) LIKE CONCAT('%',trim('"
+                        + getAllInformationVO.getName().toLowerCase()
+                        + "'),'%')");
         conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),
                 "lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
         conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()),
@@ -382,7 +387,7 @@ public class ConceptFacade extends ConceptServiceImpl {
     public Boolean removeConceptInfo(RemoveConceptInfoVO removeConceptInfoVO) {
 
         //清理缓存
-        if(removeConceptInfoVO.getConceptId()!=null) {
+        if (removeConceptInfoVO.getConceptId() != null) {
             this.cacheClearByConceptId(removeConceptInfoVO.getConceptId());
         }
 
@@ -520,7 +525,7 @@ public class ConceptFacade extends ConceptServiceImpl {
      */
     public Boolean addConceptInfo(AddConceptInfoVO addConceptInfoVO) {
         //清理原名称对应标签缓存
-        if(addConceptInfoVO.getConceptId()!=null) {
+        if (addConceptInfoVO.getConceptId() != null) {
             this.cacheClearByConceptId(addConceptInfoVO.getConceptId());
         }
 
@@ -1119,7 +1124,7 @@ public class ConceptFacade extends ConceptServiceImpl {
         //删除标签缓存
         List<Long> saveConceptIds = saveOrUpdateConceptList.stream()
                 .map(i -> i.getId()).filter(j -> j != null).distinct().collect(Collectors.toList());
-        if(ListUtil.isNotEmpty(saveConceptIds)) {
+        if (ListUtil.isNotEmpty(saveConceptIds)) {
             this.cacheClearByConceptIds(saveConceptIds);
         }
         conceptService.saveOrUpdateBatch(saveOrUpdateConceptList);
@@ -1224,9 +1229,10 @@ public class ConceptFacade extends ConceptServiceImpl {
 
     /**
      * 知识库标准化-获取医学数据统计
+     *
      * @return
      */
-    public List<BIItemDTO> queryLibTypeCou(){
+    public List<BIItemDTO> queryLibTypeCou() {
         return this.baseMapper.queryLibTypeCou();
     }