From 43d86830f4696c3ba2250a961d26377e1ff6cc32 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期三, 17 十二月 2025 10:39:43 +0800
Subject: [PATCH] 1、 查询是否除膜优化

---
 hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassQueueInfoMapper.xml |   43 ++++++++++++++++++++++++++++---------------
 1 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassQueueInfoMapper.xml b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassQueueInfoMapper.xml
index 71bb293..008730c 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassQueueInfoMapper.xml
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassQueueInfoMapper.xml
@@ -4,21 +4,34 @@
 
     <select id="queryNeedInCarGlass" resultType="java.lang.String">
         WITH queue_temp AS (
-            SELECT slot,
-                   glass_id,
-                   LEAST(width, height)                                             AS height,
-                   relation_id,
-                   ROW_NUMBER() OVER ( PARTITION BY cell ORDER BY hollow_sequence ) AS rn
-            FROM `hollow_glass_queue_info`
-            WHERE state = - 1
+        SELECT
+        slot,
+        glass_id,
+        LEAST( width, height ) AS height,
+        relation_id,
+        is_pair,
+        ROW_NUMBER() OVER ( PARTITION BY cell ORDER BY hollow_sequence ) AS rn
+        FROM
+        hollow_glass_queue_info
+        WHERE
+        state = - 1
         ),
-             glass_id_temp AS (SELECT * FROM queue_temp WHERE rn = 1),
-             task_temp AS (SELECT *
-                           FROM glass_id_temp t
-                                    INNER JOIN hollow_glass_out_relation_info t1 ON t.relation_id = t1.id
-                           WHERE t1.state = 1)
-        SELECT glass_id
-        FROM task_temp
-        WHERE height > 2500
+        task_temp AS (
+        SELECT
+        t.*
+        FROM
+        queue_temp t
+        INNER JOIN hollow_glass_out_relation_info t1 ON t.relation_id = t1.id
+        WHERE
+        t1.state = 1
+        and t.slot BETWEEN 500 and 900
+        AND (
+        t.is_pair = 1
+        OR ( t.is_pair = 0 AND t1.is_force = 1 )) )SELECT
+        glass_id
+        FROM
+        task_temp
+        ORDER BY
+        rn
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0