From 664d8b20e3e5b88f0acea8931f4b02eb2222a934 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期二, 23 十二月 2025 10:43:33 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml b/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
index 41130c5..86239e9 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
@@ -61,6 +61,8 @@
         <result column="batch" property="order.batch"/>
         <result column="order_quantity" property="order.quantity"/>
         <result column="calculate_type" property="order.calculateType"/>
+        <result column="customer_name" property="order.customerName"/>
+
 
         <result column="building_number" property="orderDetail.buildingNumber"/>
         <result column="width" property="orderDetail.width"/>
@@ -714,6 +716,7 @@
         od.height,
         o.creator,
         o.project,
+        o.customer_name,
         fc.order_number,
         od.quantity,
         fc.quantity as fc_quantity,
@@ -757,6 +760,9 @@
             <if test="flowCard.order != null and flowCard.order.project != null and flowCard.order.project != ''">
                 and o.project regexp #{flowCard.order.project}
             </if>
+            <if test="flowCard.order != null and flowCard.order.customerName != null and flowCard.order.customerName != ''">
+                and o.customer_name regexp #{flowCard.order.customerName}
+            </if>
             <if test="flowCard.orderNumber != null and flowCard.orderNumber != ''">
                 and fc.order_number regexp #{flowCard.orderNumber}
             </if>
@@ -785,10 +791,12 @@
     </select>
     <select id="getSelectWarehousingPageTotal" >
         select
-        CEILING(count(zu.order_number)/#{pageSize}) as 'pageTotal',
-        count(zu.order_number) as 'total' from (
-        select fc.order_number as order_number,fc.process_id from pp.flow_card fc left join sd.order_detail od on
-        fc.order_id=od.order_id and fc.order_number=od.order_number inner join sd.`order` o on o.order_id=fc.order_id
+        CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
+        count(zu.id) as 'total' from (
+        select fc.id as id
+        from (select *,min(inventory_quantity) as min_inventory_quantity from pp.flow_card  group by  order_id,order_number,process_id) as fc
+        left join sd.order_detail od on fc.order_id=od.order_id and fc.order_number=od.order_number inner join sd.`order` o on
+        o.order_id=fc.order_id
         <where>
             and fc.received_quantity <![CDATA[<]]> fc.inventory_quantity and o.create_order>0
             <if test="flowCard.order != null and flowCard.order.orderId != null and flowCard.order.orderId != ''">
@@ -815,6 +823,9 @@
             <if test="flowCard.order != null and flowCard.order.project != null and flowCard.order.project != ''">
                 and o.project regexp #{flowCard.order.project}
             </if>
+            <if test="flowCard.order != null and flowCard.order.customerName != null and flowCard.order.customerName != ''">
+                and o.customer_name regexp #{flowCard.order.customerName}
+            </if>
             <if test="flowCard.orderNumber != null and flowCard.orderNumber != ''">
                 and fc.order_number regexp #{flowCard.orderNumber}
             </if>

--
Gitblit v1.8.0