mybatis 批量添加对象

  <!-- 【添加  批量】 insertBatch -->
   <insert id="insertBatch" parameterType="list">  
   insert e_Kpnr(id,ghdw_id,hwhyslwmc, ggxh, dw, sl, dj, je, shlv, se)  
   values  
   <foreach collection="list" item="obj" index="index" separator="," >  
      (#{obj.id},#{obj.ghdwId},#{obj.hwhyslwmc},#{obj.ggxh},#{obj.dw},#{obj.sl},#{obj.dj},#{obj.je},  
      #{obj.shlv},#{obj.se})  
   </foreach>  
   </insert>

 (更多的批量操作见:http://topmanopensource.iteye.com/blog/1833001)

posted @ 2016-09-26 17:16  Moka<TI  阅读(3637)  评论(0编辑  收藏  举报