1.<update id="updateBatch" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";">
UPDATE enterprise_oil_adjust_record
SET next_enterprise_price = #{item.nextEnterprisePrice}
WHERE
batch_no = #{item.batchNo}
</foreach>
</update>
2.sql连接添加
&allowMultiQueries=true
3.数据源
//Druid配置的时候还有一个大坑就是,不要同时配置filters和proxyFilters,filter都是内置的,想通过proxyFilters来定制的话,就不要配置filters标签:mybatisplus,批量,proxyFilters,更新,filters,wallFilter,new,wallConfig From: https://www.cnblogs.com/zhuoneng/p/17928800.html
datasource.setConnectionProperties(dataSourceProperties.getConnectionProperties());
WallConfig wallConfig=new WallConfig();
wallConfig.setMultiStatementAllow(true);
WallFilter wallFilter = new WallFilter();
wallFilter.setConfig(wallConfig);
List<Filter> filters = new ArrayList<>();
filters.add(wallFilter);
datasource.setProxyFilters(filters);