ShiShiYiBan/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/sql/sql.vm

28 lines
1019 B
Plaintext
Raw Normal View History

2021-02-12 12:58:41 +08:00
-- 菜单 SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
2021-02-12 12:58:41 +08:00
)
VALUES (
2021-03-13 13:37:59 +08:00
'${table.classComment}管理', '', 2, 0, ${table.parentMenuId},
'${simpleClassName_strikeCase}', '', '${table.moduleName}/${classNameVar}/index', 0, '${table.className}'
2021-02-12 12:58:41 +08:00
);
-- 按钮父菜单ID
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
2021-02-12 12:58:41 +08:00
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
2021-03-13 13:37:59 +08:00
#set ($functionNames = ['查询', '创建', '更新', '删除', '导出'])
#set ($functionOps = ['query', 'create', 'update', 'delete', 'export'])
2021-02-12 12:58:41 +08:00
#foreach ($functionName in $functionNames)
2021-02-12 21:01:45 +08:00
#set ($index = $foreach.count - 1)
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
2021-02-12 12:58:41 +08:00
)
VALUES (
2021-03-13 13:37:59 +08:00
'${table.classComment}${functionName}', '${permissionPrefix}:${functionOps.get($index)}', 3, $foreach.count, @parentId,
2021-02-27 23:15:12 +08:00
'', '', '', 0
2021-02-12 12:58:41 +08:00
);
#end