mybatis的xml中判断in集合

2022-08-17 08:06:38
<iftest="deviceIds != null and deviceIds.size>0">
    and device_id in<foreachitem="item"collection="deviceIds"index="index"open="("separator=","close=")">
        #{item}</foreach></if>
  • collection:集合名称
  • item:单个对象在后续语句中的名称
  • index:序号
  • open:这段代码以这个字符开头
  • close:这段代码以这个字符结尾
  • separator:使用对应的字符进行分割
  • 作者:leo的心
  • 原文链接:https://blog.csdn.net/qq_17616169/article/details/121497740
    更新时间:2022-08-17 08:06:38