mybatis 批量 insert 对象
mybatis List 批量 insert 对象
<insert id="addTrainRecordBatch">
insert into product_sort (sell_id, shop_id,
sort_id, fid, name,
status, lev
)
values
<foreach collection="list" item="item" index="index" separator="," >
(#{item.sellId},#{item.shopId},#{item.sortId},#{item.fid},#{item.name},#{item.status},#{item.lev})
</foreach>
</insert>
上述collection的值为list对象,对应的Mapper是这样的
public void addBath(List<ProductSort> listProductSort);
相关推荐
xiuyangsong 2020-11-16
Nishinoshou 2020-11-09
jimgreatly 2020-09-01
dongxurr 2020-08-18
Dullonjiang 2020-08-15
Dullonjiang 2020-08-11
Dullonjiang 2020-08-09
dongxurr 2020-08-08
yunzhonmghe 2020-08-07
jimgreatly 2020-08-03
Dullonjiang 2020-07-30
jimgreatly 2020-07-27
liqiancao 2020-07-26
xiuyangsong 2020-07-26
dongxurr 2020-07-26
mcvsyy 2020-07-26
helloxusir 2020-07-25
牧场SZShepherd 2020-07-20