有个常见的场景:在xml中一次性执行多条sql语句。
1、修改数据库连接参数加上allowMultiQueries=true,如:
jdbc:mysql://localhost:3306/test?useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
2、直接写多条语句,用“;”隔开即可
<delete id="deleteUserById" parameterType="String">
delete from sec_user_role where userId=#{id};
delete from sec_user where id=#{id};
</delete>