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>
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>
本文标题:mybatis判断list为空或null,在xml文件中。
本文链接:https://www.haomeiwen.com/subject/rymoirtx.html
网友评论