Ver código fonte

公表项搜索条件去空格、去大小写。

rengb 5 anos atrás
pai
commit
a71541734b

+ 8 - 2
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -136,8 +136,14 @@ public class ConceptFacade extends ConceptServiceImpl {
         QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
         conceptQe.eq("is_deleted", IsDeleteEnum.N.getKey());
         conceptQe.eq("lib_type", LexiconTypeEnum.LIS_TABLES.getKey());
-        conceptQe.like(StringUtil.isNotEmpty(getAllLisConceptVO.getConceptName()),
-                "lib_name", getAllLisConceptVO.getConceptName());
+        if (StringUtil.isNotBlank(getAllLisConceptVO.getConceptName())) {
+            conceptQe.apply(
+                    "UPPER(lib_name) LIKE CONCAT('%',trim('"
+                            + getAllLisConceptVO.getConceptName().toUpperCase()
+                            + "'),'%')");
+        }
+
+
         List<Concept> conceptList = list(conceptQe);
 
         conceptList.forEach(i -> {

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

@@ -55,7 +55,7 @@
 		ON a.id=b.concept_id
 		WHERE a.is_deleted='N' and  b.id IS NULL
 		<if test="name != null and name != ''">
-            AND a.lib_name like concat('%',#{name} ,'%' )
+            AND UPPER(a.lib_name) like concat('%',UPPER(TRIM(#{name})) ,'%' )
         </if>
         AND a.lib_type not in(12,13,14)
 		ORDER BY a.gmt_modified DESC