参考资料:
http://blog.csdn.net/tolcf/article/details/39213217
- Mybatis批量更新数据
修改数据库连接配置:&allowMultiQueries=true
比如:jdbc:mysql://localhost/tuzhen?useUnicode=true&characterEncoding=utf8&generateSimpleParameterMetadata=true**&allowMultiQueries=true**
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update test
<set>
test=${item.test}+1
</set>
where id = ${item.id}
</foreach>
</update>