فهرست منبع

术语搜索条件去空格、去大小写。

rengb 5 سال پیش
والد
کامیت
08752f832e
1فایلهای تغییر یافته به همراه12 افزوده شده و 6 حذف شده
  1. 12 6
      knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

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

@@ -233,8 +233,12 @@ public class ConceptFacade extends ConceptServiceImpl {
                 || getAllForRelationVO.getTypeId() != null) {
             QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
             conceptQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-            conceptQe.like(StringUtil.isNotBlank(getAllForRelationVO.getName()),
-                    "lib_name", getAllForRelationVO.getName());
+            if (StringUtil.isNotBlank(getAllForRelationVO.getName())) {
+                conceptQe.apply(
+                        "UPPER(lib_name) LIKE CONCAT('%',trim('"
+                                + getAllForRelationVO.getName().toUpperCase()
+                                + "'),'%')");
+            }
             conceptQe.eq(getAllForRelationVO.getTypeId() != null,
                     "lib_type", getAllForRelationVO.getTypeId());
             List<Concept> conceptList = list(conceptQe);
@@ -358,10 +362,12 @@ public class ConceptFacade extends ConceptServiceImpl {
                 conceptQe.eq("id", -999999999);
             }
         }
-        conceptQe.apply(StringUtil.isNotBlank(getAllInformationVO.getName()),
-                "UPPER(lib_name) LIKE CONCAT('%',trim('"
-                        + getAllInformationVO.getName().toUpperCase()
-                        + "'),'%')");
+        if (StringUtil.isNotBlank(getAllInformationVO.getName())) {
+            conceptQe.apply(
+                    "UPPER(lib_name) LIKE CONCAT('%',trim('"
+                            + getAllInformationVO.getName().toUpperCase()
+                            + "'),'%')");
+        }
         conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),
                 "lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
         conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()),