You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RuoYi-Vue/add_newstocks_menu.sql

109 lines
2.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

-- 为新的行情数据页面添加菜单配置
-- 1. 首先查询股票系统的父菜单ID
SELECT menu_id, menu_name, parent_id FROM sys_menu WHERE menu_name = '股票系统';
-- 2. 假设股票系统的父菜单ID为某个值添加新的行情数据菜单项
-- 请根据实际查询结果修改parent_id的值
-- 插入新的行情数据菜单项
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'新行情数据',
(SELECT menu_id FROM sys_menu WHERE menu_name = '股票系统'),
'10',
'newstocks',
'stocksystem/newstocks',
'1',
'0',
'C',
'0',
'0',
'stocksystem:newstocks:list',
'chart',
'admin'
);
-- 3. 为新的行情数据页面添加按钮权限
-- 获取新插入的菜单ID
SET @menu_id = LAST_INSERT_ID();
-- 插入新增按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'新增',
@menu_id,
'1',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:add',
'#',
'admin'
);
-- 插入修改按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'修改',
@menu_id,
'2',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:edit',
'#',
'admin'
);
-- 插入删除按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'删除',
@menu_id,
'3',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:remove',
'#',
'admin'
);
-- 插入导出按钮权限
INSERT INTO sys_menu (
menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by
) VALUES (
'导出',
@menu_id,
'4',
'#',
NULL,
'1',
'0',
'F',
'0',
'0',
'stocksystem:newstocks:export',
'#',
'admin'
);
-- 4. 查询结果
SELECT * FROM sys_menu WHERE menu_name LIKE '%新行情数据%' OR parent_id = @menu_id;