提交 | 用户 | 时间
|
e7c126
|
1 |
-- 菜单 SQL |
H |
2 |
INSERT INTO system_menu( |
|
3 |
name, permission, type, sort, parent_id, |
|
4 |
path, icon, component, status, component_name |
|
5 |
) |
|
6 |
VALUES ( |
|
7 |
'${table.classComment}管理', '', 2, 0, ${table.parentMenuId}, |
|
8 |
'${simpleClassName_strikeCase}', '', '${table.moduleName}/${table.businessName}/index', 0, '${table.className}' |
|
9 |
); |
|
10 |
|
|
11 |
-- 按钮父菜单ID |
|
12 |
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 |
|
13 |
SELECT @parentId := LAST_INSERT_ID(); |
|
14 |
|
|
15 |
-- 按钮 SQL |
|
16 |
#set ($functionNames = ['查询', '创建', '更新', '删除', '导出']) |
|
17 |
#set ($functionOps = ['query', 'create', 'update', 'delete', 'export']) |
|
18 |
#foreach ($functionName in $functionNames) |
|
19 |
#set ($index = $foreach.count - 1) |
|
20 |
INSERT INTO system_menu( |
|
21 |
name, permission, type, sort, parent_id, |
|
22 |
path, icon, component, status |
|
23 |
) |
|
24 |
VALUES ( |
|
25 |
'${table.classComment}${functionName}', '${permissionPrefix}:${functionOps.get($index)}', 3, $foreach.count, @parentId, |
|
26 |
'', '', '', 0 |
|
27 |
); |
|
28 |
#end |