|
|
@@ -2,6 +2,7 @@ package com.haha.mapper;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
import com.haha.entity.ReplenishmentOrderItem;
|
|
|
+import org.apache.ibatis.annotations.Insert;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
@@ -25,4 +26,17 @@ public interface ReplenishmentOrderItemMapper extends BaseMapper<ReplenishmentOr
|
|
|
*/
|
|
|
@Select("DELETE FROM t_replenishment_order_item WHERE order_id = #{orderId}")
|
|
|
void deleteByOrderId(@Param("orderId") Long orderId);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量插入明细
|
|
|
+ */
|
|
|
+ @Insert("<script>" +
|
|
|
+ "INSERT INTO t_replenishment_order_item (order_id, device_id, product_id, product_code, product_name, " +
|
|
|
+ "planned_quantity, unit_price, total_price, shelf_num, position, create_time) VALUES " +
|
|
|
+ "<foreach collection='list' item='item' separator=','>" +
|
|
|
+ "(#{item.orderId}, #{item.deviceId}, #{item.productId}, #{item.productCode}, #{item.productName}, " +
|
|
|
+ "#{item.plannedQuantity}, #{item.unitPrice}, #{item.totalPrice}, #{item.shelfNum}, #{item.position}, #{item.createTime})" +
|
|
|
+ "</foreach>" +
|
|
|
+ "</script>")
|
|
|
+ int insertBatch(@Param("list") List<ReplenishmentOrderItem> items);
|
|
|
}
|