【功能修复】IoT:解决物模型的 identifier 存在驼峰情况下,无法插入和查询的情况

This commit is contained in:
YunaiV
2025-01-28 23:16:30 +08:00
parent 76ab64a255
commit f14cc470aa
2 changed files with 5 additions and 5 deletions

View File

@@ -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