Sfoglia il codice sorgente

列表搜索条件去空格、去大小写

wangfeng 5 anni fa
parent
commit
c080d2d2d1

+ 1 - 1
precman-service/src/main/resources/mapper/ModuleInfoMapper.xml

@@ -31,7 +31,7 @@
     <select id="getModuleInfoListByType" resultType="com.diagbot.dto.ModuleInfoListDTO">
         SELECT * FROM `prec_module_info` WHERE is_deleted = 'N'
         <if test="name != null and name != ''">
-            and name like concat ('%',#{name},'%')
+            and UPPER(name) like concat ('%',UPPER(trim(#{name})),'%')
         </if>
         <if test="type != null and type != ''">
             and type = #{type}

+ 7 - 7
precman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -46,10 +46,10 @@
         select * from `prec_question_info`
         where is_deleted = 'N'
         <if test="tagName != null and tagName != ''">
-            and tag_name like concat("%", #{tagName}, "%")
+            and UPPER(tag_name) like concat("%", UPPER(trim(#{tagName})), "%")
         </if>
         <if test="existName != null and existName != ''">
-            and tag_name = #{existName}
+            and UPPER(tag_name) = UPPER(trim(#{existName}))
         </if>
         <if test="sexType != null and sexType != 3 and sexType != ''">
             and sex_type in (3, #{sexType})
@@ -134,16 +134,16 @@
             LEFT JOIN `prec_question_info` t3 on t2.parent_question = t3.id and t3.is_deleted = 'N'
             WHERE t1.is_deleted = 'N'
             <if test="combinationName != null and combinationName != ''">
-                and t3.tag_name like concat ('%', #{combinationName}, '%')
+                and UPPER(t3.tag_name) like concat ('%', UPPER(trim(#{combinationName})), '%')
             </if>
             <if test="type != null and type != ''">
                 AND t1.type = #{type}
             </if>
             <if test="name != null and name != ''">
-                AND t1.name like concat ('%', #{name}, '%')
+                AND UPPER(t1.name) like concat ('%', UPPER(trim(#{name})), '%')
             </if>
             <if test="tagName != null and tagName != ''">
-                AND t1.tag_name like concat ('%', #{tagName}, '%')
+                AND UPPER(t1.tag_name) like concat ('%', UPPER(trim(#{tagName})), '%')
             </if>
             <if test="notTypeList != null and notTypeList.size() > 0 ">
                 and t1.type not in
@@ -173,10 +173,10 @@
                 AND a.type = #{type}
             </if>
             <if test="tagName != null and tagName != ''">
-                AND a.tag_name like concat ('%', #{tagName}, '%')
+                AND UPPER(a.tag_name) like concat ('%', UPPER(trim(#{tagName})), '%')
             </if>
             <if test="name != null and name != ''">
-                AND a.name like concat ('%', #{name}, '%')
+                AND UPPER(a.name) like concat ('%', UPPER(trim(#{name})), '%')
             </if>
             <if test="notTypeList != null and notTypeList.size() > 0 ">
                 and a.type not in