mybatis--foreach

因为在批量操作和in的使用时发现要用到foreach标签,所以简单记录一下

        

  • 标签所包含的属性( item,index,collection,open,separator,close)
item表示集合里每个对象的名称
index表示在迭代过程中迭代的位置
collection表示传进来的集合名称
open表示迭代以什么语句开始
separator表示每次迭代用什么符号分割
close表示迭代以什么语句结束

  • 其中Collection所能传递的对象(List,Array,Map)
List和Array中,item表对象,index表示元素的序号
Map中,item表示value,index表示key



猜你喜欢

转载自blog.csdn.net/zhutiandashen/article/details/80526772