【优化功能】 优化 tdengine 操作数据库相关代码

This commit is contained in:
安浩浩
2024-11-08 23:07:37 +08:00
parent d7b8cf547f
commit e3dcea9cb3
51 changed files with 1262 additions and 1442 deletions

View File

@@ -0,0 +1,33 @@
<?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.TdEngineTableMapper">
<!-- 创建子表 -->
<update id="createTable">
CREATE TABLE IF NOT EXISTS ${dataBaseName}.${tableName}
USING ${dataBaseName}.${superTableName}
TAGS
<foreach item="item" collection="tags" separator=","
open="(" close=")">
#{item.fieldValue}
</foreach>
</update>
<!-- 创建子表,带有 TAGS -->
<update id="createTableWithTags">
CREATE TABLE IF NOT EXISTS ${dataBaseName}.${tableName}
USING ${dataBaseName}.${superTableName}
<foreach item="item" collection="tags" separator="," open="(" close=")">
#{item.fieldName}
</foreach>
TAGS
<foreach item="item" collection="tags" separator=","
open="(" close=")">
#{item.fieldValue}
</foreach>
</update>
</mapper>