/*
 Navicat Premium Data Transfer
 
 Source Server         : local_mariadb
 Source Server Type    : MariaDB
 Source Server Version : 100338 (10.3.38-MariaDB)
 Source Host           : localhost:33066
 Source Schema         : omc_db
 
 Target Server Type    : MariaDB
 Target Server Version : 100338 (10.3.38-MariaDB)
 File Encoding         : 65001
 
 Date: 25/10/2023 18:24:04
 */
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for sys_job
-- ----------------------------
CREATE TABLE IF NOT EXISTS `sys_job` (
  `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID',
  `job_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '任务名称',
  `job_group` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'DEFAULT' COMMENT '任务组名',
  `invoke_target` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '调用目标字符串',
  `target_params` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '调用目标传入参数',
  `cron_expression` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'cron执行表达式',
  `misfire_policy` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '3' COMMENT '计划执行错误策略（1立即执行 2执行一次 3放弃执行）',
  `concurrent` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否并发执行（0禁止 1允许）',
  `status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '任务状态（0暂停 1正常）',
  `save_log` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否记录任务日志（0不记录 1记录）',
  `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` bigint(20) NULL DEFAULT 0 COMMENT '创建时间',
  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` bigint(20) NULL DEFAULT 0 COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`job_id`, `job_name`, `job_group`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '调度任务调度表' ROW_FORMAT = Dynamic;

ALTER TABLE
    `sys_job` DROP PRIMARY KEY,
ADD
    PRIMARY KEY (`job_id`) USING BTREE,
ADD
    UNIQUE INDEX IF NOT EXISTS `idx_uni_name_group`(`job_name`, `job_group`) USING BTREE COMMENT 'unique index for job_name and job_group';

-- ----------------------------
-- Records of sys_job
-- ----------------------------
REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        1,
        'job.monitor_sys_resource',
        'SYSTEM',
        'monitor_sys_resource',
        '{\"interval\":5}',
        '0 0/5 * * * ?',
        '3',
        '0',
        '1',
        '0',
        'supervisor',
        1698478134839,
        'supervisor',
        1700571615807,
        'job.monitor_sys_resource_remark'
    );

REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        4,
        'job.delExpiredNeBackup',
        'SYSTEM',
        'delExpiredNeBackup',
        '{\"duration\":60}',
        '0 20 0 * * ?',
        '3',
        '0',
        '1',
        '1',
        'supervisor',
        1698478134840,
        NULL,
        0,
        'job.delExpiredNeBackupRemark'
    );

REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        5,
        'job.deleteExpiredAlarmRecord',
        'SYSTEM',
        'deleteExpiredRecord',
        '{\"duration\":90,\"tableName\":\"alarm\",\"colName\":\"event_time\",\"extras\":\"alarm_status=\'0\'\"}',
        '0 10 0 * * ?',
        '3',
        '0',
        '1',
        '1',
        'supervisor',
        1698478134841,
        NULL,
        0,
        'job.deleteExpiredAlarmRecordRemark'
    );

REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        6,
        'job.deleteExpiredKpiRecord',
        'SYSTEM',
        'deleteExpiredRecord',
        '{\"duration\":30,\"tableName\":\"gold_kpi\",\"colName\":\"date\"}',
        '0 15 0 * * ?',
        '3',
        '0',
        '1',
        '1',
        'supervisor',
        1698478134842,
        'supervisor',
        1700570673113,
        'job.deleteExpiredKpiRecordRemark'
    );

REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        7,
        'job.backupEtcFromNE',
        'SYSTEM',
        'backupEtcFromNE',
        NULL,
        '0 30 0 * * ?',
        '3',
        '0',
        '1',
        '1',
        'supervisor',
        1698478134843,
        NULL,
        0,
        'job.backupEtcFromNERemark'
    );

REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        8,
        'job.deleteExpiredNeStateRecord',
        'SYSTEM',
        'deleteExpiredRecord',
        '{\"duration\":7,\"tableName\":\"ne_state\",\"colName\":\"timestamp\"}',
        '0 25 0 * * ?',
        '3',
        '0',
        '1',
        '1',
        'supervisor',
        1698478134842,
        'admin',
        1703668901929,
        'job.deleteExpiredNeStateRecordRemark'
    );

REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        9,
        'job.getStateFromNE',
        'SYSTEM',
        'getStateFromNE',
        '',
        '0/10 * * * * ?',
        '3',
        '0',
        '1',
        '0',
        'supervisor',
        1698478134842,
        'admin',
        1703669877919,
        'job.getStateFromNERemark'
    );

REPLACE INTO
    `sys_job` (
        `job_id`,
        `job_name`,
        `job_group`,
        `invoke_target`,
        `target_params`,
        `cron_expression`,
        `misfire_policy`,
        `concurrent`,
        `status`,
        `save_log`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        10,
        'job.genNeStateAlarm',
        'SYSTEM',
        'genNeStateAlarm',
        '{\"alarmID\":\"HXEMSSM10000\",\"alarmCode\":10000,\"alarmTitle\":\"The system state is abnormal\",\"neType\":\"OMC\",\"alarmType\":\"EquipmentAlarm\",\"origSeverity\": \"Major\",\"objectName\":\"EMS;SystemManagement;Heartbeat\",\"objectType\":\"SystemState\",\"specificProblem\":\"Alarm cause: the system state of target NE has not been received for {threshold} seconds\", \"specificProblemID\":\"AC10000\",\"threshold\":30}',
        '0/5 * * * * ?',
        '3',
        '0',
        '1',
        '0',
        'supervisor',
        1698478134842,
        'admin',
        1703768623188,
        'job.genNeStateAlarmRemark'
    );

INSERT IGNORE INTO `sys_job` VALUES  ('job.nms_cxy.performance_upload_oss', 'SYSTEM', 'performance_upload_oss', '{\"interval\":15,\"neTypes\":[\"AMF\",\"UPF\",\"UDM\",\"SMF\",\"NSSF\"]}', '0 0/15 * * * ?', '3', '0', '1', '1', 'supervisor', 1698478134839, 'supervisor', 1710819124454, 'job.nms_cxy.performance_upload_oss_remark');
INSERT IGNORE INTO `sys_job` VALUES  ('job.nms_cxy.resource_upload_oss', 'SYSTEM', 'resource_upload_oss', '{\"neTypes\":[\"AMF\",\"UPF\"]}', '0 0 0,12 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134839, 'supervisor', 1710819133986, 'job.nms_cxy.resource_upload_oss_remark');
INSERT IGNORE INTO `sys_job` VALUES  ('job.nms_cxy.config_upload_oss', 'SYSTEM', 'config_upload_oss', '{\"neTypes\":[\"AMF\",\"UPF\",\"UDM\",\"SMF\"]}', '0 0 0,12 * * ?', '3', '0', '1', '1', 'supervisor', 1698478134839, 'supervisor', 1710818082110, 'job.nms_cxy.config_upload_oss_remark');
INSERT IGNORE INTO `sys_dict_data` VALUES (210, 210, 'job.nms_cxy.performance_upload_oss', '性能数据文件的上报', 'i18n_zh', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (211, 211, 'job.nms_cxy.performance_upload_oss_remark', 'interval周期为15分钟。neTypes为数组对应上报数据的网元类型。', 'i18n_zh', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (212, 212, 'job.nms_cxy.performance_upload_oss', 'Reporting of performance data files', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (213, 213, 'job.nms_cxy.performance_upload_oss_remark', 'The interval period is 15 minutes. neTypes is an array corresponding to the type of network element for which the data was reported.', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (215, 215, 'job.nms_cxy.resource_upload_oss', '资源数据上报接口', 'i18n_zh', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (216, 216, 'job.nms_cxy.resource_upload_oss_remark', '每天的 0 时及 12 时上报网元的全量资源数据文件至 OSS。', 'i18n_zh', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (217, 217, 'job.nms_cxy.resource_upload_oss', 'Resource data reporting interface', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (218, 218, 'job.nms_cxy.resource_upload_oss_remark', 'Full resource data files for network elements are reported to the OSS at 0000 and 1200 hours each day.', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (220, 220, 'job.nms_cxy.config_upload_oss', '配置数据上报接口', 'i18n_zh', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (221, 221, 'job.nms_cxy.config_upload_oss_remark', '配置数据上报时间为每日的0时及12时。', 'i18n_zh', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (222, 222, 'job.nms_cxy.config_upload_oss', 'Configure data reporting interface', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
INSERT IGNORE INTO `sys_dict_data` VALUES (223, 223, 'job.nms_cxy.config_upload_oss_remark', 'Set the data reporting time to 0:00 and 12:00 every day.', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');

SET FOREIGN_KEY_CHECKS = 1;