INSERT INTO permission (id, permission_code, permission_name, module)
VALUES
    (1049, 'template.archive', '模板归档', 'template')
ON DUPLICATE KEY UPDATE permission_name = VALUES(permission_name), module = VALUES(module);

INSERT INTO role_permission (id, tenant_id, role_id, permission_id)
VALUES
    (50, 1, 101, 1049)
ON DUPLICATE KEY UPDATE permission_id = VALUES(permission_id);
