mybatis 批量插入:
void addUser(List<User> users);
<insert id="batchInsert" parameterType="list">
insert into tb_user (id,username,password)
<foreach collection="users" item="item" index="index" separator="union all">
select '${item.id}','${item.username}','${item.password}' from dual
</foreach>
</insert>