From b8202fa27280e1fc0ff962c874e94e625abeb7b8 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 03 七月 2025 16:22:57 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml |   71 +++++++++++++++++++++++++++++------
 1 files changed, 59 insertions(+), 12 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
index 12ecb95..4322a81 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -102,9 +102,10 @@
     </update>
     
     <select id="getOrderList">
-        select
-            *,
-        ifnull(sum(fgi.quantity_available),0) as goodsQuantity
+       select * from (select
+            o.*,
+        ifnull(sum(fgi.quantity_available),0) as goodsQuantity,
+        if(DATEDIFF(o.delivery_date, CURDATE()) &lt; 3  and o.delivery &lt; 2, 'timeOut','' ) as timeOut
         from
             sd.`order` as o
         left join mm.finished_goods_inventory as  fgi
@@ -196,17 +197,17 @@
             and o.processing_note REGEXP #{order.processingNote}
         </if>
         group by o.id
+        ) as acc
         order by
-            <if test="orderBy == 'null' or orderBy == null">
-                o.id desc
-            </if>
-        <if test="!(orderBy == 'null' or orderBy == null) and orderBy == 'desc'">
-            #{field} desc
+        <if test="orderBy == null ">
+            order_id desc
         </if>
-        <if test="!(orderBy == 'null' or orderBy == null) and orderBy == 'asc'">
-            #{field} asc
+        <if test="orderBy == 'desc'">
+            ${field} desc
         </if>
-
+        <if test="orderBy == 'asc'">
+            ${field}
+        </if>
         limit #{offset},#{pageSize}
     </select>
 
@@ -217,7 +218,7 @@
             sum(o.quantity) as quantity,
             sum(o.area) as area,
             sum(o.money) as money,
-            fgi.goodsQuantity,
+            ifnull(fgi.goodsQuantity ,0) as goodsQuantity ,
             ROUND(sum(perimeter),2) as perimeter,
             #{pageSize} as pageSize
         from
@@ -330,6 +331,13 @@
         where order_id = #{id}
     </update>
 
+    <update id="backReviewOrderById">
+        update `order` set order_review = 0,
+                           verifier_id = null,
+                           verifier = null
+        where order_id = #{id}
+    </update>
+
     <update id="reviewProcessById">
         update `order` set process_review = #{status} where order_id = #{id}
     </update>
@@ -368,4 +376,43 @@
     having count(a.order_number) > 1
     </select>
 
+    <select id="searchOrderWarehousing">
+        select  warehousing from `order`
+        where order_id = #{orderId}
+    </select>
+
+    <select id="getProcessIdByOptimizeHeatDetail">
+        select  process_id from pp.optimize_heat_detail as a
+        where a.project_no = #{projectId}
+          and a.layout_id = #{layoutId}
+          and a.sort = #{sort}
+    </select>
+
+    <select id="scannerGlassInfo">
+        select c.order_id as orderId,
+               b.order_number as orderNumber,
+               b.technology_number as technologyNumber,
+               a.process_id as processId,
+               c.customer_name as customerName,
+               concat(a.width," * " , a.height) as size,
+               b.area,
+               b.glass_child as glassChild,
+               d.product_name as productName,
+               d.building_number as buildingNumber,
+               d.remarks as remarks,
+               d.processing_note as processingNote
+        from pp.optimize_heat_detail as a
+        left join sd.order_glass_detail as b
+            on b.order_number = a.order_sort
+            and b.technology_number = a. layer
+            and b.order_id = #{orderId}
+        left join  sd.order as c
+            on c.order_id = b.order_id
+        left join sd.order_detail as d
+            on c.order_id = d.order_id
+            and d.order_number = a.order_sort
+        where a.project_no = #{projectNo}
+        and a.layout_id = #{layoutId}
+        and a.sort = #{sort}
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0