set @id = (SELECT max(menu_id) from sys_menu)+1;
set @pid = '1';
set @icon = 'excel';
#set($a = "#")

#foreach($item in $list)

-- 菜单 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component,query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(@id, '${item.name}', @pid, '100', '${item.toSimpleLowerName()}', '${moduleName}/${item.toSimpleLowerName()}/index', '', 1, 0, 'C', '0', '0', '${moduleName}:${item.toSimpleLowerName()}:page', @icon, 'admin', sysdate(), '', null, '${item.name}');

-- 按钮 SQL
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(@id+1, '查询', @id, '1',  '${a}', '', 1, 0, 'F', '0', '0', '${moduleName}:${item.toSimpleLowerName()}:query',        '${a}', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(@id+2, '添加', @id, '2',  '${a}', '', 1, 0, 'F', '0', '0', '${moduleName}:${item.toSimpleLowerName()}:add',       '${a}', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(@id+3, '修改', @id, '3',  '${a}', '', 1, 0, 'F', '0', '0', '${moduleName}:${item.toSimpleLowerName()}:update',       '${a}', 'admin', sysdate(), '', null, '');

insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values(@id+4, '删除', @id, '4',  '${a}', '', 1, 0, 'F', '0', '0', '${moduleName}:${item.toSimpleLowerName()}:delete',       '${a}', 'admin', sysdate(), '', null, '');

set @id = @id + 10;
#end