<insert id="batchInsert">
insert into cp_coupon_code
(coupon_code,coupon_id,bind_id)
select a.*
from
(
<foreach collection="list" item="item" separator="UNION ALL">
select
#{item.couponCode, jdbcType=VARCHAR} coupon_code,
#{item.couponId, jdbcType=NUMERIC} coupon_id,
#{item.bindId, jdbcType=NUMERIC} bind_id
from dual
</foreach>
) a
</insert>
-- 上面的报错,就用下面的
<insert id="addSkuIdBatch">
insert into sup_jd_goods_sku_temp(
sku_id
,page_num
,supplier_id
)
<foreach collection="list" item="item" separator="UNION ALL">
select
#{item.skuId}
,#{item.pageNum}
,#{item.supplierId}
from dual
</foreach>
</insert>