Files
intc-cloud/intc-modules/intc-tdengine/src/main/resources/mapper/tdengine/DataDemoMapper.xml
2025-04-24 17:17:51 +08:00

22 lines
1019 B
XML

<?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="com.intc.tdengine.mapper.DataDemoMapper">
<insert id="createTableT" parameterType="RealTimeDataT">
create table if not exists
pg_d.t${tagId}
USING pg_d.pg_monitor_data(buildingId,valueType,tagId,deviceId,tagShowType,tagTypeId)
TAGS (#{buildingId}, #{valueType}, #{tagId}, #{deviceId}, #{tagShowType}, #{tagTypeId})
</insert>
<insert id="insertRealTimeDataT" parameterType="RealTimeDataT">
insert into pg_d.t${tagId} VALUES (#{dataTime},NOW, #{val});
</insert>
<update id="createSuperTable">
create table if not exists
pg_d.pg_monitor_data(time timestamp,createTime timestamp, val nchar(100))
tags(buildingId nchar(100),valueType nchar(10), tagId nchar(100),deviceId nchar(100),tagShowType nchar(50),tagTypeId nchar(100))
</update>
</mapper>