mybits批量插入

 1 <!--批量插入-->
 2 
 3     <insert id="batchSave" parameterType="java.util.List">
 4          insert into storage_logistic ( plant_name, location, change_time, num, ebeln, ebelp, zid_po, bwart, elikz, mblnr )
 5           VALUES
 6         <foreach collection="list"  item="itm" separator=",">
 7             (#{itm.plant_name},#{itm.location},#{itm.change_time},#{itm.num},#{itm.ebeln},#{itm.ebelp},#{itm.zid_po},#{itm.bwart},#{itm.elikz},#{itm.mblnr})
 8         </foreach>
 9         <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="storage_id">
10             select LAST_INSERT_ID();
11         </selectKey>
12     </insert>



public int batchSave(List<StorageLogisticVo> storagelogisticvo) {
int num = storageLogisticMapper.batchSave(storagelogisticvo);
return num;
}

 

posted @ 2016-04-20 14:51  LEON.LEE  阅读(706)  评论(0编辑  收藏  举报