INSERT INTO permission (id, permission_code, permission_name, module)
VALUES
    (1009, 'user.read', '查看用户', 'system'),
    (1010, 'user.create', '创建用户', 'system'),
    (1011, 'role.read', '查看角色', 'system'),
    (1012, 'user.role.assign', '用户分配角色', 'system')
ON DUPLICATE KEY UPDATE permission_name = VALUES(permission_name), module = VALUES(module);

INSERT INTO role_permission (id, tenant_id, role_id, permission_id)
VALUES
    (9, 1, 101, 1009),
    (10, 1, 101, 1010),
    (11, 1, 101, 1011),
    (12, 1, 101, 1012)
ON DUPLICATE KEY UPDATE permission_id = VALUES(permission_id);
