Mybatis 针对oracle的批量插入

xml文件参数对象:

1 public class Columns{
2     private String basedate_code;
3     private String tableName;
4     private String codeDescribeindex;
5     private String codeInfoindex;
6     private String codePymindex;
7     private List<Info> infos;

Dao层方法:

public void bulkInsert(Columns columns);

xml文件配置:

 1 <insert id="bulkInsert" parameterType="Columns">
 2         insert into manager_basedata_info (app_code,basedata_code,item_code,item_name,item_pym,updatetime)
 3         <foreach collection="infos" item="item"  index="index"  separator="UNION">
 4             select 
 5               ‘pc‘,
 6                #{basedate_code,jdbcType=VARCHAR},
 7                #{item.item_code,jdbcType=VARCHAR},
 8                #{item.item_name,jdbcType=VARCHAR},
 9                #{item.item_pym,jdbcType=VARCHAR},
10                sysdate 
11                from dual
12         </foreach>
13     </insert>

Mybatis 针对oracle的批量插入,布布扣,bubuko.com

Mybatis 针对oracle的批量插入

上一篇:ASP.NET Core MVC 配置全局路由前缀


下一篇:Fiddler2汉化版使用说明