From 3bbf78db5e01bd8d080e9e4965a532326bc162ad Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期三, 26 六月 2024 18:38:12 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml |   94 ++++++++++++++++++++++++++--------------------
 1 files changed, 53 insertions(+), 41 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
index 9bc991c..eef392b 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -429,6 +429,11 @@
         order by create_time desc
     </select>
 
+    <select id="selectPrintFlowCard">
+        select * from  pp.optimize_project where create_time between #{selectTime1} and #{selectTime2} and state>=20
+        order by create_time desc
+    </select>
+
     <select id="selectPrintMp">
         select fc.id,
                fc.order_id,
@@ -521,31 +526,24 @@
     </update>
 
     <select id="getPrintLabel">
-        select c.customer_name,
-               c.order_id,
+        select o.order_id,
+               o.customer_name,
+               o.project,
+               od.building_number,
+               od.processing_note,
+               od.width,
+               od.height,
+               ogd.glass_child,
                e.type_name,
-               b.remarks,
-               c.project,
-                a.child_width,
-               a.child_height,
-               sum(b.quantity) as quantity,
-               a.glass_child,
-               b.processing_note
-        from sd.order_glass_detail as a
-                 left join sd.order_detail as b
-                           on a.order_id = b.order_id
-                               and a.order_number = b.order_number
-                 left join sd.`order` as c
-                           on c.order_id = a.order_id
-                 left join flow_card as d
-                           on d.order_id = a.order_id and d.order_number = a.order_number and
-                              d.technology_number = a.technology_number
-                 left join sd.basic_glass_type e
-                           on e.type_id = b.product_id
-        where d.process_id = #{processId}
-          and d.technology_number = #{technologyNumber}
-        group by a.glass_child, a.child_width, a.child_height
-        order by d.technology_number
+               opd.stock_id,
+               od.quantity
+        from pp.optimize_detail opd
+                 left join sd.`order` o on SUBSTR(opd.process_id,1,10)=o.order_id
+                 left join sd.order_detail od on SUBSTR(opd.process_id,1,10)=od.order_id and opd.order_sort=od.order_number
+                 left join sd.order_glass_detail ogd on SUBSTR(opd.process_id,1,10)=ogd.order_id and opd.order_sort=ogd.order_number
+                 left join sd.product p  on od.product_id = p.id
+                 left join sd.basic_glass_type e  on e.type_id = p.type_id
+        where opd.project_no=#{projectNo} order by opd.stock_id
     </select>
 
     <select id="printFlowCardDetailsMp">
@@ -605,35 +603,49 @@
         <result column="delivery_address" property="order.deliveryAddress"/>
         <result column="processing_note" property="processingNote"/>
         <result column="quantity" property="quantity"/>
+        <result column="edging_type" property="edgingType"/>
+        <result column="product_name" property="productName"/>
+        <result column="building_number" property="buildingNumber"/>
     </resultMap>
 
-    <select id="getPrintCustomData" resultMap="orderDetial">
-        select o.order_id,
+    <select id="getPrintCustomData" >
+        select o.order_id as orderId,
                project,
-               customer_id,
-               customer_name,
-               order_type,
-               order_classify,
+               customer_id as customerId,
+               customer_name as customerName,
+               order_type as  orderType,
+               order_classify as orderClassify,
                batch,
-               icon,
-               pack_type,
-               delivery_date,
-               al_type,
+               o.icon,
+               pack_type as packType,
+               delivery_date as deliveryDate,
+               al_type as alType,
                money,
-               contract_id,
-               customer_batch,
+               contract_id as contractId,
+               customer_batch customerBatch,
                contacts,
-               delivery_address,
-               od.processing_note,
+               delivery_address as deliveryAddress,
+               od.processing_note as processingNote,
                width,
                height,
-               od.quantity
+               od.quantity,
+               od.order_number as orderNumber,
+               fc.technology_number as technologyNumber,
+               od.building_number as buildingNumber,
+               od.product_name as productName,
+               od.edging_type as edgingType
 
         from sd.order as o
                  left join sd.order_detail as od on o.order_id = od.order_id
-        where o.order_id = #{orderId}
-          and od.order_number = #{orderNumber}
+        left join flow_card as fc on o.order_id = fc.order_id and
+                                                    od.order_number = fc.order_number
+        where fc.process_id = #{processId}
+        and fc.technology_number=#{technologyNumber}
+        group by od.order_number,width,height
+        order by IF(fc.sort!=NULL||fc.sort!='',fc.sort,fc.order_number)
+    </select>
 
+    <select id="getPrintLabelCount">
 
     </select>
 

--
Gitblit v1.8.0