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
| -- 将 通知上报 菜单挂载到:日志报表(优先)或开发专用
| -- 说明:执行本脚本后,请在“角色授权”里给对应角色勾选新菜单和“查看”权限。
|
| SET @notify_parent_id := COALESCE(
| (
| SELECT id
| FROM sys_resource
| WHERE code = 'logReport' AND level = 1
| ORDER BY id
| LIMIT 1
| ),
| (
| SELECT id
| FROM sys_resource
| WHERE code = 'develop' AND level = 1
| ORDER BY id
| LIMIT 1
| )
| );
|
| INSERT INTO sys_resource(code, name, resource_id, level, sort, status)
| SELECT 'notifyReport/notifyReport.html', '通知上报', @notify_parent_id, 2, 998, 1
| FROM dual
| WHERE @notify_parent_id IS NOT NULL
| AND NOT EXISTS (
| SELECT 1
| FROM sys_resource
| WHERE code = 'notifyReport/notifyReport.html' AND level = 2
| );
|
| SET @notify_report_id := (
| SELECT id
| FROM sys_resource
| WHERE code = 'notifyReport/notifyReport.html' AND level = 2
| ORDER BY id
| LIMIT 1
| );
|
| INSERT INTO sys_resource(code, name, resource_id, level, sort, status)
| SELECT 'notifyReport/notifyReport.html#view', '查看', @notify_report_id, 3, 1, 1
| FROM dual
| WHERE @notify_report_id IS NOT NULL
| AND NOT EXISTS (
| SELECT 1
| FROM sys_resource
| WHERE code = 'notifyReport/notifyReport.html#view' AND level = 3
| );
|
| SELECT id, code, name, resource_id, level, sort, status
| FROM sys_resource
| WHERE code IN ('notifyReport/notifyReport.html', 'notifyReport/notifyReport.html#view');
|
|