Mybatis xml 写sql如何判断集合的size


在mybtis的映射文件中判断集合大小  list.size  例子如下:

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM