List<xx> getList(@Param("list")List<String> list);
<select id="getList" resultType="xx">
select * from t_xx where 1=1
<if test="list != null and list.size() > 0 ">
and xxxx in
<foreach collection="list" close=")" open="(" item="item" separator=",">
#{item}
</foreach>
</if>
</select>
原文链接:mybatis判断集合非空
转载仅为方便学习查看,一切权利属于原作者,本人只是做了整理和排版,如果带来不便请联系我删除。
最后修改:2023-02-08 14:34:36
© 著作权归作者所有
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付

发表评论