The solution is transferred from the Netizen:
Pro-Test solves the problem
MySQL does not support this kind of operation by default, but does not mean that it cannot be implemented, just a little configuration in the JDBC configuration file:
Driver=com.mysql.jdbc.driver
Url=jdbc:mysql://127.0.0.1:3306/airipo?useunicode=true&characterencoding=utf-8&zerodatetimebehavior= Converttonull&allowmultiqueries=true
Username=imp
Password=123
Wherein, allowmultiqueries=true This configuration is key and must be written
Then, in the mapping file under the label will be more than one SQL, separated by, sample code:
<insert id= "AddUser" parametertype= "User" >
Insert into T_users (Name,password,phone) VALUES (#{name}, #{password},#{phone});
Insert into T_DEP (depname) VALUES (#{depname})
</insert>
Mybatis+mysql execute multiple SQL statements in a tag this pit, my heart has a MMP