前言:
使用MybatisPlus批量更新数据库时抛异常:java.sql.SQLException: sql injection violation, multi-statement
找到报错的sql:
<update id="batchUpdateCategory">
<foreach collection="list" item="bean" index="index" open="" close="" separator=";">
update cms_topic
set category_id = #{
bean.categoryId}
where id = #{
bean.id}
</foreach>
</update>