數組判斷空
參數為數組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>
