mybatis sql批量插入

 insert into jrqf_officialcard 
  (id, budget_unit, money_purpose, economic_type, money, func_subject_name, 
  treasury_accountbank, merchant_name)
  select t.* from(
   <foreach collection ="myList" item="fb" separator ="UNION ALL">
   select 
   #{fb.id},
   #{fb.budget_unit} ,
   #{fb.money_purpose} , 
   #{fb.economic_type} ,
   #{fb.money,jdbcType=FLOAT},   
   #{fb.func_subject_name} , 
   #{fb.treasury_accountbank} ,
   #{fb.merchant_name} 
    FROM DUAL
   </foreach >)t

  

posted on 2018-08-14 16:28  ckx0709  阅读(501)  评论(0编辑  收藏  举报

导航