From 80e22bcc7af8aebed7443965655542fbe4966708 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期三, 09 四月 2025 15:11:55 +0800
Subject: [PATCH] 灌溉计划删除,所有命令发布都失败依然允许终止

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateGroupMapper.xml |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateGroupMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateGroupMapper.xml
index 1eb144e..ddf5206 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateGroupMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateGroupMapper.xml
@@ -304,4 +304,20 @@
       ) irrigateGroup
     GROUP BY groupCode,defaultDuration
   </select>
+
+  <select id="getGroupResult" resultType="com.dy.pipIrrGlobal.voIr.VoGroupResult">
+    SELECT
+        grp.id AS groupId,
+        grp.group_code AS groupCode,
+        IF(NOW() &lt; sche.start_time, 2,
+        IF(NOW() > sche.start_time AND NOW() &lt; DATE_ADD(sche.start_time, INTERVAL sche.duration MINUTE), 3, 4)) AS state,
+        sche.start_time AS startTime,
+        DATE_ADD(sche.start_time, INTERVAL sche.duration MINUTE) AS stopTime,
+        sche.duration,
+        NULL AS publishResult
+    FROM ir_irrigate_group  grp
+        INNER JOIN ir_irrigate_schedule sche ON sche.group_id = grp.id
+        INNER JOIN ir_plan_schedule ps ON ps.schedule_id = sche.id
+    WHERE ps.plan_id = #{planId};
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0