|
@@ -51,7 +51,7 @@
|
|
|
TAGS ('${device.deviceKey}')
|
|
|
(ts, report_time,
|
|
|
<foreach item="key" collection="properties.keys" separator=",">
|
|
|
- ${key}
|
|
|
+ ${@cn.hutool.core.util.StrUtil@toUnderlineCase(key)}
|
|
|
</foreach>
|
|
|
)
|
|
|
VALUES
|
|
@@ -67,9 +67,9 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPageByHistory" resultType="cn.iocoder.yudao.module.iot.controller.admin.device.vo.data.IotDevicePropertyRespVO">
|
|
|
- SELECT ${reqVO.identifier} AS `value`, ts AS update_time
|
|
|
- FROM device_property_${reqVO.deviceKey}1
|
|
|
- WHERE ${reqVO.identifier} IS NOT NULL
|
|
|
+ SELECT ${@cn.hutool.core.util.StrUtil@toUnderlineCase(reqVO.identifier)} AS `value`, ts AS update_time
|
|
|
+ FROM device_property_${reqVO.deviceKey}
|
|
|
+ WHERE ${@cn.hutool.core.util.StrUtil@toUnderlineCase(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
|