소스 검색

在集合业务中,搜索术语,搜索的可能为空

kongwz 3 년 전
부모
커밋
fcf3b70e15
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      src/main/resources/mapper/KlConceptMapper.xml

+ 6 - 2
src/main/resources/mapper/KlConceptMapper.xml

@@ -815,12 +815,16 @@
             <choose>
                 <when test="logicalOperator != null and logicalOperator eq 0">
                     <foreach collection="names" item="id" open="(" separator="and" close=")">
-                        UPPER(kc.lib_name) LIKE CONCAT('%', UPPER(trim(#{id})), '%')
+                        <if test="id != null and id != ''">
+                            UPPER(kc.lib_name) LIKE CONCAT('%', UPPER(trim(#{id})), '%')
+                        </if>
                     </foreach>
                 </when>
                 <when test="logicalOperator != null and logicalOperator eq 1">
                     <foreach collection="names" item="id" open="(" separator="or" close=")">
-                        UPPER(kc.lib_name) LIKE CONCAT('%', UPPER(trim(#{id})), '%')
+                        <if test="id != null and id != ''">
+                            UPPER(kc.lib_name) LIKE CONCAT('%', UPPER(trim(#{id})), '%')
+                        </if>
                     </foreach>
                 </when>
             </choose>