Mysql批量插入
PersonMapper.java
int batchInsertPerson(@Param("list") List<Person> dsLocationList);
PersionMapper.xml
<insert id="batchInsertPerson" parameterType="java.util.List">
insert into ds_location (NAME, AGE, PHONE)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.name,jdbcType=VARCHAR},
#{item.age,jdbcType=VARCHAR},
#{item.phone,jdbcType=VARCHAR}
)
</foreach>
</insert>