语句类似这种: <insert id="addUser" parameterType="java.util.List" > insert into user(name,age) values <foreach collection="list" item="item" index="index" separator=","> (#{item.name},#{item.age}) </foreach> </insert>
insert ignore into .... 加了ignore后,出现错误后并不会影响后面sql的执行
insert ignore