From 9fd9cfa0ebe3c04555a2ca0d04818d4a7cc7db7f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 24 十二月 2024 08:45:56 +0800
Subject: [PATCH] #
---
zy-acs-manager/src/main/resources/mapper/manager/ActionMapper.xml | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/zy-acs-manager/src/main/resources/mapper/manager/ActionMapper.xml b/zy-acs-manager/src/main/resources/mapper/manager/ActionMapper.xml
index aa35574..fa68274 100644
--- a/zy-acs-manager/src/main/resources/mapper/manager/ActionMapper.xml
+++ b/zy-acs-manager/src/main/resources/mapper/manager/ActionMapper.xml
@@ -66,13 +66,12 @@
</select>
<select id="selectPrepareGroup" resultType="java.lang.String">
- SELECT
- group_id
- FROM man_action
- WHERE 1=1
- AND action_sts = (SELECT id FROM man_action_sts WHERE UUID = 'PREPARE')
- AND group_id IS NOT NULL
- GROUP BY group_id
+ SELECT ma.group_id
+ FROM man_action ma
+ JOIN man_action_sts mas ON ma.action_sts = mas.id
+ WHERE mas.UUID = 'PREPARE'
+ AND ma.group_id IS NOT NULL
+ GROUP BY ma.group_id
</select>
<select id="selectTaskIdsByGroupId" resultType="java.lang.Long">
@@ -96,4 +95,18 @@
ORDER BY ma.priority DESC
</select>
+ <select id="selectLatestOfGroup" resultType="com.zy.acs.manager.manager.entity.Action">
+ SELECT *
+ FROM man_action a
+ JOIN (
+ SELECT group_id, MAX(io_time) AS max_io_time
+ FROM man_action
+ WHERE agv_id = #{agvId} AND action_sts = #{actionSts}
+ GROUP BY group_id
+ ) b ON a.group_id = b.group_id AND a.io_time = b.max_io_time
+ WHERE a.agv_id = #{agvId}
+ AND a.action_sts = #{actionSts}
+ ORDER BY a.priority DESC
+ </select>
+
</mapper>
--
Gitblit v1.9.1