From b44955171ff4416a9041fd6b674800bfc4d8ee16 Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期一, 18 八月 2025 11:41:20 +0800
Subject: [PATCH] 安灯处理 ,安灯已处理列表,安灯数据模型 增加字段,安灯发起:新增发起人

---
 src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml |  125 +++++++++++++++++++++++++++++++----------
 1 files changed, 93 insertions(+), 32 deletions(-)

diff --git a/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml
index fa2b139..0475bda 100644
--- a/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml
+++ b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml
@@ -27,6 +27,7 @@
         on arc.button_id = abc.id
         where arc.factory_id=#{factoryId};
     </select>
+
     <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">
         select arc.id,
                abc.id          as buttonId,
@@ -68,37 +69,6 @@
                  and ao.factory_id = arc.factory_id
                  and ao.order_status = '1') = 1
     </select>
-<!--    <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">-->
-<!--        select arc.id,-->
-<!--               abc.id          as buttonId,-->
-<!--               abc.button_name as buttonName,-->
-<!--               abc.button_code as buttonCode,-->
-<!--               (select count(1)-->
-<!--                from andon_order ao-->
-<!--                where ao.button_id = arc.button_id-->
-<!--                  and ao.factory_id = arc.factory_id-->
-<!--                  and ao.order_status != '3') as blinkingFlag, STUFF((SELECT ',' + CAST (ao.id AS VARCHAR)-->
-<!--            FROM andon_order ao-->
-<!--            WHERE ao.button_id = arc.button_id-->
-<!--            and ao.factory_id = arc.factory_id-->
-<!--            FOR XML PATH ('')), 1, 1, '') as orderIds, bf.factory_name as factoryName, parent_bf.factory_name as parentFactoryName, abc.upgrade_response_duration as upgradeResponseDuration, abc.second_upgrade_response_duration as secondUpgradeResponseDuration, arc.firster_responder as responder, arc.second_responder, arc.third_responder, STUFF((SELECT ',' + ao.order_status-->
-<!--            FROM andon_order ao-->
-<!--            WHERE ao.button_id = arc.button_id-->
-<!--            and ao.factory_id = arc.factory_id-->
-<!--            and ao.order_status != '3'-->
-<!--            FOR XML PATH ('')), 1, 1, '') as orderStatus-->
-<!--        from andon_response_config arc-->
-<!--            left join andon_button_config abc-->
-<!--        on arc.button_id = abc.id-->
-<!--            left join base_factory bf on arc.factory_id = bf.id-->
-<!--            left join base_factory parent_bf on bf.parent_id = parent_bf.id-->
-<!--        where arc.factory_id=#{factoryId}-->
-<!--          and (select count (1)-->
-<!--            from andon_order ao-->
-<!--            where ao.button_id = arc.button_id-->
-<!--          and ao.factory_id = arc.factory_id-->
-<!--          and ao.order_status != '3') = 1-->
-<!--    </select>-->
 
     <select id="queryUserAndonRespondList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">
         select arc.id,
@@ -128,7 +98,12 @@
                       WHERE ao.button_id = arc.button_id
                         and ao.factory_id = arc.factory_id
                         and ao.order_status = '2'
-                   FOR XML PATH ('')), 1, 1, '')    as orderStatus
+                   FOR XML PATH ('')), 1, 1, '')    as orderStatus,
+               (SELECT TOP 1 ao.operator
+                FROM andon_order ao
+                WHERE ao.button_id = arc.button_id
+                  and ao.factory_id = arc.factory_id
+                  and ao.order_status = '2')         as operator
         from andon_response_config arc
                  left join andon_button_config abc
                            on arc.button_id = abc.id
@@ -141,4 +116,90 @@
                  and ao.factory_id = arc.factory_id
                  and ao.order_status = '2') = 1
     </select>
