Browse Source

修复通过地区码查询品牌区分布时地址码为null而导致的错误

云殇忆 1 year ago
parent
commit
ab6295a112
1 changed files with 5 additions and 3 deletions
  1. 5 3
      benyun-core/src/main/resources/mapper/BrandZoneMapper.xml

+ 5 - 3
benyun-core/src/main/resources/mapper/BrandZoneMapper.xml

@@ -54,9 +54,11 @@
         FROM
             `bl_brand_zone_distribution`
         <where>
-            <foreach collection="addrCodes" item="addrCode" open="addr_code IN (" separator="," close=")">
-                #{addrCode,jdbcType=VARCHAR}
-            </foreach>
+            <if test="addrCodes != null">
+                <foreach collection="addrCodes" item="addrCode" open="addr_code IN (" separator="," close=")">
+                    #{addrCode,jdbcType=VARCHAR}
+                </foreach>
+            </if>
         </where>
         GROUP BY
             addr_code;