-- ============================================================
-- 引江济太(YJJT)菜单初始化SQL
-- 请在达梦数据库中执行此脚本
-- ============================================================

-- 一级菜单：引江济太管理
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, remark)
VALUES ('引江济太管理', 0, 11, 'yjjt', NULL, NULL, 1, 0, 'M', '0', '0', '', 'skill', 'admin', SYSDATE, '引江济太管理目录');

-- 二级菜单：YJJT站点管理
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, remark)
SELECT 'YJJT站点管理', id, 1, 'station', 'yjjt/station/index', NULL, 1, 0, 'C', '0', '0', 'yjjt:station:list', 'server', 'admin', SYSDATE, '引江济太站点管理菜单'
FROM sys_menu WHERE menu_name = '引江济太管理' AND parent_id = 0;

-- 二级菜单：水量数据
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, remark)
SELECT '水量数据', id, 2, 'sl', 'yjjt/sl/index', NULL, 1, 0, 'C', '0', '0', 'yjjt:sl:list', 'chart', 'admin', SYSDATE, '引江济太水量数据菜单'
FROM sys_menu WHERE menu_name = '引江济太管理' AND parent_id = 0;

-- 二级菜单：水质数据
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, remark)
SELECT '水质数据', id, 3, 'sz', 'yjjt/sz/index', NULL, 1, 0, 'C', '0', '0', 'yjjt:sz:list', 'chart', 'admin', SYSDATE, '引江济太水质数据菜单'
FROM sys_menu WHERE menu_name = '引江济太管理' AND parent_id = 0;

-- 二级菜单：文件管理
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, remark)
SELECT 'YJJT文件管理', id, 4, 'file', 'yjjt/file/index', NULL, 1, 0, 'C', '0', '0', 'yjjt:file:list', 'upload', 'admin', SYSDATE, '引江济太文件管理菜单'
FROM sys_menu WHERE menu_name = '引江济太管理' AND parent_id = 0;

-- 二级菜单：数据统计
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, remark)
SELECT 'YJJT数据统计', id, 5, 'statistics', 'yjjt/statistics/index', NULL, 1, 0, 'C', '0', '0', 'yjjt:data:list', 'dashboard', 'admin', SYSDATE, '引江济太数据统计菜单'
FROM sys_menu WHERE menu_name = '引江济太管理' AND parent_id = 0;

-- ============================================================
-- 按钮权限：YJJT站点管理
-- ============================================================
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, remark)
SELECT '站点查询', id, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:station:query', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT站点管理' AND perms = 'yjjt:station:list';

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, remark)
SELECT '站点新增', id, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:station:add', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT站点管理' AND perms = 'yjjt:station:list';

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, remark)
SELECT '站点修改', id, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:station:edit', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT站点管理' AND perms = 'yjjt:station:list';

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, remark)
SELECT '站点删除', id, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:station:remove', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT站点管理' AND perms = 'yjjt:station:list';

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, remark)
SELECT '站点导出', id, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:station:export', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT站点管理' AND perms = 'yjjt:station:list';

-- ============================================================
-- 按钮权限：水量数据
-- ============================================================
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, remark)
SELECT '水量查询', id, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:sl:query', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = '水量数据' AND perms = 'yjjt:sl:list';

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, remark)
SELECT '水量删除', id, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:sl:remove', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = '水量数据' AND perms = 'yjjt:sl:list';

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, remark)
SELECT '水量导出', id, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:sl:export', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = '水量数据' AND perms = 'yjjt:sl:list';

-- ============================================================
-- 按钮权限：水质数据
-- ============================================================
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, remark)
SELECT '水质查询', id, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:sz:query', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = '水质数据' AND perms = 'yjjt:sz:list';

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, remark)
SELECT '水质删除', id, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:sz:remove', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = '水质数据' AND perms = 'yjjt:sz:list';

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, remark)
SELECT '水质导出', id, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:sz:export', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = '水质数据' AND perms = 'yjjt:sz:list';

-- ============================================================
-- 按钮权限：YJJT文件管理
-- ============================================================
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, remark)
SELECT '文件查询', id, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:file:query', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT文件管理' AND perms = 'yjjt:file:list';

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, remark)
SELECT '文件新增', id, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:file:add', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT文件管理' AND perms = 'yjjt:file:list';

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, remark)
SELECT '文件删除', id, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'yjjt:file:remove', '#', 'admin', SYSDATE, ''
FROM sys_menu WHERE menu_name = 'YJJT文件管理' AND perms = 'yjjt:file:list';

COMMIT;
