From e8ad669f7c97d45cd23630dc101180a130d6c17e Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期二, 05 十一月 2024 10:04:57 +0800
Subject: [PATCH] tag当前值开发

---
 iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql |   53 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql b/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
index 89bbaa5..f6e6d3c 100644
--- a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
+++ b/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
@@ -159,7 +159,8 @@
                                  `source_type` VARCHAR(10)   COMMENT '数据源类型',
                                  `source_id` VARCHAR(36)   COMMENT '数据源ID',
                                  `tag_no` VARCHAR(64)   COMMENT '测点Tag',
-                                 `dimension` INT   COMMENT '尺度' ,
+                                 `dimension` INT   COMMENT '平滑尺度(min)' ,
+                                 `value_type` VARCHAR(36)   COMMENT '值类型(数字量,模拟量)',
                                  PRIMARY KEY (id) USING BTREE,
                                  UNIQUE KEY `uk_point_id` (`point_id`) USING BTREE,
                                  KEY `uk_tag_no` (`tag_no`) USING BTREE
@@ -196,14 +197,15 @@
 INSERT INTO `t_da_sequence_num` (`id`, `code`, `name`, `sequence_num`, `prefix`) VALUES ('2', 'POINT_C', '计算点编码', 100000, 'C');
 
 CREATE TABLE `t_http_api`  (
-                             `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'ID',
-                             `code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
-                             `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
-                             `url` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'URL',
-                             `method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求方法',
-                             `param` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '参数',
-                             `descp` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
-                             `status` int NULL DEFAULT NULL COMMENT '状态',
+                             `id` varchar(36) NOT NULL COMMENT 'ID',
+                             `code` varchar(32) NOT NULL COMMENT '编码',
+                             `name` varchar(32) NOT NULL COMMENT '名称',
+                             `url` varchar(100) NOT NULL COMMENT 'URL',
+                             `method` varchar(10) NULL DEFAULT NULL COMMENT '请求方法',
+                             `param` varchar(200) NULL DEFAULT NULL COMMENT '参数',
+                             `descp` varchar(100) NULL DEFAULT NULL COMMENT '描述',
+                             `is_auth` tinyint(1) NOT NULL COMMENT '是否认证',
+                             `auth_url` varchar(36) NULL DEFAULT NULL COMMENT '认证地址',
                              `creator` VARCHAR(64)   COMMENT '创建人' ,
                              `create_time` DATETIME   COMMENT '创建时间' ,
                              `updater` VARCHAR(64)   COMMENT '修改人' ,
@@ -212,31 +214,32 @@
                              UNIQUE KEY `uk_code` (`code`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = 'Api接口' ROW_FORMAT = DYNAMIC;
 
-
 CREATE TABLE `t_http_token` (
-                              `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
-                              `api_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
-                              `login_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
-                              `client_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
-                              `client_secret` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
-                              `username` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
-                              `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
-                              `token` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'token',
+                              `id` varchar(36)  NOT NULL COMMENT 'ID',
+                              `login_url` varchar(200) DEFAULT NULL COMMENT '登录地址',
+                              `client_id` varchar(100) DEFAULT NULL COMMENT 'ClientId',
+                              `client_secret` varchar(100) DEFAULT NULL COMMENT 'ClientSecret',
+                              `username` varchar(50) DEFAULT NULL COMMENT '用户名',
+                              `password` varchar(50) DEFAULT NULL COMMENT '密码',
+                              `refresh_freq` varchar(10) DEFAULT NULL COMMENT '刷新频率',
+                              `token` varchar(2000) DEFAULT NULL COMMENT 'token',
                               `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
                               `update_time` datetime DEFAULT NULL COMMENT '更新时间',
                               PRIMARY KEY (`id`) USING BTREE,
-                              UNIQUE KEY `uk_api_id` (`api_id`) USING BTREE
+                              UNIQUE KEY `uk_login_url` (`login_url`) USING BTREE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='接口Token';
 
 CREATE TABLE `t_http_tag` (
-                            `id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '查询号',
-                            `http_api_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'HTTP 接口代码',
-                            `tag_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '测点编码',
-                            `tag_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '测点名称',
+                            `id` varchar(36) NOT NULL COMMENT 'ID',
+                            `api_id` varchar(36) NOT NULL COMMENT '接口ID',
+                            `tag_name` varchar(64) NOT NULL COMMENT '标签名称',
+                            `data_type` varchar(16) NOT NULL COMMENT '数据类型',
+                            `enabled` tinyint(1) DEFAULT NULL COMMENT '是否启用',
+                            `tag_desc` varchar(64) DEFAULT NULL COMMENT '描述',
                             `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                             `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                             PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='接口Tag表';
+) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT='接口Tag表';
 
 -- 指标管理------------
 CREATE TABLE t_ind_data_set(
@@ -281,7 +284,7 @@
                            `item_no` VARCHAR(36)   COMMENT '指标编码' ,
                            `item_name` VARCHAR(36)   COMMENT '指标名称' ,
                            `item_type` VARCHAR(20)   COMMENT '指标类型' ,
-                           `item_category` VARCHAR(20)   COMMENT '指标分类' ,
+                           `item_category` VARCHAR(36)   COMMENT '指标分类' ,
                            `coefficient` decimal(10, 4) COMMENT '转换系数',
                            `precision` int COMMENT '指标精度',
                            `time_granularity` VARCHAR(10)   COMMENT '时间粒度' ,

--
Gitblit v1.9.3