日期:2014-05-19  浏览次数:20640 次

mybatis skserver sql
mybatis + spring 3.0 可以做批量添加吗? 在网上看到很多

<foreach collection="items" item="item" index="index" separator=",">





4

  (#{item},#{accountId})





5

</foreach>
好像不行吧 在sql上不行的,因为select insert into table(ID) values (1) , (2) , (2) , (4) 是不支持的吧 请问有没有更好的方法啦

------解决方案--------------------
insert into table select .......

还有 批量添加。你可以用循环呀。将你要添加的数据放入数组。2维的。。循环插入。这样子也不错~!~ 菜鸟的提议~!~