From 68fc3103051bb50a33a03fa26ba4ca1a64457707 Mon Sep 17 00:00:00 2001 From: wangshilong Date: Mon, 25 Nov 2024 22:44:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E5=B7=9D=E5=8F=8C=E6=99=9F=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/iot/modbus_rtcp/jobs/AutoCollectJobs.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/iot/modbus_rtcp/jobs/AutoCollectJobs.java b/src/main/java/com/iot/modbus_rtcp/jobs/AutoCollectJobs.java index 7d298f1..c6cb129 100644 --- a/src/main/java/com/iot/modbus_rtcp/jobs/AutoCollectJobs.java +++ b/src/main/java/com/iot/modbus_rtcp/jobs/AutoCollectJobs.java @@ -29,9 +29,9 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class AutoCollectJobs { - private static final String SQL = "SELECT id as commandId, ref_id as deviceId, command, " + - "message_length messageLength, '4B454E454E4731343030303030333538' as identifier FROM commands " + - "WHERE type = 'COLLECTION' and ref_type = 'DEVICE' and id < 10099 order by id"; + private static final String SQL = "SELECT c.id AS commandId,c.ref_id AS deviceId,c.command, " + + "c.message_length messageLength,d.gateway_sn AS identifier FROM commands c JOIN device d " + + "ON c.ref_id = d.id WHERE c.type = 'COLLECTION' AND c.ref_type = 'DEVICE' ORDER BY c.id "; private final JdbcTemplate jdbcTemplate; private final ModbusTCPController controller;