意思是说该XXX集合为空集合(集合计算为空值)
<if test=" xxxList != null and xxxList.size > 0">
where id in
<foreach collection="xxxList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
这种情况在<foreach>标签外面加<if>标签做非空判断即可
意思是说该XXX集合为空集合(集合计算为空值)
<if test=" xxxList != null and xxxList.size > 0">
where id in
<foreach collection="xxxList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
这种情况在<foreach>标签外面加<if>标签做非空判断即可