/*
 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:23:35
*/

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;

-- ----------------------------
-- Records of sys_job
-- ----------------------------

INSERT IGNORE INTO `sys_job`
VALUES (
    4,
    '删除过期网元备份文件',
    'SYSTEM',
    'delExpiredNeBackup',
    '{\"duration\":90}',
    '0 20 0 * * ?',
    '3',
    '0',
    '1',
    '1',
    'admin',
    1697091151529,
    'admin',
    1698134207967,
    '删除过期网元etc备份文件, 传入参数表示保留90天的备份文件, 默认60天'
  );
INSERT IGNORE INTO `sys_job`
VALUES (
    5,
    '删除过期历史告警记录',
    'SYSTEM',
    'deleteExpiredRecord',
    '{\"duration\":90,\"tableName\":\"alarm\",\"colName\":\"event_time\",\"extras\":\"alarm_status=\'0\'\"}',
    '0 10 0 * * ?',
    '3',
    '0',
    '1',
    '1',
    'admin',
    1698150591601,
    'admin',
    1698197292003,
    '删除过期历史告警记录，传入参数表示保留90天的历史告警记录'
  );
INSERT IGNORE INTO `sys_job`
VALUES (
    6,
    '删除过期黄金指标记录',
    'SYSTEM',
    'deleteExpiredRecord',
    '{\"duration\":60,\"tableName\":\"gold_kpi\",\"colName\":\"date\"}',
    '0 15 0 * * ?',
    '3',
    '0',
    '1',
    '1',
    'admin',
    1698197983126,
    'admin',
    1698198074872,
    '黄金指标记录保留60天'
  );
INSERT IGNORE INTO `sys_job`
VALUES (
    7,
    '网元配置自动备份任务',
    'SYSTEM',
    'backupEtcFromNE',
    '',
    '0 30 0 * * ?',
    '3',
    '0',
    '1',
    '1',
    'admin',
    1698223216479,
    '',
    0,
    '自动备份网元etc目录下的配置文件, 可修改cron表达式设置备份时间和周期 '
  );

SET FOREIGN_KEY_CHECKS = 1;
