SET @update_id := 0;update sharding_seq set table_seq=(SELECT @update_id := table_seq+10) where table_name='md_sku_front_list';SELECT @update_id;
mybatis支持一次执行多条SQL,如上面所示。
但是需要注意的是连接数据库的url需要新增参数:allowMultiQueries=true
jdbc.jdbcUrl=jdbc:mysql://127.0.0.1:3306/database?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true