-- 1. 先查询出父菜单ID并赋值给变量
SET @parent_id = (SELECT menu_id FROM sys_menu WHERE path='fiihupgrade' and menu_type='M');

-- 2. 使用变量插入数据
INSERT INTO sys_menu (
    `menu_name`, `parent_id`, `order_num`, `path`,
    `component`, `query`, `is_frame`, `is_cache`, `menu_type`,
    `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
    `update_by`, `update_time`, `remark`
)VALUES (
    '质检追溯', @parent_id, 10, 'qualityAccident',
   'mes/quality/accident/index', NULL, 1, 0, 'C', '0', '0',
   '', '#', 'YAVII', '2026-02-05 15:34:51', 'YAVII',
   '2026-02-05 19:50:48', ''
);
