From 939ccc9c254870ed15cdd485b9d303bbb00a23f2 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期日, 28 九月 2025 14:16:27 +0800
Subject: [PATCH] 注释加上上海玻璃公司ip
---
north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml | 34 +++++++++++++++++++++++++++++++---
1 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml
index 05ee854..5714b82 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml
@@ -6,9 +6,9 @@
<insert id="saveMaterialBomDataMp">
insert into sd.bom_base
- (material_id, material, status, type, consume, price,create_time)
+ (material_id, material, status, type, consume, price,unit,create_time)
values
- (#{id}, #{name}, 0, #{type}, #{consume},#{price}, now())
+ (#{id}, #{name}, 0, #{type}, #{consume},#{price}, #{unit},now())
</insert>
<select id="getMaterialId">
@@ -17,7 +17,7 @@
<update id="updateMaterialBomDataMp">
update sd.bom_base
- set type=#{type},consume=#{consume},price=#{price},create_time=now()
+ set type=#{type},consume=#{consume},price=#{price},unit=#{unit},create_time=now()
where material_id = #{id}
</update>
@@ -37,4 +37,32 @@
select *,(consume*price) as materialPric from sd.bom_product as bp left join sd.bom_base as bb on bb.id=bp.base_id
where bp.product_id = #{productId} ORDER BY product_layer
</select>
+
+ <select id="getOrderBomSumDataMp">
+ SELECT product_id,product_name,SUM(quantity) as quantity,SUM(gross_area) as area,SUM(perimeter) as perimeter
+ from sd.order_detail where order_id=#{orderId}
+ </select>
+
+ <select id="getOrderBomsumDataDatilsMp">
+ SELECT
+ od.order_id,
+ bp.product_id,
+ bb.material_id,
+ bb.material,
+ bb.`status`,
+ bb.type,
+ sum(bb.consume) as consume,
+ sum(bb.price) as price,
+ sum(bb.consume * bb.price) AS materialPrice
+ FROM
+ sd.bom_product AS bp
+ LEFT JOIN sd.bom_base AS bb ON bb.id = bp.base_id
+ LEFT JOIN (
+ select order_id,product_id from sd.order_detail GROUP BY product_id
+ ) as od on od.product_id = bp.product_id
+
+ WHERE od.order_id=#{orderId}
+ GROUP BY bb.material_id
+ ORDER BY bp.product_layer
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0