[功能添加]:物模型日志表创建

This commit is contained in:
alwayssuper
2024-12-31 17:00:25 +08:00
parent 9c3aa5d95f
commit eaee4642d6
8 changed files with 62 additions and 66 deletions

View File

@@ -42,7 +42,7 @@
<!-- 根据标签获取最新数据 -->
<select id="selectLastDataListByTags" parameterType="cn.iocoder.yudao.module.iot.dal.dataobject.tdengine.TagsSelectDO"
resultType="Map">
resultType="java.util.Map">
SELECT LAST(*)
FROM ${dataBaseName}.${stableName}
GROUP BY ${tagsName}

View File

@@ -6,12 +6,13 @@
<!-- 创建物模型消息日志超级表 -->
<update id="createSuperTable">
CREATE STABLE thing_model_message_${superTableName}(
CREATE STABLE thing_model_message_${productKey}(
ts TIMESTAMP,
id NCHAR(64),
sys NCHAR(2048),
method NCHAR(255),
params NCHAR(2048)
params NCHAR(2048),
device_name NCHAR(64)
)TAGS (
device_key NCHAR(50)
)
@@ -19,13 +20,14 @@
<!-- 创建物模型消息日志子表带有deviceKey的TAG -->
<update id="createTableWithTag">
CREATE STABLE ${tableName}
USING thing_model_message_${superTableName}(
CREATE STABLE ${deviceKey}
USING thing_model_message_${productKey}(
ts,
id ,
sys ,
method ,
params
params ,
device_name
)TAGS(
#{device_key}
)