Commit b339801963572c66be886079c222b7fbee5e7334

Authored by alwayssuper
1 parent a17d4bb2

fix:iot首页统计中存在的TDengine中的SQL特异性问题:在TDengine中,GROUP BY子句不能直接使用别名。在你的SQL中,你先使用TIME…

…TRUNCATE(ts, 1h) AS time定义了一个别名time,然后在GROUP BY time中使用了这个别名,这在TDengine中是不允许的。
yudao-module-iot/yudao-module-iot-biz/src/main/resources/mapper/device/IotDeviceMessageMapper.xml
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
103 AND ts <= #{endTime} 103 AND ts <= #{endTime}
104 </if> 104 </if>
105 </where> 105 </where>
106 - GROUP BY time 106 + GROUP BY TIMETRUNCATE(ts, 1h)
107 </select> 107 </select>
108 108
109 </mapper> 109 </mapper>
110 \ No newline at end of file 110 \ No newline at end of file