- orderItem insert 改为批量插入

This commit is contained in:
sin 2019-04-19 20:26:43 +08:00
parent 7277ecb2d4
commit c6883c7531
3 changed files with 13 additions and 10 deletions

View File

@ -20,9 +20,9 @@ public interface OrderItemMapper {
/** /**
* 插入数据 * 插入数据
* *
* @param orderItemDO * @param orderItemDOList
*/ */
void insert(OrderItemDO orderItemDO); void insert(@Param("list") List<OrderItemDO> orderItemDOList);
/** /**
* 更新 - 根据Id * 更新 - 根据Id

View File

@ -295,9 +295,11 @@ public class OrderServiceImpl implements OrderService {
.setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) .setDeleted(DeletedStatusEnum.DELETED_NO.getValue())
.setCreateTime(new Date()) .setCreateTime(new Date())
.setUpdateTime(null); .setUpdateTime(null);
orderItemMapper.insert(orderItemDO); // TODO 芋艿需要改成一次性插入
}); });
// 一次性插入
orderItemMapper.insert(orderItemDOList);
// 创建预订单 // 创建预订单
// TODO sin 支付订单 orderSubject 暂时取第一个子订单商品信息 // TODO sin 支付订单 orderSubject 暂时取第一个子订单商品信息
// String orderSubject = orderItemDOList.get(0).getSkuName(); // String orderSubject = orderItemDOList.get(0).getSkuName();

View File

@ -20,13 +20,14 @@
payment_time, delivery_time, receiver_time, closing_time, payment_time, delivery_time, receiver_time, closing_time,
has_return_exchange, delivery_type, status, has_return_exchange, delivery_type, status,
create_time, update_time, deleted create_time, update_time, deleted
) VALUES ( ) VALUES
#{orderId}, #{orderNo}, #{skuId}, #{skuName}, #{skuImage}, #{orderLogisticsId}, <foreach collection="list" item="item" separator="," open="(" close=")">
#{quantity}, #{price}, #{payAmount}, #{item.orderId}, #{item.orderNo}, #{item.skuId}, #{item.skuName}, #{item.skuImage}, #{item.orderLogisticsId},
#{paymentTime}, #{deliveryTime}, #{receiverTime}, #{closingTime}, #{item.quantity}, #{item.price}, #{item.payAmount},
#{hasReturnExchange}, #{deliveryType}, #{status}, #{item.paymentTime}, #{item.deliveryTime}, #{item.receiverTime}, #{item.closingTime},
#{createTime}, #{updateTime}, #{deleted} #{item.hasReturnExchange}, #{item.deliveryType}, #{item.status},
) #{item.createTime}, #{item.updateTime}, #{item.deleted}
</foreach>
</insert> </insert>
<!-- <!--