设置允许mybatis一次执行多条sql

jdbc连接增加allowMultiQueries=true即可

jdbc.jdbcUrl=jdbc:mysql://127.0.0.1:3306/database?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true

sql之间使用;分隔

demo

"down">
    UPDATE table SET 
        order_num = order_num - 1
    WHERE order_num = #{orderNum} + 1;
    UPDATE table SET 
        order_num = order_num + 1
    WHERE id = #{id};

你可能感兴趣的:(#,mybatis)