/**
Source Server Version: 8.0.31
Source Database: backendsys
Date: 2023/05/23 17:09:22
*/

DROP TABLE IF EXISTS `sys_user_role_module_relation`;

CREATE TABLE `sys_user_role_module_relation` (
    PRIMARY KEY (`id`),
    `id` BIGINT(10) NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `role_id` BIGINT(10) NOT NULL COMMENT '角色ID',
    `module_id` VARCHAR(10) NOT NULL COMMENT '模块ID'
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='系统角色模块关系表';


# # 使用 存储过程 循环插入
# DROP PROCEDURE IF EXISTS backendsys.insert_multiple_rows;
# DELIMITER //
# CREATE PROCEDURE insert_multiple_rows()
# BEGIN
#     DECLARE counter INT DEFAULT 1;
#     DECLARE counter2 INT DEFAULT 1;
#
#     WHILE counter <= 52 DO
#         INSERT INTO sys_user_role_module_relation(role_id, module_id) VALUES (1, counter);
#         SET counter = counter + 1;
#     END WHILE;
#
#     WHILE counter2 <= 14 DO
#         INSERT INTO sys_user_role_module_relation(role_id, module_id) VALUES (2, counter2);
#         SET counter2 = counter2 + 1;
#     END WHILE;
#
# END //
# DELIMITER ;
# CALL insert_multiple_rows();

INSERT INTO sys_user_role_module_relation(role_id, module_id) VALUES
    (1, '1'),
        (1, '1.1'),
#         (1, '1.2'),
#         (1, '1.3'),
#             (1, '1.3.1'), (1, '1.3.2'), (1, '1.3.3'),
    (1, '2'),
    (1, '3'),
        (1, '3.1'),
        (1, '3.2'),
            (1, '3.2.1'), (1, '3.2.1.2'), (1, '3.2.2'), (1, '3.2.3'), (1, '3.2.4'), (1, '3.2.5'), (1, '3.2.6'), (1, '3.2.7'),
        (1, '3.3'),
            (1, '3.3.8'), (1, '3.3.9'), (1, '3.3.10'),
#             (1, '3.3.1'), (1, '3.3.2'), (1, '3.3.3'), (1, '3.3.4'), (1, '3.3.5'), (1, '3.3.6'), (1, '3.3.7'),
    (1, '4'),
        (1, '4.1'),
            (1, '4.1.1'), (1, '4.1.2'), (1, '4.1.3'), (1, '4.1.4'), (1, '4.1.5'),

#     (1, '10'),
#         (1, '10.1'),
#             (1, '10.1.1'), (1, '10.1.2'), (1, '10.1.3'), (1, '10.1.4'),
#         (1, '10.2'),
#             (1, '10.2.1'), (1, '10.2.2'), (1, '10.2.3'), (1, '10.2.4'),
#         (1, '10.3'),
#             (1, '10.3.1'), (1, '10.3.2'), (1, '10.3.3'), (1, '10.3.4'),
#     (1, '11'),
#         (1, '11.1'),
#             (1, '11.1.1'), (1, '11.1.2'), (1, '11.1.3'), (1, '11.1.4'),
#         (1, '11.2'),
#             (1, '11.2.1'), (1, '11.2.2'), (1, '11.2.3'), (1, '11.2.4'),
#         (1, '11.3'),
#             (1, '11.3.1'), (1, '11.3.2'), (1, '11.3.3'), (1, '11.3.4'),
#         (1, '11.4'),
#             (1, '11.4.1'), (1, '11.4.2'), (1, '11.4.3'), (1, '11.4.4'),
#         (1, '11.5'),
#             (1, '11.5.1'), (1, '11.5.2'), (1, '11.5.3'), (1, '11.5.4'),
#         (1, '11.6'),
#             (1, '11.6.1'), (1, '11.6.2'), (1, '11.6.3'), (1, '11.6.4'),
#     (1, '12'),
#         (1, '12.1'),
#         (1, '12.2'),
#         (1, '12.3'),
#     (1, '13'),
#         (1, '13.1'),

    (1, '20'),
        (1, '20.1'),
            (1, '20.1.1'), (1, '20.1.2'), (1, '20.1.3'), (1, '20.1.4'), (1, '20.1.5'), (1, '20.1.6'),
        (1, '20.2'),
            (1, '20.2.1'), (1, '20.2.2'), (1, '20.2.3'), (1, '20.2.4'),
        (1, '20.3'),

    (1, '21'),
        (1, '21.1'),
            (1, '21.1.1'), (1, '21.1.2'), (1, '21.1.3'), (1, '21.1.4'), (1, '21.1.5'), (1, '21.1.6'),
        (1, '21.2'),
            (1, '21.2.1'), (1, '21.2.2'), (1, '21.2.3'), (1, '21.2.4'),
        (1, '21.3'),
            (1, '21.3.1'), (1, '21.3.2'), (1, '21.3.3'), (1, '21.3.4'),

    (1, '31'),
        (1, '31.1'),
    (1, '32'),
        (1, '32.1'),
    (1, '33'),
        (1, '33.1'),
    (1, '34'),
        (1, '34.1'),
    (1, '35'),
        (1, '35.1'),


    (2, '1'),
        (2, '1.1'),
    (2, '2'),

    (2, '3.2.1'),
    (2, '4.1'),

    (2, '31'),
    (2, '32'),
    (2, '33'),
    (2, '34'),
    (2, '35')

;
