mysql批量添加数据
程序员文章站
2022-07-13 13:08:40
...
批量添加数据库数据:
Mapper方法:
int batchInsert(List<Account> accountList);
Sql:
<insert id="batchInsert" parameterType="java.util.List">
insert into tb_account(account_no, account_name, account_province, account_city, account_district, account_address, create_time) values
<foreach collection="list" item="item" separator=",">
(#{item.accountNo},#{item.accountName},#{item.accountProvince},#{item.accountCity},#{item.accountDistrict},#{item.accountAddress},now())
</foreach>
</insert>
上一篇: jdbc批量添加数据
下一篇: poi上传Excel文件批量添加数据