【功能优化】Bpm:完善设备属性的历史值

This commit is contained in:
YunaiV
2025-01-28 12:04:59 +08:00
parent dfa03d24fd
commit 0b16f1678c
14 changed files with 103 additions and 162 deletions

View File

@@ -66,11 +66,12 @@
DESCRIBE product_property_${productKey}
</select>
<!-- TODO 芋艿:缺少时间范围 AND ts BETWEEN #{reqVO.startTime} AND #{reqVO.endTime} -->
<select id="selectPageByHistory" resultType="cn.iocoder.yudao.module.iot.controller.admin.device.vo.data.IotDevicePropertyRespVO">
SELECT ${reqVO.identifier} AS `value`, report_time AS update_time
FROM device_property_${reqVO.deviceKey}
SELECT ${reqVO.identifier} AS `value`, ts AS update_time
FROM device_property_${reqVO.deviceKey}1
WHERE ${reqVO.identifier} IS NOT NULL
AND ts BETWEEN ${@cn.hutool.core.date.LocalDateTimeUtil@toEpochMilli(reqVO.times[0])}
AND ${@cn.hutool.core.date.LocalDateTimeUtil@toEpochMilli(reqVO.times[1])}
ORDER BY ts DESC
</select>