1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| -- 顶级菜单:光储报表;子菜单:光伏发电报表、储能日充放电报表。
|
| INSERT INTO sys_menu
| (menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
| menu_type, visible, status, perms, icon, create_by, create_time, remark)
| SELECT '光储报表', 0, 9, '/energyReport', NULL, NULL, 1, 0, 'M', '0', 0,
| '/energyReport', 'bar-chart', 'admin', NOW(), '光储报表目录'
| WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE parent_id = 0 AND path = '/energyReport');
|
| SET @energy_report_id := (SELECT menu_id FROM sys_menu WHERE parent_id = 0 AND path = '/energyReport' ORDER BY menu_id LIMIT 1);
|
| UPDATE sys_menu SET menu_name='光储报表', order_num=9, menu_type='M', visible='0', status=0,
| perms='/energyReport', icon='bar-chart', update_time=NOW() WHERE menu_id=@energy_report_id;
|
| INSERT INTO sys_menu
| (menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
| menu_type, visible, status, perms, icon, create_by, create_time, remark)
| SELECT '光伏发电报表', @energy_report_id, 1, '/energyReport/photovoltaic',
| 'energyReport/photovoltaic', NULL, 1, 0, 'C', '0', 0,
| '/energyReport/photovoltaic', '#', 'admin', NOW(), '光伏发电报表'
| WHERE @energy_report_id IS NOT NULL AND NOT EXISTS
| (SELECT 1 FROM sys_menu WHERE parent_id=@energy_report_id AND path='/energyReport/photovoltaic');
|
| SET @photovoltaic_id := (SELECT menu_id FROM sys_menu WHERE parent_id=@energy_report_id AND path='/energyReport/photovoltaic' ORDER BY menu_id LIMIT 1);
|
| INSERT INTO sys_menu
| (menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
| menu_type, visible, status, perms, icon, create_by, create_time, remark)
| SELECT '储能日充放电报表', @energy_report_id, 2, '/energyReport/storage',
| 'energyReport/storage', NULL, 1, 0, 'C', '0', 0,
| '/energyReport/storage', '#', 'admin', NOW(), '储能日充放电报表'
| WHERE @energy_report_id IS NOT NULL AND NOT EXISTS
| (SELECT 1 FROM sys_menu WHERE parent_id=@energy_report_id AND path='/energyReport/storage');
|
| SET @storage_report_id := (SELECT menu_id FROM sys_menu WHERE parent_id=@energy_report_id AND path='/energyReport/storage' ORDER BY menu_id LIMIT 1);
|
| INSERT INTO sys_menu
| (menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
| menu_type, visible, status, perms, icon, create_by, create_time, remark)
| SELECT '光伏报表查询', @photovoltaic_id, 1, '', NULL, NULL, 1, 0, 'F', '0', 0,
| '/energyReport/photovoltaic/select', '#', 'admin', NOW(), '光伏报表查询权限'
| WHERE @photovoltaic_id IS NOT NULL AND NOT EXISTS
| (SELECT 1 FROM sys_menu WHERE parent_id=@photovoltaic_id AND perms='/energyReport/photovoltaic/select');
|
| INSERT INTO sys_menu
| (menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
| menu_type, visible, status, perms, icon, create_by, create_time, remark)
| SELECT '光伏报表导出', @photovoltaic_id, 2, '', NULL, NULL, 1, 0, 'F', '0', 0,
| '/energyReport/photovoltaic/export', '#', 'admin', NOW(), '光伏报表导出权限'
| WHERE @photovoltaic_id IS NOT NULL AND NOT EXISTS
| (SELECT 1 FROM sys_menu WHERE parent_id=@photovoltaic_id AND perms='/energyReport/photovoltaic/export');
|
| INSERT INTO sys_menu
| (menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
| menu_type, visible, status, perms, icon, create_by, create_time, remark)
| SELECT '储能报表查询', @storage_report_id, 1, '', NULL, NULL, 1, 0, 'F', '0', 0,
| '/energyReport/storage/select', '#', 'admin', NOW(), '储能报表查询权限'
| WHERE @storage_report_id IS NOT NULL AND NOT EXISTS
| (SELECT 1 FROM sys_menu WHERE parent_id=@storage_report_id AND perms='/energyReport/storage/select');
|
| INSERT INTO sys_menu
| (menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
| menu_type, visible, status, perms, icon, create_by, create_time, remark)
| SELECT '储能报表导出', @storage_report_id, 2, '', NULL, NULL, 1, 0, 'F', '0', 0,
| '/energyReport/storage/export', '#', 'admin', NOW(), '储能报表导出权限'
| WHERE @storage_report_id IS NOT NULL AND NOT EXISTS
| (SELECT 1 FROM sys_menu WHERE parent_id=@storage_report_id AND perms='/energyReport/storage/export');
|
| INSERT IGNORE INTO sys_role_menu (role_id, menu_id)
| SELECT 1, menu_id FROM sys_menu
| WHERE menu_id=@energy_report_id OR menu_id IN (@photovoltaic_id, @storage_report_id)
| OR parent_id IN (@photovoltaic_id, @storage_report_id);
|
|