소스 검색

在集合业务中,搜索术语,遍历的集合要用括号括起来

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

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

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