目录
集合判空
数组判空
集合判空
此处list为mapper定义的list名, 不是数据类型
<if test="list!=null and list.size()>0">
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
数组判空
此处list为mapper定义的Array名, 不是数据类型
<if test="arr!=null and arr.length>0">
<foreach collection="array" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
有用请点赞,养成良好习惯!
鼓励、交流、疑问请留言!