ref: v3变更,,根据网元上报动态建表kpi/cdr/ue

This commit is contained in:
TsMask
2025-09-16 19:40:00 +08:00
parent f8bc5b662e
commit 69738ae7f4
36 changed files with 259 additions and 478 deletions

View File

@@ -1,13 +0,0 @@
-- ----------------------------
-- Table structure for cdr_event_ims
-- ----------------------------
DROP TABLE IF EXISTS `cdr_event_ims`;
CREATE TABLE `cdr_event_ims` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_cdr_ims_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_IMS';

View File

@@ -1,13 +0,0 @@
-- ----------------------------
-- Table structure for cdr_event_sgwc
-- ----------------------------
DROP TABLE IF EXISTS `cdr_event_sgwc`;
CREATE TABLE `cdr_event_sgwc` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_cdr_sgwc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_SGWC';

View File

@@ -1,13 +0,0 @@
-- ----------------------------
-- Table structure for cdr_event_smf
-- ----------------------------
DROP TABLE IF EXISTS `cdr_event_smf`;
CREATE TABLE `cdr_event_smf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_cdr_smf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_SMF';

View File

@@ -1,13 +0,0 @@
-- ----------------------------
-- Table structure for cdr_event_smsc
-- ----------------------------
DROP TABLE IF EXISTS `cdr_event_smsc`;
CREATE TABLE `cdr_event_smsc` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`cdr_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_cdr_smsc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_SMSC';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_amf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_amf`;
CREATE TABLE `kpi_c_report_amf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_amf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_AMF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_ausf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_ausf`;
CREATE TABLE `kpi_c_report_ausf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_ausf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_AUSF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_cbc
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_cbc`;
CREATE TABLE `kpi_c_report_cbc` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_cbc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_CBC';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_hlr
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_hlr`;
CREATE TABLE `kpi_c_report_hlr` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_hlr_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_HLR';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_ims
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_ims`;
CREATE TABLE `kpi_c_report_ims` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_ims_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_IMS';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_mme
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_mme`;
CREATE TABLE `kpi_c_report_mme` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_mme_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_MME';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_mocngw
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_mocngw`;
CREATE TABLE `kpi_c_report_mocngw` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_mocngw_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_MOCNGW';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_nssf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_nssf`;
CREATE TABLE `kpi_c_report_nssf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_nssf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_NSSF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report`;
CREATE TABLE `kpi_c_report` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据记录基础表';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_smf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_smf`;
CREATE TABLE `kpi_c_report_smf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_smf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_SMF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_smsc
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_smsc`;
CREATE TABLE `kpi_c_report_smsc` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_smsc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_SMSC';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_udm
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_udm`;
CREATE TABLE `kpi_c_report_udm` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_udm_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_UDM';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_c_report_upf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_c_report_upf`;
CREATE TABLE `kpi_c_report_upf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpic_upf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_UPF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_amf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_amf`;
CREATE TABLE `kpi_report_amf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_amf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_AMF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_ausf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_ausf`;
CREATE TABLE `kpi_report_ausf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_ausf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_AUSF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_cbc
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_cbc`;
CREATE TABLE `kpi_report_cbc` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_cbc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_CBC';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_hlr
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_hlr`;
CREATE TABLE `kpi_report_hlr` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_hlr_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_HLR';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_ims
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_ims`;
CREATE TABLE `kpi_report_ims` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_ims_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_IMS';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_mme
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_mme`;
CREATE TABLE `kpi_report_mme` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_mme_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_MME';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_mocngw
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_mocngw`;
CREATE TABLE `kpi_report_mocngw` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_mocngw_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_MOCNGW';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_nssf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_nssf`;
CREATE TABLE `kpi_report_nssf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_nssf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_NSSF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_pcf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_pcf`;
CREATE TABLE `kpi_report_pcf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_pcf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_PCF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_smf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_smf`;
CREATE TABLE `kpi_report_smf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_smf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_SMF';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_smsc
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_smsc`;
CREATE TABLE `kpi_report_smsc` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_smsc_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_SMSC';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_udm
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_udm`;
CREATE TABLE `kpi_report_udm` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_udm_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_UDM';

View File

@@ -1,15 +0,0 @@
-- ----------------------------
-- Table structure for kpi_report_upf
-- ----------------------------
DROP TABLE IF EXISTS `kpi_report_upf`;
CREATE TABLE `kpi_report_upf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`created_time` bigint DEFAULT '0' COMMENT '创建时间',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`index` int NOT NULL COMMENT 'Index of the report',
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_kpi_upf_ne_at` (`ne_id` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_指标数据_UPF';

View File

@@ -1,16 +0,0 @@
--
-- Table structure for table `ue_event_amf`
--
DROP TABLE IF EXISTS `ue_event_amf`;
CREATE TABLE `ue_event_amf` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
`event_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '事件类型',
`event_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_ue_ne_type_at` (`ne_id` DESC,`event_type` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_类型_时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UE事件_AMF终端接入';
-- Dump completed on 2025-09-11 15:26:56

View File

@@ -1,16 +0,0 @@
--
-- Table structure for table `ue_event_mme`
--
DROP TABLE IF EXISTS `ue_event_mme`;
CREATE TABLE `ue_event_mme` (
`id` int NOT NULL AUTO_INCREMENT,
`ne_id` bigint DEFAULT '0' COMMENT '网元ID',
`record_time` bigint DEFAULT '0' COMMENT '记录时间',
`created_time` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
`event_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '事件类型',
`event_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_ue_ne_type_at` (`ne_id` DESC,`event_type` DESC, `created_time` DESC) USING BTREE COMMENT '索引-网元_类型_时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UE事件_MME终端接入';
-- Dump completed on 2025-09-11 15:26:56

View File

@@ -105,12 +105,77 @@ func (r KpiCReport) Insert(neType string, param model.KpiCReport) int64 {
tableName := fmt.Sprintf("kpi_c_report_%s", strings.ToLower(neType))
// 执行插入
if err := db.DB("").Table(tableName).Create(&param).Error; err != nil {
logger.Errorf("insert err => %v", err.Error())
errMsg := err.Error()
// 动态创建表
if strings.HasPrefix(errMsg, "Error 1146 (42S02): Table") {
if err := r.createTableByMySQL(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
if strings.HasPrefix(errMsg, "SQL logic error: no such table") {
if err := r.createTableBySQLite(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
logger.Errorf("insert err => %v", errMsg)
return 0
}
return param.ID
}
// createTableByMySQL 创建表MySQL
func (r KpiCReport) createTableByMySQL(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS kpi_c_report_%s (
id int NOT NULL AUTO_INCREMENT,
ne_id bigint DEFAULT '0' COMMENT '网元ID',
created_time bigint DEFAULT '0' COMMENT '创建时间',
record_time bigint DEFAULT '0' COMMENT '记录时间',
index int NOT NULL COMMENT 'Index of the report',
granularity int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
kpi_values text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (id) USING BTREE,
KEY idx_kpic_%s_ne_at (ne_id DESC, created_time DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_C_%s';
`,
lowerNeType, lowerNeType, strings.ToUpper(neType),
)
_, err := db.ExecDB("", sql, nil)
return err
}
// createTableBySQLite 创建表SQLite
func (r KpiCReport) createTableBySQLite(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS "kpi_c_report_%s" (
"id" integer NOT NULL,
"ne_id" integer,
"created_time" integer,
"record_time" integer,
"index" integer NOT NULL,
"granularity" integer,
"kpi_values" text,
PRIMARY KEY ("id")
);
CREATE INDEX IF NOT EXISTS "idx_kpic_%s_ne_at"
ON "kpi_c_report_%s" (
"ne_id" DESC,
"created_time" DESC
);
`,
lowerNeType, lowerNeType, lowerNeType,
)
_, err := db.ExecDB("", sql, nil)
return err
}
// SelectKPITitle 网元对应的指标名称
func (r KpiCReport) SelectKPITitle(neType string) []model.KpiCTitle {
rows := []model.KpiCTitle{}

View File

@@ -105,12 +105,77 @@ func (r KpiReport) Insert(neType string, param model.KpiReport) int64 {
tableName := fmt.Sprintf("kpi_report_%s", strings.ToLower(neType))
// 执行插入
if err := db.DB("").Table(tableName).Create(&param).Error; err != nil {
logger.Errorf("insert err => %v", err.Error())
errMsg := err.Error()
// 动态创建表
if strings.HasPrefix(errMsg, "Error 1146 (42S02): Table") {
if err := r.createTableByMySQL(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
if strings.HasPrefix(errMsg, "SQL logic error: no such table") {
if err := r.createTableBySQLite(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
logger.Errorf("insert err => %v", errMsg)
return 0
}
return param.ID
}
// createTableByMySQL 创建表MySQL
func (r KpiReport) createTableByMySQL(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS kpi_report_%s (
id int NOT NULL AUTO_INCREMENT,
ne_id bigint DEFAULT '0' COMMENT '网元ID',
created_time bigint DEFAULT '0' COMMENT '创建时间',
record_time bigint DEFAULT '0' COMMENT '记录时间',
index int NOT NULL COMMENT 'Index of the report',
granularity int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
kpi_values text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
PRIMARY KEY (id) USING BTREE,
KEY idx_kpi_%s_ne_at (ne_id DESC, created_time DESC) USING BTREE COMMENT '索引-网元ID_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_%s';
`,
lowerNeType, lowerNeType, strings.ToUpper(neType),
)
_, err := db.ExecDB("", sql, nil)
return err
}
// createTableBySQLite 创建表SQLite
func (r KpiReport) createTableBySQLite(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS "kpi_report_%s" (
"id" integer NOT NULL,
"ne_id" integer,
"created_time" integer,
"record_time" integer,
"index" integer NOT NULL,
"granularity" integer,
"kpi_values" text,
PRIMARY KEY ("id")
);
CREATE INDEX IF NOT EXISTS "idx_kpi_%s_ne_at"
ON "kpi_report_%s" (
"ne_id" DESC,
"created_time" DESC
);
`,
lowerNeType, lowerNeType, lowerNeType,
)
_, err := db.ExecDB("", sql, nil)
return err
}
// Select 查询数据
func (r KpiReport) Select(neType string, neId int64, beginTime, endTime int64) []model.KpiReport {
rows := []model.KpiReport{}

View File

@@ -197,8 +197,69 @@ func (r CDREvent) Insert(neType string, param model.CDREvent) int64 {
tableName := fmt.Sprintf("cdr_event_%s", strings.ToLower(neType))
// 执行插入
if err := db.DB("").Table(tableName).Create(&param).Error; err != nil {
logger.Errorf("insert err => %v", err.Error())
errMsg := err.Error()
// 动态创建表
if strings.HasPrefix(errMsg, "Error 1146 (42S02): Table") {
if err := r.createTableByMySQL(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
if strings.HasPrefix(errMsg, "SQL logic error: no such table") {
if err := r.createTableBySQLite(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
logger.Errorf("insert err => %v", errMsg)
return 0
}
return param.ID
}
// createTableByMySQL 创建表MySQL
func (r CDREvent) createTableByMySQL(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS cdr_event_%s (
id int NOT NULL AUTO_INCREMENT,
ne_id bigint DEFAULT '0' COMMENT '网元ID',
created_time bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
record_time bigint DEFAULT '0' COMMENT '记录时间',
cdr_json text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (id) USING BTREE,
KEY idx_cdr_%s_ne_at (ne_id DESC, created_time DESC) USING BTREE COMMENT '索引-网元_记录时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='CDR事件_%s';
`,
lowerNeType, lowerNeType, strings.ToUpper(neType),
)
_, err := db.ExecDB("", sql, nil)
return err
}
// createTableBySQLite 创建表SQLite
func (r CDREvent) createTableBySQLite(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS "cdr_event_%s" (
"id" integer NOT NULL,
"ne_id" integer,
"created_time" integer,
"record_time" integer,
"cdr_json" text,
PRIMARY KEY ("id")
);
CREATE INDEX IF NOT EXISTS "idx_cdr_%s_ne_at"
ON "cdr_event_%s" (
"ne_id" DESC,
"created_time" DESC
);
`,
lowerNeType, lowerNeType, lowerNeType,
)
_, err := db.ExecDB("", sql, nil)
return err
}

View File

@@ -159,8 +159,72 @@ func (r UEEvent) Insert(neType string, param model.UEEvent) int64 {
tableName := fmt.Sprintf("ue_event_%s", strings.ToLower(neType))
// 执行插入
if err := db.DB("").Table(tableName).Create(&param).Error; err != nil {
logger.Errorf("insert err => %v", err.Error())
errMsg := err.Error()
// 动态创建表
if strings.HasPrefix(errMsg, "Error 1146 (42S02): Table") {
if err := r.createTableByMySQL(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
if strings.HasPrefix(errMsg, "SQL logic error: no such table") {
if err := r.createTableBySQLite(neType); err != nil {
logger.Errorf("create table err => %v", err.Error())
return 0
}
}
logger.Errorf("insert err => %v", errMsg)
return 0
}
return param.ID
}
// createTableByMySQL 创建表MySQL
func (r UEEvent) createTableByMySQL(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS ue_event_%s (
id int NOT NULL AUTO_INCREMENT,
ne_id bigint DEFAULT '0' COMMENT '网元ID',
record_time bigint DEFAULT '0' COMMENT '记录时间',
created_time bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
event_type varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '事件类型',
event_json text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
PRIMARY KEY (id) USING BTREE,
KEY idx_ue_%s_ne_type_at (ne_id DESC,event_type DESC, created_time DESC) USING BTREE COMMENT '索引-网元_类型_时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UE事件_%s';
`,
lowerNeType, lowerNeType, strings.ToUpper(neType),
)
_, err := db.ExecDB("", sql, nil)
return err
}
// createTableBySQLite 创建表SQLite
func (r UEEvent) createTableBySQLite(neType string) error {
lowerNeType := strings.ToLower(neType)
sql := fmt.Sprintf(
`
CREATE TABLE IF NOT EXISTS "ue_event_%s" (
"id" integer NOT NULL,
"ne_id" integer,
"record_time" integer,
"created_time" integer,
"event_type" text(16),
"event_json" text,
PRIMARY KEY ("id")
);
CREATE INDEX IF NOT EXISTS "idx_ue_%s_ne_type_at"
ON "ue_event_%s" (
"ne_id" DESC,
"event_type" DESC,
"created_time" DESC
);
`,
lowerNeType, lowerNeType, lowerNeType,
)
_, err := db.ExecDB("", sql, nil)
return err
}