生成订单:
<insert id="insert" parameterType="com.wyp.entity.OrderInfo" >
<selectKey resultType="long" keyProperty="id" order="AFTER">
select last_insert_id()
</selectKey>
insert into order_info (id, user_id, goods_id,
delivery_addr_id, goods_name, goods_count,
goods_price, order_channel, status,
create_date, pay_date)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{goodsId,jdbcType=BIGINT},
#{deliveryAddrId,jdbcType=BIGINT}, #{goodsName,jdbcType=VARCHAR}, #{goodsCount,jdbcType=INTEGER},
#{goodsPrice,jdbcType=DECIMAL}, #{orderChannel,jdbcType=TINYINT}, #{status,jdbcType=TINYINT},
#{createDate,jdbcType=TIMESTAMP}, #{payDate,jdbcType=TIMESTAMP})
</insert>
<insert id="insert" parameterType="com.wyp.entity.MSOrder" >
insert into miaosha_order (id, user_id, order_id,
goods_id)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT},
#{goodsId,jdbcType=BIGINT})
</insert>