<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.superdesk.uniorder.dao.mapper.accounting.unified.customer.AccountingUnifiedCustomerXGoodsMapperEx">



    <!-- cn.superdesk.uniorder.dao.entity.accounting.unified.customer.AccountingUnifiedCustomerXGoods -->
    <insert id="insertBatch" parameterType="java.util.List">

        <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
            SELECT LAST_INSERT_ID()
        </selectKey>
        insert into accounting_unified_customer_x_goods (dim_create_by, accounting_order_id, accounting_order_sn,
        unified_order_id, order_sn, unified_order_goods_id,
        goods_id, out_snapshot_order_goods_id, unified_order_credit_id,
        create_time, create_user_id, update_time,
        update_user_id)
        values
        <foreach collection="list" item="item" index="index" separator=",">
        (
        #{item.dimCreateBy,jdbcType=TINYINT},
        #{item.accountingOrderId,jdbcType=BIGINT},
        #{item.accountingOrderSn,jdbcType=VARCHAR},
        #{item.unifiedOrderId,jdbcType=BIGINT},
        #{item.orderSn,jdbcType=VARCHAR},
        #{item.unifiedOrderGoodsId,jdbcType=BIGINT},
        #{item.goodsId,jdbcType=BIGINT},
        #{item.outSnapshotOrderGoodsId,jdbcType=BIGINT},
        #{item.unifiedOrderCreditId,jdbcType=BIGINT},
        #{item.createTime,jdbcType=TIMESTAMP},
        #{item.createUserId,jdbcType=BIGINT},
        #{item.updateTime,jdbcType=TIMESTAMP},
        #{item.updateUserId,jdbcType=BIGINT}
        )
        </foreach>
    </insert>
</mapper>