数组判断空
参数为数组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>
Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