关于java:mybatis判断list为空或null在xml文件中

mybatis判断汇合为空或者元素个数为零 ,mybatis判断list为空或null,在xml文件中,长久层写法:

 <if test="questionIds!= null and questionIds.size()>0" >
       WHERE id in
      <foreach collection="questionIds" index="index" item="item" open="(" separator="," close=")">
            #{item}
       </foreach>
 </if>

双软认证高企软件认证著作权 恒标

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理