From 13e53d2f872a2ad3f119434bd1bc4946a141e224 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期四, 12 九月 2024 14:48:33 +0800 Subject: [PATCH] MDK --- iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 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 c716368..1df8e81 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 @@ -260,7 +260,8 @@ `field_name` VARCHAR(30) COMMENT '中文名' , `field_type` VARCHAR(30) COMMENT '数据类型' , `sort` int COMMENT '排序', - PRIMARY KEY (id) USING BTREE + PRIMARY KEY (id) USING BTREE, + INDEX `idx_data_set_id` (`data_set_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '指标数据集字段'; CREATE TABLE t_ind_item_category( @@ -281,9 +282,10 @@ `item_name` VARCHAR(36) COMMENT '指标名称' , `item_type` VARCHAR(20) COMMENT '指标类型' , `item_category` VARCHAR(20) COMMENT '指标分类' , - `coefficient` decimal(10, 4) COMMENT '系数', + `coefficient` decimal(10, 4) COMMENT '转换系数', `precision` int COMMENT '指标精度', `time_granularity` VARCHAR(10) COMMENT '时间粒度' , + `unit` VARCHAR(10) COMMENT '数量单位' , `remark` VARCHAR(255) COMMENT '备注' , `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)', `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者', @@ -291,7 +293,7 @@ `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (id) USING BTREE, - UNIQUE KEY `uk_item_no` (`item_no`) USING BTREE + UNIQUE INDEX `uk_item_no` (`item_no`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '指标项表'; CREATE TABLE t_ind_item_atom( @@ -324,12 +326,13 @@ `expression` varchar(100) DEFAULT NULL COMMENT '计算表达式', PRIMARY KEY (id) USING BTREE, UNIQUE KEY `uk_item_id` (`item_id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '计算指标'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '复合指标'; + CREATE TABLE `t_ind_item_value` ( `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'id', `item_no` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '指标编码', - `data_time` varchar(36) DEFAULT NULL COMMENT '数据时间', + `data_time` varchar(20) DEFAULT NULL COMMENT '数据时间', `data_value` decimal(24,6) DEFAULT NULL COMMENT '数据值', PRIMARY KEY (`id`) USING BTREE, KEY `idx_item_no` (`item_no`) USING BTREE, -- Gitblit v1.9.3