From ccc9d4533bc7b696f6d539720a6052abc44ff7a5 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期日, 11 十月 2026 23:46:17 +0800
Subject: [PATCH] fix: 添加设备名称字段并修复多个查询的排序和分组问题

---
 src/main/resources/mapper/production/ProductWorkOrderMapper.xml |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/production/ProductWorkOrderMapper.xml b/src/main/resources/mapper/production/ProductWorkOrderMapper.xml
index 6e7e06c..b06b827 100644
--- a/src/main/resources/mapper/production/ProductWorkOrderMapper.xml
+++ b/src/main/resources/mapper/production/ProductWorkOrderMapper.xml
@@ -48,6 +48,8 @@
             <if test="c.productOrderId != null and c.productOrderId != ''">
                and pwo.product_order_id = #{c.productOrderId}
             </if>
+        <!-- 2026-10-12 闇�姹傦細鐢熶骇妯″潡鎸夋椂闂村�掑簭锛屾渶鏂扮殑鎺掑湪鍓嶉潰 -->
+        order by pwo.create_time desc, pwo.id desc
     </select>
     <select id="getProductWorkOrderFlowCard" resultType="com.ruoyi.production.dto.ProductWorkOrderDto">
         SELECT
@@ -76,4 +78,23 @@
                 p.product_name,
                 po.nps_no
     </select>
+    <select id="selectWorkOrderStartStats" resultType="com.ruoyi.production.dto.ProductWorkOrderDto">
+        SELECT
+            id,
+            actual_start_time AS planStartTime,
+            plan_quantity
+        FROM
+            product_work_order
+        WHERE
+            actual_start_time &gt;= #{startDate}
+            AND actual_start_time &lt;= #{endDate}
+    </select>
+    <select id="selectMax" resultType="com.ruoyi.production.pojo.ProductWorkOrder">
+        SELECT SUBSTRING(work_order_no, 3) as work_order_no
+        FROM product_work_order
+        WHERE SUBSTRING(work_order_no, 3) like concat(#{datePrefix},'%')
+        order by work_order_no  desc
+        limit 1
+        ;
+    </select>
 </mapper>

--
Gitblit v1.9.3