-- 菜单SQL
INSERT INTO sys_menu (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 ('{{ table.function_name }}', {% if table.parent_menu_id %}{{ table.parent_menu_id }}{% else %}NULL{% endif %}, 1, '{{ table.business_name }}', '{{ table.module_name }}/{{ table.business_name }}/index', 1, 0, 'C', '0', '0', '{{ table.module_name }}:{{ table.business_name }}:list', '#', 'admin', SYSDATE(), '', NULL, '{{ table.function_name }}菜单');

-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();

-- 按钮SQL
INSERT INTO sys_menu (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 ('{{ table.function_name }}查询', @parentId, 1,  '#', '', 1, 0, 'F', '0', '0', '{{ table.module_name }}:{{ table.business_name }}:query',        '#', 'admin', SYSDATE(), '', NULL, '');

INSERT INTO sys_menu (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 ('{{ table.function_name }}新增', @parentId, 2,  '#', '', 1, 0, 'F', '0', '0', '{{ table.module_name }}:{{ table.business_name }}:add',          '#', 'admin', SYSDATE(), '', NULL, '');

INSERT INTO sys_menu (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 ('{{ table.function_name }}修改', @parentId, 3,  '#', '', 1, 0, 'F', '0', '0', '{{ table.module_name }}:{{ table.business_name }}:edit',          '#', 'admin', SYSDATE(), '', NULL, '');

INSERT INTO sys_menu (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 ('{{ table.function_name }}删除', @parentId, 4,  '#', '', 1, 0, 'F', '0', '0', '{{ table.module_name }}:{{ table.business_name }}:remove',       '#', 'admin', SYSDATE(), '', NULL, '');

INSERT INTO sys_menu (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 ('{{ table.function_name }}导出', @parentId, 5,  '#', '', 1, 0, 'F', '0', '0', '{{ table.module_name }}:{{ table.business_name }}:export',       '#', 'admin', SYSDATE(), '', NULL, '');

INSERT INTO sys_menu (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 ('{{ table.function_name }}导入', @parentId, 6,  '#', '', 1, 0, 'F', '0', '0', '{{ table.module_name }}:{{ table.business_name }}:import',       '#', 'admin', SYSDATE(), '', NULL, '');
