SET FOREIGN_KEY_CHECKS=0;

-- 参数配置value长度

ALTER TABLE
    `omc_db`.`sys_config` MODIFY COLUMN `config_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '参数键值' AFTER `config_key`;

-- 参数配置-系统设置属性

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 (
        102,
        '系统设置-LOGO类型',
        'sys.logo.type',
        'icon',
        'Y',
        'admin',
        1698112743562,
        'admin',
        1698217326676,
        '全图：brand\n小图：icon'
    );

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 (
        103,
        '系统设置-LOGO文件icon',
        'sys.logo.filePathIcon',
        '',
        'Y',
        'admin',
        1698112935847,
        'admin',
        1698201425536,
        '文件支持网络地址图片和内部上传的文件路径'
    );

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 (
        104,
        '系统设置-系统名称',
        'sys.title',
        '核心网管理系统',
        'Y',
        'admin',
        1698113035648,
        'admin',
        1698217311606,
        '系统名称长度限制11位字符串'
    );

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 (
        105,
        '系统设置-版权声明',
        'sys.copyright',
        'Copyright ©2023 For AGrand 千通科技',
        'Y',
        'admin',
        1698113158157,
        'admin',
        1698220040192,
        '底脚固定条，左侧放置版权声明'
    );

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 (
        106,
        '系统设置-LOGO文件brand',
        'sys.logo.filePathBrand',
        '',
        'Y',
        'admin',
        1698112935847,
        'admin',
        1698219184041,
        '文件支持网络地址图片和内部上传的文件路径'
    );

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 (
        107,
        '系统设置-登录界面背景',
        'sys.loginBackground',
        '',
        'Y',
        'admin',
        1698205046084,
        'admin',
        1698217285996,
        '文件支持网络地址图片和内部上传的文件路径'
    );
    
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 (
        5,
        '用户管理-密码锁定时间',
        'sys.user.lockTime',
        '10',
        'Y',
        'admin',
        1693911541269,
        '',
        0,
        '密码锁定时间,单位分钟（默认10分钟）'
    );

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 (
        6,
        '用户管理-授权有效时间',
        'sys.user.expiresIn',
        '120',
        'Y',
        'admin',
        1693911541269,
        '',
        0,
        '令牌有效期（默认120分钟）'
    );

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 (
        7,
        '用户管理-多端用户授权登录',
        'sys.user.multi_login',
        'true',
        'Y',
        'admin',
        1693911541269,
        '',
        0,
        '多端授权登录'
    );

UPDATE `omc_db`.`sys_config`
SET
    `config_name` = '用户管理-账号初始密码',
    `config_key` = 'sys.user.initPassword',
    `config_value` = 'Abcd@1234..',
    `config_type` = 'Y',
    `create_by` = 'admin',
    `create_time` = 1693908079656,
    `update_by` = '',
    `update_time` = 0,
    `remark` = '导入用户初始化密码'
WHERE `config_id` = 1;

UPDATE `omc_db`.`sys_config`
SET
    `config_name` = '账号自助-验证码开关',
    `config_key` = 'sys.account.captchaEnabled',
    `config_value` = 'false',
    `config_type` = 'Y',
    `create_by` = 'admin',
    `create_time` = 1693908079667,
    `update_by` = '',
    `update_time` = 0,
    `remark` = '是否开启验证码功能（true开启，false关闭）'
WHERE `config_id` = 2;

UPDATE `omc_db`.`sys_config`
SET
    `config_name` = '账号自助-是否开启用户注册功能',
    `config_key` = 'sys.account.registerUser',
    `config_value` = 'false',
    `config_type` = 'Y',
    `create_by` = 'admin',
    `create_time` = 1693908079669,
    `update_by` = '',
    `update_time` = 0,
    `remark` = '是否开启注册用户功能（true开启，false关闭）'
WHERE `config_id` = 3;

UPDATE `omc_db`.`sys_config`
SET
    `config_name` = '用户管理-密码最大错误次数',
    `config_key` = 'sys.user.maxRetryCount',
    `config_value` = '5',
    `config_type` = 'Y',
    `create_by` = 'admin',
    `create_time` = 1693908079680,
    `update_by` = '',
    `update_time` = 0,
    `remark` = '密码最大错误次数'
WHERE `config_id` = 4;

UPDATE `omc_db`.`sys_config`
SET
    `config_name` = '测试',
    `config_key` = 'test',
    `config_value` = 'test',
    `config_type` = 'Y',
    `create_by` = 'admin',
    `create_time` = 1693911541269,
    `update_by` = 'admin',
    `update_time` = 1693911586418,
    `remark` = '测试'
WHERE `config_id` = 100;

-- 参数配置-系统设置属性

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';

-- 参数配置-监控-系统资源

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,
        '监控-系统资源-数据保留时长，单位天。根据当前日期，删除超过保留时长的日期数据信息。'
    );

SET FOREIGN_KEY_CHECKS=1;    