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

33 lines
1009 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">
CREATE STABLE ${dataBaseName}.${superTableName}(
ts TIMESTAMP,
id VARCHAR(255),
sys VARCHAR(2048),
method VARCHAR(255),
params VARCHAR(2048)
2024-12-19 16:43:56 +08:00
)TAGS (
device_key VARCHAR(255)
2024-12-19 16:43:56 +08:00
)
</update>
<!-- 创建物模型消息日志子表带有deviceKey的TAG -->
<update id="createTableWithTag">
CREATE TABLE IF NOT EXISTS ${dataBaseName}.${tableName}
USING ${dataBaseName}.${superTableName}(
ts,
id ,
sys ,
method ,
params
)TAGS(
#{device_key}
2024-12-19 16:43:56 +08:00
)
</update>
</mapper>