mybatis 中foreach中的坑
我踩过一次坑,记录一下,也发篇博客来帮助同样遇到这个问题的人
进入正题
有一个需求是想通过传入一个字符串数组,然后通过goods_coding字段匹配出不在此数组内的所有商品。所以我使用foreach循环,代码如下
<if test="codings != null and codings.length>0">
and goods_coding not in
<foreach collection="codings
我踩过一次坑,记录一下,也发篇博客来帮助同样遇到这个问题的人
进入正题
有一个需求是想通过传入一个字符串数组,然后通过goods_coding字段匹配出不在此数组内的所有商品。所以我使用foreach循环,代码如下
<if test="codings != null and codings.length>0">
and goods_coding not in
<foreach collection="codings