Ver código fonte

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

wangfeng 5 anos atrás
pai
commit
13df069b20

+ 8 - 8
icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -49,13 +49,13 @@
         select * from `icss_question_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="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})
@@ -110,15 +110,15 @@
         select * from `icss_question_info`
         where is_deleted = 'N'
         <if test="names != null and names.size() > 0">
-            and name in
+            and UPPER(name) in
             <foreach  collection="names" item="name" open="("  separator=","  close=")">
-                #{name}
+                UPPER(trim (#{name}))
             </foreach>
         </if>
         <if test="tagNames != null and tagNames.size() > 0">
-            and tag_name in
+            and UPPER(tag_name) in
             <foreach  collection="tagNames" item="tagName" open="("  separator=","  close=")">
-                #{tagName}
+                UPPER(trim (#{tagName}))
             </foreach>
         </if>
         <if test="sexType != null and sexType != 3 and sexType != ''">
@@ -216,7 +216,7 @@
             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="notTypeList != null and notTypeList.size() > 0 ">
             and a.type not in

+ 1 - 1
knowledgeman-service/src/main/java/com/diagbot/facade/DiagnoseImportFacade.java

@@ -237,7 +237,7 @@ public class DiagnoseImportFacade {
 
     public void exportDiagnosticBasis(DiagnosticBasisExportVO diaExportVO, HttpServletResponse response) {
         QueryWrapper<DiagnoseQuestion> diaQuery = new QueryWrapper<>();
-        diaQuery.like("dis_name", diaExportVO.getDisName()).like("question_name", diaExportVO.getQuestion())
+        diaQuery.like("dis_name", diaExportVO.getDisName()).like("question_name", diaExportVO.getQuestion().trim())
                 .like("type", diaExportVO.getType()).eq("is_deleted", IsDeleteEnum.N.getKey()).orderByDesc("gmt_modified");
         List<DiagnoseQuestion> datas = diagnoseQuestionService.list(diaQuery);
 

+ 39 - 39
knowledgeman-service/src/main/java/com/diagbot/facade/DiagnoseQuestionFacade.java

@@ -1,39 +1,39 @@
-package com.diagbot.facade;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.DiagnoseQuestionPageDTO;
-import com.diagbot.entity.DiagnoseQuestion;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.DiagnoseQuestionService;
-import com.diagbot.vo.DiagnoseQuestionPageVO;
-
-@Component
-public class DiagnoseQuestionFacade  {
-	
-
-	@Autowired
-	DiagnoseQuestionService diagnoseQuestionService;
-	/**
-	 * 
-	 * @param diagnoseQuestionPageVO
-	 * @return
-	 */
-	public IPage<DiagnoseQuestionPageDTO> queryQuestionPage(DiagnoseQuestionPageVO diagnoseQuestionPageVO) {
-		
-		QueryWrapper<DiagnoseQuestion> diaQuery = new QueryWrapper<>();
-		diaQuery.like("type",diagnoseQuestionPageVO.getType())
-				.like("dis_name",diagnoseQuestionPageVO.getDisName())
-				.like("question_name",diagnoseQuestionPageVO.getQuestionCode())
-				.eq("is_deleted",IsDeleteEnum.N.getKey())
-				.orderByDesc("gmt_modified");
-				
-		IPage<DiagnoseQuestionPageDTO> datas = diagnoseQuestionService.page(diagnoseQuestionPageVO, diaQuery);
-		
-		return datas;
-	}
-
-}
+package com.diagbot.facade;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.DiagnoseQuestionPageDTO;
+import com.diagbot.entity.DiagnoseQuestion;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.DiagnoseQuestionService;
+import com.diagbot.vo.DiagnoseQuestionPageVO;
+
+@Component
+public class DiagnoseQuestionFacade  {
+	
+
+	@Autowired
+	DiagnoseQuestionService diagnoseQuestionService;
+	/**
+	 * 
+	 * @param diagnoseQuestionPageVO
+	 * @return
+	 */
+	public IPage<DiagnoseQuestionPageDTO> queryQuestionPage(DiagnoseQuestionPageVO diagnoseQuestionPageVO) {
+		
+		QueryWrapper<DiagnoseQuestion> diaQuery = new QueryWrapper<>();
+		diaQuery.like("type",diagnoseQuestionPageVO.getType().trim())
+				.like("dis_name",diagnoseQuestionPageVO.getDisName().trim())
+				.like("question_name",diagnoseQuestionPageVO.getQuestionCode().trim())
+				.eq("is_deleted",IsDeleteEnum.N.getKey())
+				.orderByDesc("gmt_modified");
+				
+		IPage<DiagnoseQuestionPageDTO> datas = diagnoseQuestionService.page(diagnoseQuestionPageVO, diaQuery);
+		
+		return datas;
+	}
+
+}

+ 3 - 3
knowledgeman-service/src/main/resources/mapper/DiagnoseMapper.xml

@@ -21,7 +21,7 @@
         SELECT * from kl_diagnose a
         where a.is_deleted = 'N'
         <if test="disName != null and disName != ''">
-            and a.dis_name like concat('%',#{disName} ,'%' )
+            and UPPER(a.dis_name) like concat('%',UPPER(trim(#{disName})) ,'%' )
         </if>
         <if test="modifier != null and modifier != ''">
             and a.modifier like concat('%',#{modifier} ,'%' )
@@ -35,7 +35,7 @@
     <select id="index" resultType="com.diagbot.dto.ConceptBaseDTO">
         SELECT a.lib_name name, a.id conceptId FROM kl_concept a
         WHERE a.lib_type = #{libType}
-        AND a.lib_name LIKE concat('%', #{name}, '%')
+        AND UPPER(a.lib_name) LIKE concat('%', UPPER(trim(#{name})), '%')
         AND a.is_deleted = 'N'
         AND NOT EXISTS (
             SELECT 1 FROM kl_diagnose b
@@ -69,7 +69,7 @@
                 #{item}
             </foreach>
         </if>
-        AND (a.NAME = #{name} OR a.spell = #{name})
+        AND (UPPER(a.NAME) = UPPER(trim (#{name})) OR UPPER(a.spell) = UPPER(trim (#{name})) )
 
         union
 

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

@@ -33,7 +33,7 @@
 		FROM kl_disclaimer_information
 		WHERE is_deleted = "N"
 		<if test="disAll.title != null">
-		and title like concat('%',#{disAll.title},'%')
+		and UPPER(title) like concat('%',UPPER(trim (#{disAll.title})),'%')
 		</if>
 		ORDER BY gmt_create DESC
 	</select>

+ 2 - 2
knowledgeman-service/src/main/resources/mapper/EvaluationMapper.xml

@@ -34,7 +34,7 @@
 	and b.is_deleted = 'N'
 	and a.concept_id = b.id
 	<if test="evaluationModule.diseaseName != null">
-		AND b.lib_name LIKE CONCAT('%', #{evaluationModule.diseaseName}, '%')
+		AND UPPER(b.lib_name) LIKE CONCAT('%', UPPER(trim(#{evaluationModule.diseaseName})), '%')
 	</if>
 	GROUP BY a.concept_id
 	ORDER BY a.gmt_create DESC
@@ -66,7 +66,7 @@
 	AND b.is_deleted = "N"
 	WHERE b.concept_id IS NULL
 	<if test="diseaseNameVO.diseaseName != null and diseaseNameVO.diseaseName != ''">
-	AND a.diseaseName LIKE CONCAT('%', #{diseaseNameVO.diseaseName}, '%')
+	AND UPPER(a.diseaseName) LIKE CONCAT('%', UPPER(trim(#{diseaseNameVO.diseaseName})), '%')
 	</if>
 	ORDER BY a.diseaseName DESC
 </select>

+ 2 - 2
knowledgeman-service/src/main/resources/mapper/IndexConfigMapper.xml

@@ -30,7 +30,7 @@
 	WHERE b.is_deleted = 'N'
 	and a.disease_id = b.id
 	<if test="indexConfigVO.diseaseName != null">
-		AND b.lib_name LIKE CONCAT('%', #{indexConfigVO.diseaseName}, '%')
+		AND UPPER(b.lib_name) LIKE CONCAT('%', UPPER(trim (#{indexConfigVO.diseaseName})), '%')
 	</if>
 	GROUP BY a.disease_id
 	ORDER BY state ASC,gmtModified DESC
@@ -61,7 +61,7 @@
 	ON a.diseaseId = b.disease_id
 	WHERE b.disease_id IS NULL
 	<if test="diseaseNameVO.diseaseName != null and diseaseNameVO.diseaseName != ''">
-		AND a.diseaseName LIKE CONCAT('%', #{diseaseNameVO.diseaseName}, '%')
+		AND UPPER(a.diseaseName) LIKE CONCAT('%', UPPER(trim (#{diseaseNameVO.diseaseName})), '%')
 	</if>
 	ORDER BY a.diseaseName DESC
 </select>

+ 13 - 13
knowledgeman-service/src/main/resources/mapper/LisMappingMapper.xml

@@ -71,13 +71,13 @@
         AND item_con.is_deleted = 'N'
         WHERE 1=1
         <if test="lisMappingPageVO.mealName != null and lisMappingPageVO.mealName != '' ">
-            and lis_mapping.meal_name like concat('%',#{lisMappingPageVO.mealName},'%')
+            and UPPER(lis_mapping.meal_name) like concat('%',UPPER(trim(#{lisMappingPageVO.mealName})),'%')
         </if>
         <if test="lisMappingPageVO.itemName != null and lisMappingPageVO.itemName != '' ">
-            and item_con.lib_name like concat('%',#{lisMappingPageVO.itemName},'%')
+            and UPPER(item_con.lib_name) like concat('%',UPPER(trim(#{lisMappingPageVO.itemName})),'%')
         </if>
         <if test="lisMappingPageVO.uniqueName != null and lisMappingPageVO.uniqueName != '' ">
-            and lis_mapping.unique_name like concat('%',#{lisMappingPageVO.uniqueName},'%')
+            and UPPER(lis_mapping.unique_name) like concat('%',UPPER(trim(#{lisMappingPageVO.uniqueName})),'%')
         </if>
         order by lis_mapping.gmt_modified desc
     </select>
@@ -98,35 +98,35 @@
         WHERE
         lis.is_deleted = 'N'
         <if test="mealIsDeleted != null and mealIsDeleted !=  ''">
-            AND meal_con.is_deleted = #{mealIsDeleted}
+            AND UPPER(meal_con.is_deleted) = UPPER(#{mealIsDeleted})
         </if>
         <if test="uniqueIsDeleted != null and uniqueIsDeleted !=  ''">
-            AND unique_con.is_deleted = #{uniqueIsDeleted}
+            AND UPPER(unique_con.is_deleted) = UPPER(#{uniqueIsDeleted})
         </if>
         AND lis.meal_id = meal_con.id
         AND lis.unique_id = unique_con.id
         ) lis_mapping
         LEFT JOIN kl_concept item_con ON lis_mapping.item_id = item_con.id
         <if test="itemIsDeleted != null and itemIsDeleted !=  ''">
-            AND item_con.is_deleted = #{itemIsDeleted}
+            AND UPPER(item_con.is_deleted) = UPPER(#{itemIsDeleted})
         </if>
         WHERE 1=1
         <if test="mealNames != null and mealNames.size() > 0 ">
-            and lis_mapping.meal_name in
+            and UPPER(lis_mapping.meal_name) in
             <foreach  collection="mealNames" item="mealName" open="("  separator=","  close=")">
-                #{mealName}
+                UPPER(trim (#{mealName}))
             </foreach>
         </if>
         <if test="itemNames != null and itemNames.size() > 0 ">
-            and item_con.lib_name in
+            and UPPER(item_con.lib_name) in
             <foreach  collection="itemNames" item="itemName" open="("  separator=","  close=")">
-                #{itemName}
+                UPPER(trim (#{itemName}))
             </foreach>
         </if>
         <if test="uniqueNames != null and uniqueNames.size() > 0 ">
-            and lis_mapping.unique_name in
+            and UPPER(lis_mapping.unique_name) in
             <foreach  collection="uniqueNames" item="uniqueName" open="("  separator=","  close=")">
-                #{uniqueName}
+                UPPER(trim (#{uniqueName}))
             </foreach>
         </if>
     </select>
@@ -144,7 +144,7 @@
             where a.is_deleted = 'N') t
         where
         <foreach item="item" collection="list" open="(" separator="or" close=")" >
-            t.tc = #{item.mealName} and t.mx = #{item.itemName}
+            UPPER(t.tc) = UPPER(#{item.mealName}) and UPPER(t.mx) = UPPER(#{item.itemName})
         </foreach>
     </select>
 

+ 3 - 3
knowledgeman-service/src/main/resources/mapper/ScaleContentMapper.xml

@@ -14,10 +14,10 @@
         where a.concept_id = b.id
         and b.is_deleted = 'N'
         <if test="status != null and status != ''">
-            and a.is_deleted = #{status}
+            and UPPER(a.is_deleted) = UPPER(#{status})
         </if>
         <if test="name != null and name != ''">
-            and b.lib_name like concat('%',#{name} ,'%' )
+            and UPPER(b.lib_name) like concat('%',UPPER(#{name}) ,'%' )
         </if>
         and b.lib_type = #{libType}
         ORDER BY a.is_deleted, a.gmt_modified desc
@@ -29,7 +29,7 @@
         where a.is_deleted = 'N'
         and a.lib_type = #{libType}
         <if test="name != null and name != ''">
-            and a.lib_name like concat('%',#{name} ,'%' )
+            and UPPER(a.lib_name) like concat('%',UPPER(#{name}) ,'%' )
         </if>
         and not EXISTS(select 1 from kl_scale where a.id = concept_id)
         order by a.gmt_modified desc

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

@@ -30,7 +30,7 @@
 	FROM kl_version_info u
 	WHERE u.is_deleted = 'N'
 	<if test="versionWrapperNameVO.name != null">
-		AND u.name LIKE CONCAT('%', #{versionWrapperNameVO.name}, '%')
+		AND UPPER(u.name) LIKE CONCAT('%', UPPER(trim (#{versionWrapperNameVO.name})), '%')
 	</if>
 	<if test="versionWrapperNameVO.productType != null and versionWrapperNameVO.productType != ''">
 		AND u.product_type = #{versionWrapperNameVO.productType}