ShiShiYiBan/yudao-module-iot/yudao-module-iot-biz/src/main/resources/mapper/tdengine/TdThinkModelMessageMapper.xml

33 lines
976 B
XML
Raw Normal View History

2024-12-19 16:43:56 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.iot.dal.tdengine.TdThingModelMessageMapper">
2024-12-19 16:43:56 +08:00
<!-- 创建物模型消息日志超级表 -->
<update id="createSuperTable">
2024-12-30 22:46:24 +08:00
CREATE STABLE thing_model_message_${superTableName}(
ts TIMESTAMP,
2024-12-30 22:46:24 +08:00
id NCHAR(64),
sys NCHAR(2048),
method NCHAR(255),
params NCHAR(2048)
2024-12-19 16:43:56 +08:00
)TAGS (
2024-12-30 22:46:24 +08:00
device_key NCHAR(50)
2024-12-19 16:43:56 +08:00
)
</update>
<!-- 创建物模型消息日志子表带有deviceKey的TAG -->
<update id="createTableWithTag">
2024-12-30 22:46:24 +08:00
CREATE STABLE ${tableName}
USING thing_model_message_${superTableName}(
2024-12-19 16:43:56 +08:00
ts,
id ,
sys ,
method ,
params
)TAGS(
#{device_key}
2024-12-19 16:43:56 +08:00
)
</update>
</mapper>