jdbc连接增加allowMultiQueries=true即可

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

sql之间使用;分隔

demo

<update id="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};
</update>
Logo

更多推荐