-- 信贷客户家庭关系菜单权限
-- 创建时间: 2026-02-11

-- 添加信贷客户家庭关系菜单(父菜单为信息维护)
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, remark)
SELECT @parent_id := menu_id FROM sys_menu WHERE menu_name = '信息维护' LIMIT 1;
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, remark)
VALUES (
    '信贷客户家庭关系',
    @parent_id,
    5,
    'custFmyRelation',
    1,
    0,
    'C',
    '0',
    '0',
    'ccdi:custFmyRelation:list',
    'peoples',
    'admin',
    NOW(),
    '',
    '信贷客户家庭关系菜单'
);

-- 获取刚插入的菜单ID
SET @cust_menu_id = LAST_INSERT_ID();

-- 添加按钮权限
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, remark)
VALUES
    ('信贷客户家庭关系查询', @cust_menu_id, 1, '#', '', 1, 0, 'F', '0', '0', 'ccdi:custFmyRelation:query', '#', 'admin', NOW(), ''),
    ('信贷客户家庭关系新增', @cust_menu_id, 2, '#', '', 1, 0, 'F', '0', '0', 'ccdi:custFmyRelation:add', '#', 'admin', NOW(), ''),
    ('信贷客户家庭关系修改', @cust_menu_id, 3, '#', '', 1, 0, 'F', '0', '0', 'ccdi:custFmyRelation:edit', '#', 'admin', NOW(), ''),
    ('信贷客户家庭关系删除', @cust_menu_id, 4, '#', '', 1, 0, 'F', '0', '0', 'ccdi:custFmyRelation:remove', '#', 'admin', NOW(), ''),
    ('信贷客户家庭关系导出', @cust_menu_id, 5, '#', '', 1, 0, 'F', '0', '0', 'ccdi:custFmyRelation:export', '#', 'admin', NOW(), ''),
    ('信贷客户家庭关系导入', @cust_menu_id, 6, '#', '', 1, 0, 'F', '0', '0', 'ccdi:custFmyRelation:import', '#', 'admin', NOW(), '');
