xml
<update id="batchInsert" parameterType="java.util.List">
insert into zn_enterprise_user (enterprise_id,real_name,user_tel,type,create_time,bind_status)
values
<foreach collection="unitUserList" item="user" separator=",">
(#{user.enterpriseId},#{user.realName},#{user.userTel},#{user.type},#{user.createTime},#{user.bindStatus})
</foreach>
</update>
Mapper類
void batchInsert(@Param("unitUserList") List<UnitUser> unitUserList);
foreach標籤的collection屬性值 unitUserList 要和 Mapper中方法簽名的 unitUserList對應