+<!--    <select id="queryUserAndonRespondList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">-->
+<!--        select arc.id,-->
+<!--               abc.id                               as buttonId,-->
+<!--               abc.button_name                      as buttonName,-->
+<!--               abc.button_code                      as buttonCode,-->
+<!--               (select count(1)-->
+<!--                from andon_order ao-->
+<!--                where ao.button_id = arc.button_id-->
+<!--                  and ao.factory_id = arc.factory_id-->
+<!--                  and ao.order_status = '2')        as blinkingFlag,-->
+<!--               STUFF((SELECT ',' + CAST(ao.id AS VARCHAR)-->
+<!--                      FROM andon_order ao-->
+<!--                      WHERE ao.button_id = arc.button_id-->
+<!--                        and ao.factory_id = arc.factory_id-->
+<!--                        and ao.order_status = '2'-->
+<!--                   FOR XML PATH ('')), 1, 1, '')    as orderIds,-->
+<!--               bf.factory_name                      as factoryName,-->
+<!--               parent_bf.factory_name               as parentFactoryName,-->
+<!--               abc.upgrade_response_duration        as upgradeResponseDuration,-->
+<!--               abc.second_upgrade_response_duration as secondUpgradeResponseDuration,-->
+<!--               arc.firster_responder                as responder,-->
+<!--               arc.second_responder,-->
+<!--               arc.third_responder,-->
+<!--               STUFF((SELECT ',' + ao.order_status-->
+<!--                      FROM andon_order ao-->
+<!--                      WHERE ao.button_id = arc.button_id-->
+<!--                        and ao.factory_id = arc.factory_id-->
+<!--                        and ao.order_status = '2'-->
+<!--                   FOR XML PATH ('')), 1, 1, '')    as orderStatus-->
+<!--        from andon_response_config arc-->
+<!--                 left join andon_button_config abc-->
+<!--                           on arc.button_id = abc.id-->
+<!--                 left join base_factory bf on arc.factory_id = bf.id-->
+<!--                 left join base_factory parent_bf on bf.parent_id = parent_bf.id-->
+<!--        where arc.factory_id = #{factoryId}-->
+<!--          and (select count(1)-->
+<!--               from andon_order ao-->
+<!--               where ao.button_id = arc.button_id-->
+<!--                 and ao.factory_id = arc.factory_id-->
+<!--                 and ao.order_status = '2') = 1-->
+<!--    </select>-->
+
+
+    <select id="queryUserAndonHandelList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">
+        select arc.id,
+               abc.id                               as buttonId,
+               abc.button_name                      as buttonName,
+               abc.button_code                      as buttonCode,
+               (select count(1)
+                from andon_order ao
+                where ao.button_id = arc.button_id
+                  and ao.factory_id = arc.factory_id
+                  and ao.order_status = '3')        as blinkingFlag,
+               STUFF((SELECT ',' + CAST(ao.id AS VARCHAR)
+                      FROM andon_order ao
+                      WHERE ao.button_id = arc.button_id
+                        and ao.factory_id = arc.factory_id
+                        and ao.order_status = '3'
+                   FOR XML PATH ('')), 1, 1, '')    as orderIds,
+               bf.factory_name                      as factoryName,
+               parent_bf.factory_name               as parentFactoryName,
+               abc.upgrade_response_duration        as upgradeResponseDuration,
+               abc.second_upgrade_response_duration as secondUpgradeResponseDuration,
+               arc.firster_responder                as responder,
+               arc.second_responder,
+               arc.third_responder,
+               STUFF((SELECT ',' + ao.order_status
+                      FROM andon_order ao
+                      WHERE ao.button_id = arc.button_id
+                        and ao.factory_id = arc.factory_id
+                        and ao.order_status = '3'
+                   FOR XML PATH ('')), 1, 1, '')    as orderStatus
+        from andon_response_config arc
+                 left join andon_button_config abc
+                           on arc.button_id = abc.id
+                 left join base_factory bf on arc.factory_id = bf.id
+                 left join base_factory parent_bf on bf.parent_id = parent_bf.id
+        where arc.factory_id = #{factoryId}
+          and (select count(1)
+               from andon_order ao
+               where ao.button_id = arc.button_id
+                 and ao.factory_id = arc.factory_id
+                 and ao.order_status = '3') = 1
+    </select>
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3