From 9ccc8bd3a53160a40cf60f14e5867f6ce9f6c58f Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期五, 26 十二月 2025 16:49:15 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 104 insertions(+), 13 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
index fe328f7..8cae8a7 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
@@ -17,22 +17,39 @@
total_area,
process,
- `group`)
+ `group`
+ ,arc)
select
od.order_id,
od.order_number,
pd.glass_sort,
- if(pd.glass_sort=1,'(澶�)',if(pd2.glass_sort=pd.glass_sort,'(鍐�)','')),
+ if(pd.glass_sort=1 or pd2.glass_sort=pd.glass_sort,
+ if(JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.position'))='',
+ if(pd.glass_sort=1,#{outside},#{inside})
+ ,JSON_UNQUOTE(JSON_EXTRACT(pd.separation, '$.position'))),
+ ''),
pd.detail,
if( od.bend_radius!='',
- round(od.width*(od.bend_radius-round(sum(t.thicknessCount),2))/od.bend_radius,0),
+ round(od.width*
+ (od.bend_radius-round(
+ sum(t.thicknessCount)-t1.thicknessCount/2
+ ,2))
+ /od.bend_radius
+ ,1),
od.width
- ),
+ )
+ ,
+
od.height,
od.area,
od.gross_area,
pd.process,
- pd.glass_group
+ pd.glass_group,
+ if( od.bend_radius!='',
+ round((od.width*(od.bend_radius-(sum(t.thicknessCount)-t1.thicknessCount)))/od.bend_radius,1)
+ ,null) as 'arc'
+
+
from sd.product_detail as pd
left join order_detail as od
on od.product_id = pd.prod_id and pd.detail_type='glass'
@@ -43,18 +60,23 @@
a.prod_id,
a.sort_num,
a.glass_sort,
- (case
- when a.sort_num=1
- then left(detail,LOCATE('mm',detail)-1)/2
- else
- left(detail,LOCATE('mm',detail)-1)
- end) as 'thicknessCount'
+ left(detail,LOCATE('mm',detail)-1) as 'thicknessCount'
from product_detail as a
group by prod_id,a.sort_num
) as t
ON t.prod_id = od.product_id and t.sort_num <=pd.sort_num
+ left join (
+ select
+ a.prod_id,
+ a.sort_num,
+ a.glass_sort,
+ left(detail,LOCATE('mm',detail)-1) as 'thicknessCount'
+ from product_detail as a
+ group by prod_id,a.sort_num
+ ) as t1
+ ON t1.prod_id = od.product_id and t1.sort_num =pd.sort_num
where od.order_id = #{orderId}
group by od.order_number,pd.glass_sort
@@ -74,6 +96,8 @@
<result column="glass_child" property="glassChild"/>
<result column="child_width" property="childWidth"/>
<result column="child_height" property="childHeight"/>
+ <result column="arc" property="arc"/>
+ <result column="arch_rise" property="archRise"/>
<result column="icon" property="icon"/>
<result column="process" property="process"/>
<result column="area" property="area"/>
@@ -82,6 +106,7 @@
<association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
<result column="building_number" property="buildingNumber"/>
+ <result column="product_id" property="productId"/>
<result column="product_name" property="productName"/>
<result column="width" property="width"/>
<result column="height" property="height"/>
@@ -100,6 +125,7 @@
a.order_id,
a.order_number,
b.building_number,
+ b.product_id,
b.product_name,
a.glass_address,
a.technology_number,
@@ -110,8 +136,9 @@
a.total_area,
b.edging_type,
a.child_width,
- a.child_height,
+ a.child_height,a.arc,
a.icon,
+ a.arch_rise,
a.area,
b.quantity,
a.process,
@@ -134,7 +161,9 @@
a.area = #{item.area},
a.total_area = #{item.area}*b.quantity,
a.icon = #{item.icon},
- a.process = #{item.process}
+ a.process = #{item.process},
+ a.arc = #{item.arc},
+ a.arch_rise = #{item.archRise}
where
a.order_id = b.order_id
and a.order_id = #{item.orderId}
@@ -143,4 +172,66 @@
</foreach>
</update>
+
+ <select id="getDifferentSizeNumber">
+ select if(count(id)>0,1,0) from (select
+ a.id,a.child_width,b.width
+ from order_glass_detail as a
+ left join order_detail as b
+ on a.order_id = b.order_id and a.order_number = b.order_number
+ where a.order_id = #{orderId}
+ and a.order_number = #{orderNumber}
+ and(a.child_width != b.width or a.child_height != b.height)
+ ) as c
+ </select>
+
+ <select id="getOrderGlassDetailByProductIdGlassChild" >
+ select a.glass_child
+ from sd.order_glass_detail as a
+ where a.order_id = #{orderId}
+ and a.order_number = #{orderNumber}
+ group by a.glass_child
+ </select>
+
+ <select id="getOrderGlassDetailByProductId" >
+ select *
+ from sd.order_detail od
+ LEFT join sd.order_glass_detail ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number
+ where od.order_id = #{orderId} and od.product_id=#{productId}
+ and ogd.glass_child=#{glassChild}
+ </select>
+
+ <select id="getMinIdByGroup" >
+ select min(id) from sd.order_glass_detail as a
+ where a.order_id = #{orderId}
+ and a.order_number = #{orderNumber}
+ and a.`group` = #{group}
+
+ </select>
+
+ <select id="getMaxIdByGroup" >
+ select max(id) from sd.order_glass_detail as a
+ where a.order_id = #{orderId}
+ and a.order_number = #{orderNumber}
+ and a.`group` = #{group}
+
+ </select>
+
+
+ <select id="getMinTechnologyNumberByGroup" >
+ select min(technology_number) from sd.order_glass_detail as a
+ where a.order_id = #{orderId}
+ and a.order_number = #{orderNumber}
+ and a.`group` = #{group}
+
+ </select>
+
+ <select id="getMaxTechnologyNumberByGroup" >
+ select max(technology_number) from sd.order_glass_detail as a
+ where a.order_id = #{orderId}
+ and a.order_number = #{orderNumber}
+ and a.`group` = #{group}
+
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0