-- 动态表单报名活动管理 - 菜单与权限
-- 挂载在「正在映画」顶级菜单下（按 menu_name 查询，兼容线上/测试 menu_id 不一致）

SET @zhengzaiRootId = (
    SELECT menu_id
    FROM sys_menu
    WHERE menu_name = '正在映画'
      AND parent_id = 0
      AND menu_type = 'M'
    LIMIT 1
);

INSERT INTO sys_menu (menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES ('报名活动管理', @zhengzaiRootId, 10, '#', 'menuItem', 'M', '0', NULL, 'fa fa-list-alt', 'admin', NOW(), '', NULL, '动态表单报名活动管理');

SET @parentId = LAST_INSERT_ID();

INSERT INTO sys_menu (menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES ('活动列表', @parentId, 1, '/sweet/formSubmission/listView', 'menuItem', 'C', '0', 'sweet:formSubmission:list', '#', 'admin', NOW(), '', NULL, '报名活动列表');

SET @menuId = LAST_INSERT_ID();

INSERT INTO sys_menu (menu_name, parent_id, order_num, url, target, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
VALUES ('导出', @menuId, 1, '#', '', 'F', '0', 'sweet:formSubmission:export', '#', 'admin', NOW(), '', NULL, '');
