错误原因:在mybatis xml文件中的动态sql,if test 非空判断类型出错,把JSONArray与空串作比较,代码片段如下:
**错误原因:**在mybatis xml文件中的动态sql,if test 非空判断类型出错,把JSONArray与空串作比较,代码片段如下:
<if test="list != null and list !=''">
and bp.id in
<foreach collection="list" item="item" index="index" open="("
separator="," close=")">
#{item}
</foreach>
</if>
其中 items 为JSONArray,所以上面代码片段出错位置是 【items !=’’ '】
即去掉 【and items != ‘’】