本帖最后由 java 于 2018-5-3 15:18 编辑
批量更新
修改数据库连接配置:&allowMultiQueries=true 比如:jdbc:mysql://192.168.1.236:3306/test?useUnicode=true&characterEncoding=UTF-8&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>
复制代码
https://blog.csdn.net/u011277123/article/details/54374833
|