MyBatis批量插入List数据实现(MySQL)
1. xml文件
2. mapper--java
3. 封装成对象
4. 动态传入表名
4.1 AllAccountMapper.xml
4.2 AllAccountMapper.java
5. 程序运行
1. xml文件
insert into error_open_account
( id,branchName,branchCode,orgName,orgId,clientId,clientName,account,accountName,openDate,checkDate,closeDate,expireDate,moneyType,subjectId,businessCode,exchangeMark,accountState,accountProperty,safeAccountNature,addTime,folderTime)
values
(
#{item.id},
#{item.branchName},
#{item.branchCode},
#{item.orgName},
#{item.orgId},
#{item.clientId},
#{item.clientName},
#{item.account},
#{item.accountName},
#{item.openDate},
#{item.checkDate},
#{item.closeDate},
#{item.expireDate},
#{item.moneyType},
#{item.subjectId},
#{item.businessCode},