浏览代码

模板、量表检索不区分大小写并去空格

zhoutg 5 年之前
父节点
当前提交
15a5201155

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

@@ -1110,7 +1110,7 @@
         SELECT DISTINCT b.id concept_id,b.lib_name name  FROM `kl_library_info` a, kl_concept b
         where a.is_deleted = 'N' and b.is_deleted = 'N'
         and a.concept_id = b.id
-        and a.`name` like concat('%',#{name},'%') and a.type_id = #{libType} and b.lib_type = #{libType}
+        and UPPER(TRIM(a.`name`)) like concat('%',UPPER(TRIM(#{name})),'%') and a.type_id = #{libType} and b.lib_type = #{libType}
     </select>
 
 </mapper>

+ 6 - 6
aipt-service/src/main/resources/mapper/DisScaleMapper.xml

@@ -11,7 +11,7 @@
                 SELECT a.name search_name,b.id concept_id,b.lib_name name,a.is_concept as show_type, 0 as from_dis
                 FROM `kl_library_info` a, kl_concept b
                 where a.is_deleted = 'N' and b.is_deleted = 'N' and a.concept_id = b.id
-                and a.`name` = #{name}
+                and UPPER(TRIM(a.`name`)) = UPPER(TRIM(#{name}))
                 and b.lib_type = #{endType}
             )
             union
@@ -19,7 +19,7 @@
             SELECT a.name search_name,b.id concept_id,b.lib_name name,a.is_concept as show_type, 0 as from_dis
             FROM `kl_library_info` a, kl_concept b
             where a.is_deleted = 'N' and b.is_deleted = 'N' and a.concept_id = b.id
-            and a.`name` like concat (#{name},'%')
+            and UPPER(TRIM(a.`name`)) like concat (UPPER(TRIM(#{name})),'%')
             and b.lib_type = #{endType}
             )
             union
@@ -27,7 +27,7 @@
             SELECT a.name search_name,b.id concept_id,b.lib_name name,a.is_concept as show_type, 0 as from_dis
             FROM `kl_library_info` a, kl_concept b
             where a.is_deleted = 'N' and b.is_deleted = 'N' and a.concept_id = b.id
-            and a.`name` like concat ('%',#{name},'%')
+            and UPPER(TRIM(a.`name`)) like concat ('%',UPPER(TRIM(#{name})),'%')
             and b.lib_type = #{endType}
             )
 
@@ -52,7 +52,7 @@
                     AND t1.id = t2.start_id
                     AND t3.id = t2.end_id
                     <if test="name != null and name != ''">
-                        AND t1.lib_name LIKE  concat ('%',#{name},'%')
+                        AND UPPER(TRIM(t1.lib_name)) LIKE  concat ('%',UPPER(TRIM(#{name})),'%')
                     </if>
                     <if test="startType != null">
                         AND t1.lib_type = #{startType}
@@ -68,9 +68,9 @@
         ) s
         where 1 = 1
         <if test="filterName != null and filterName.size > 0">
-            and s.name not in
+            and TRIM(s.name) not in
             <foreach item="item" collection="filterName" open="(" separator="," close=")">
-                #{item}
+                TRIM(#{item})
             </foreach>
         </if>
 

+ 1 - 1
icss-service/src/main/resources/mapper/TemplateInfoMapper.xml

@@ -90,7 +90,7 @@
 			and type = #{type}
 		</if>
 		<if test="name != null and name != ''">
-			and name like concat('%',#{name},'%')
+			and UPPER(TRIM(name)) like concat('%',UPPER(TRIM(#{name})),'%')
 		</if>
 		and sex in
 		<foreach collection="sex" item="sexNew" open="(" close=")"