虫情设备实时数据接口

This commit is contained in:
zhumeixiao
2024-11-27 14:47:08 +08:00
parent 646c8f0fc5
commit 5a83a183dd
9 changed files with 95 additions and 41 deletions

View File

@ -158,4 +158,13 @@
#{id}
</foreach>
</delete>
<select id="getWormsRealtimedata" resultType="DeviceRealtimedataWorms">
SELECT t1.*
FROM iot_device_realtimedata_worms t1
JOIN (
SELECT device_addr, MAX(save_time) AS max_save_time
FROM iot_device_realtimedata_worms
GROUP BY device_addr
) t2 ON t1.device_addr = t2.device_addr AND t1.save_time = t2.max_save_time
</select>
</mapper>