From ba714cd764bb95cb00c57e93017905c5a03e4079 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期四, 30 十月 2025 12:12:14 +0800
Subject: [PATCH] 1、 二号线禁用时且一拖二情况下优化

---
 hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml
index 44c5106..6cc8288 100644
--- a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml
+++ b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/OptimizeProjectMapper.xml
@@ -72,14 +72,16 @@
         p.glass_thickness,
         p.glass_type,
         p.glass_total,
-        p.glass_total_area
+        p.glass_total_area,
+        IFNULL(e.state,0) as state
         from north_glass_mes.engineer_scheduling es
         left join pp.optimize_project p on es.project_no=p.project_no
+        left join north_glass_mes.engineering e on es.project_no=e.engineer_id
         where es.state = 100
         <if test="type != null and type != ''">
             and es.type = #{type}
         </if>
-        order by es.id
+        order by case when IFNULL(e.state, 0) = 1 then 0 else 1 end, es.id
     </select>
 
     <!-- 鏍规嵁绫诲瀷鍒犻櫎engineer_scheduling琛ㄤ腑鐨勬暟鎹� -->

--
Gitblit v1.8.0