数组判断空
参数为数组object[]。在MyBatis判断空时,先判断是否为null,不为null则判断数组长度object.length是否大于0即可。
<if test="object!=null and object.length>0">
<yourSql>
</if>
集合判断空
参数为集合List。在MyBatis判断空时,先判断是否为null,不为null则判断集合长度object.size()是否大于0即可。
<if test="object!=null and object.size()>0">
<yourSql>
</if>
原文:https://www.cnblogs.com/tiancai/p/14641478.html