-- 参数配置-系统设置属性DELETE FROM
DELETE FROM
    `omc_db`.`sys_config`
WHERE
    `config_id` = 100
    and `config_key` = 'test';
DELETE FROM
    `omc_db`.`sys_config`
WHERE
    `config_id` != 102
    and `config_key` = 'sys.logo.type';
DELETE FROM
    `omc_db`.`sys_config`
WHERE
    `config_id` != 103
    and `config_key` = 'sys.logo.filePathIcon';
DELETE FROM
    `omc_db`.`sys_config`
WHERE
    `config_id` != 104
    and `config_key` = 'sys.title';
DELETE FROM
    `omc_db`.`sys_config`
WHERE
    `config_id` != 105
    and `config_key` = 'sys.copyright';
DELETE FROM
    `omc_db`.`sys_config`
WHERE
    `config_id` != 106
    and `config_key` = 'sys.logo.filePathBrand';
DELETE FROM
    `omc_db`.`sys_config`
WHERE
    `config_id` != 107
    and `config_key` = 'sys.loginBackground';               


-- 创建表 监控_基本信息
DROP TABLE IF EXISTS `omc_db`.`monitor_base`;
CREATE TABLE IF NOT EXISTS `omc_db`.`monitor_base` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `create_time` bigint DEFAULT '0' COMMENT '创建时间',
  `cpu` float DEFAULT '0' COMMENT 'cpu使用率',
  `load_usage` float DEFAULT '0' COMMENT 'cpu平均使用率',
  `cpu_load1` float DEFAULT '0' COMMENT 'cpu使用1分钟',
  `cpu_load5` float DEFAULT '0' COMMENT 'cpu使用5分钟',
  `cpu_load15` float DEFAULT '0' COMMENT 'cpu使用15分钟',
  `memory` float DEFAULT '0' COMMENT '内存使用率',
  `ne_type` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网元类型',
  `ne_id` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网元ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='监控_基本信息';

-- 创建表 监控_磁盘IO
DROP TABLE IF EXISTS `omc_db`.`monitor_io`;
CREATE TABLE IF NOT EXISTS `omc_db`.`monitor_io` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `create_time` bigint DEFAULT '0' COMMENT '创建时间',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '磁盘名',
  `read` int DEFAULT '0' COMMENT '读取K',
  `write` int DEFAULT '0' COMMENT '写入K',
  `count` int DEFAULT '0' COMMENT '次数',
  `time` int DEFAULT '0' COMMENT '耗时',
  `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网元类型',
  `ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网元ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='监控_磁盘IO';

-- 创建表 监控_网络IO
DROP TABLE IF EXISTS `omc_db`.`monitor_network`;
CREATE TABLE IF NOT EXISTS `omc_db`.`monitor_network` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `create_time` bigint DEFAULT '0' COMMENT '创建时间',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网卡名',
  `up` float DEFAULT '0' COMMENT '上行',
  `down` float DEFAULT '0' COMMENT '下行',
  `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网元类型',
  `ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网元ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=316 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='监控_网络IO';

-- 参数配置-监控-系统资源
INSERT IGNORE INTO `omc_db`.`sys_config` (`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (10, '监控-系统资源-数据保留时长', 'monitor.sysResource.storeDays', '30', 'Y', 'admin', 1698483370391, '', 0, '监控-系统资源-数据保留时长，单位天。根据当前日期，删除超过保留时长的日期数据信息。');
