mybatis数据批量更新
1、mybatis批量更新mapper
<update id="updateBatchById"><foreach collection="list" item="s" separator=";">update`tableName`set`name` = #{name},whereid = #{id}</foreach>
</update>
通过在数据库连接URL中指定allowMultiQueries参数值为true告诉数据库以支持";"号分隔的多条语句的执行。
spring.datasource.url=jdbc:mysql://localhost:3306/test?allowMultiQueries=true