SET FOREIGN_KEY_CHECKS=0;

DELETE FROM `sys_role` WHERE `role_id` IN (1,2,3,4,5);

INSERT IGNORE INTO
    `sys_role` (
        `role_id`,
        `role_name`,
        `role_key`,
        `role_sort`,
        `data_scope`,
        `menu_check_strictly`,
        `dept_check_strictly`,
        `status`,
        `del_flag`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        1,
        'Supervisor',
        'supervisor',
        1,
        '1',
        '1',
        '1',
        '1',
        '0',
        'admin',
        1697091437683,
        '',
        0,
        '超级管理员，无法修改删除'
    );

INSERT IGNORE INTO
    `sys_role` (
        `role_id`,
        `role_name`,
        `role_key`,
        `role_sort`,
        `data_scope`,
        `menu_check_strictly`,
        `dept_check_strictly`,
        `status`,
        `del_flag`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        2,
        'Administrator',
        'administrator',
        2,
        '1',
        '1',
        '1',
        '1',
        '0',
        'admin',
        1698486915894,
        'supervisor',
        1698739249610,
        '管理人员 可以对设备进行任何操作'
    );

INSERT IGNORE INTO
    `sys_role` (
        `role_id`,
        `role_name`,
        `role_key`,
        `role_sort`,
        `data_scope`,
        `menu_check_strictly`,
        `dept_check_strictly`,
        `status`,
        `del_flag`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        3,
        'Operator',
        'operator',
        3,
        '1',
        '1',
        '1',
        '1',
        '0',
        'admin',
        1698486934900,
        'supervisor',
        1698739285488,
        '运维人员 可以从设备读取数据，并对设备进行配置，但是不能对设备进行软件升级操作。'
    );

INSERT IGNORE INTO
    `sys_role` (
        `role_id`,
        `role_name`,
        `role_key`,
        `role_sort`,
        `data_scope`,
        `menu_check_strictly`,
        `dept_check_strictly`,
        `status`,
        `del_flag`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        4,
        'Monitor',
        'monitor',
        4,
        '1',
        '1',
        '1',
        '1',
        '0',
        'admin',
        1698486950714,
        'admin',
        1698718807790,
        '监控人员 只能从设备读取数据，而不能对设备进行任何设置'
    );

INSERT IGNORE INTO
    `sys_role` (
        `role_id`,
        `role_name`,
        `role_key`,
        `role_sort`,
        `data_scope`,
        `menu_check_strictly`,
        `dept_check_strictly`,
        `status`,
        `del_flag`,
        `create_by`,
        `create_time`,
        `update_by`,
        `update_time`,
        `remark`
    )
VALUES (
        5,
        'Visitor',
        'vistor',
        5,
        '1',
        '1',
        '1',
        '1',
        '0',
        'admin',
        1698486975779,
        'admin',
        1698718839597,
        '普通用户 只可看系统相关信息'
    );

-- for cn/en locales
UPDATE `sys_role`
SET
    `role_name` = 'role.admin',
    `role_key` = 'supervisor',
    `role_sort` = 1,
    `data_scope` = '1',
    `menu_check_strictly` = '1',
    `dept_check_strictly` = '1',
    `status` = '1',
    `del_flag` = '0',
    `create_by` = 'supervisor',
    `create_time` = 1697091437683,
    `update_by` = NULL,
    `update_time` = 0,
    `remark` = 'role.adminRemark'
WHERE `role_id` = 1;

UPDATE `sys_role`
SET
    `role_name` = 'role.adminAssign',
    `role_key` = 'administrator',
    `role_sort` = 2,
    `data_scope` = '1',
    `menu_check_strictly` = '1',
    `dept_check_strictly` = '1',
    `status` = '1',
    `del_flag` = '0',
    `create_by` = 'supervisor',
    `create_time` = 1698486915894,
    `update_by` = NULL,
    `update_time` = 0,
    `remark` = 'role.adminAssignRemark'
WHERE `role_id` = 2;

UPDATE `sys_role`
SET
    `role_name` = 'role.operator',
    `role_key` = 'operator',
    `role_sort` = 3,
    `data_scope` = '1',
    `menu_check_strictly` = '1',
    `dept_check_strictly` = '1',
    `status` = '1',
    `del_flag` = '0',
    `create_by` = 'supervisor',
    `create_time` = 1698486934900,
    `update_by` = NULL,
    `update_time` = 0,
    `remark` = 'role.operatorRemark'
WHERE `role_id` = 3;

UPDATE `sys_role`
SET
    `role_name` = 'role.monitor',
    `role_key` = 'monitor',
    `role_sort` = 4,
    `data_scope` = '1',
    `menu_check_strictly` = '1',
    `dept_check_strictly` = '1',
    `status` = '1',
    `del_flag` = '0',
    `create_by` = 'supervisor',
    `create_time` = 1698486950714,
    `update_by` = NULL,
    `update_time` = 0,
    `remark` = 'role.monitorRemark'
WHERE `role_id` = 4;

UPDATE `sys_role`
SET
    `role_name` = 'role.vistor',
    `role_key` = 'vistor',
    `role_sort` = 5,
    `data_scope` = '1',
    `menu_check_strictly` = '1',
    `dept_check_strictly` = '1',
    `status` = '1',
    `del_flag` = '0',
    `create_by` = 'supervisor',
    `create_time` = 1698486975779,
    `update_by` = NULL,
    `update_time` = 0,
    `remark` = 'role.vistorRemark'
WHERE `role_id` = 5;

SET FOREIGN_KEY_CHECKS=1;    