-- --------------------------------------------------------------------------------------
-- 初始化系统基础数据
-- --------------------------------------------------------------------------------------

-- 初始化租户数据
INSERT INTO sys_tenant (id, create_time, code, name, address, contact_name, contact_phone, email, enabled)
VALUES (1, NOW(), 'admin', '系统管理租户', '北京市朝阳区', '管理员', '13800138000', 'admin@system.com', 1);

-- 初始化部门数据
INSERT INTO sys_department (id, create_time, code, name, description, parent_id, sort, enabled)
VALUES 
(1, NOW(), 'ROOT', '总公司', '总公司', NULL, 0, 1),
(5, NOW(), 'DL', '大连', NULL, 1, 1, 1),
(6, NOW(), 'CD', '成都', NULL, 1, 2, 1),
(7, NOW(), 'SZ', '深圳', NULL, 1, 3, 1);

-- 初始化用户数据（密码统一为：123456）
INSERT INTO sys_user (id, create_time, username, password, nickname, email, phone, department_id, enabled)
VALUES 
(1, NOW(), 'admin', '$2a$10$5jQmYewM2slT.OFeNjnQGOQrImu0aeXVxHxWsV8BCJ.cQiOHBHpVS', '超级管理员', 'admin@system.com', '13800138000', 1, 1),
(5, NOW(), 'tangfengmin', '$2a$10$Ela/xvMnUjpI5fqgXwF1sebpbxNAOaBo2Ar5hVqyAQvTZm/r.btqa', '汤峰岷', 'tangfengmin@iscmtech.com', NULL, 5, 1),
(6, NOW(), 'shengzeqiang', '$2a$10$jeuU3FvTya3ZbS28yvVafu5W5pBc.s8/ZGNHQ7pkhHNp/VsI2wpw2', '盛泽强', 'shengzeqiang@iscmtech.com', NULL, 5, 1),
(7, NOW(), 'wengao', '$2a$10$b/ybO46p/R5e2hDAsNF66un8RpnpWEjXvVs6udbTIAR.Yo9o2HGHO', '文高', 'wengao@iscmtech.com', NULL, 5, 1),
(8, NOW(), 'lvchunlin', '$2a$10$xcnezz8RHbx4SqNVMNn/RuHPzJ/nV.r1jTxx0bl87R.9N0p1j0dQW', '吕春林', 'lvchunlin@iscmtech.com', NULL, 5, 1),
(9, NOW(), 'yinliyan', '$2a$10$N1Sk0wEK/0qs.0/JzANbOOqPUT.gaWhjfZu4oO4PgCXg6ElfZH826', '尹丽妍', 'yinliyan@iscmtech.com', NULL, 5, 1),
(10, NOW(), 'maye', '$2a$10$YPhZjBKxHLNYXzMS6mnc7Of3pPT.6DhBArkJLbCPKgaTiLDWrr58y', '马也', 'maye@iscmtech.com', NULL, 5, 1),
(11, NOW(), 'dengqichen', '$2a$10$fUdDZ33099YboexF/SNQT.55mXzK3Kejb82yc76iCdl25.uqAatkW', '邓骐辰', 'dengqichen@iscmtech.com', NULL, 5, 1),
(12, NOW(), 'wangdongzhu', '$2a$10$OErv/EvBXUocMutXZJe3C.k1gq9/8rrF63pz8mWRBLoORGb/8ELIO', '王栋柱', 'wangdongzhu@iscmtech.com', NULL, 5, 1),
(13, NOW(), 'yangzhenfu', '$2a$10$.WBc0pXTQnrDn2IUm.eRneH9jfu7TIZg2na.K3WaluvjIEts2Iasm', '杨振夫', 'yangzhenfu@iscmtech.com', '15842461837', 5, 1);

-- 初始化系统参数
INSERT INTO sys_param (id, create_time, code, name, value, type, description, enabled)
VALUES 
(1, NOW(), 'SYSTEM_NAME', '系统名称', 'Deploy Ease Platform', 'STRING', '系统显示名称', 1),
(2, NOW(), 'SYSTEM_LOGO', '系统Logo', '/static/logo.png', 'STRING', '系统Logo路径', 1),
(3, NOW(), 'LOGIN_BACKGROUND', '登录背景', '/static/login-bg.jpg', 'STRING', '登录页面背景图片', 1);

-- --------------------------------------------------------------------------------------
-- 初始化权限管理数据
-- --------------------------------------------------------------------------------------

-- --------------------------------------------------------------------------------------
-- 初始化权限管理数据
-- --------------------------------------------------------------------------------------

-- --------------------------------------------------------------------------------------
-- 初始化权限管理数据
-- --------------------------------------------------------------------------------------

-- 先清理已有数据
DELETE FROM sys_menu;

INSERT INTO sys_menu (id, name, path, component, icon, permission, type, parent_id, sort, hidden, enabled, create_by, create_time, version, deleted)
VALUES
-- 首页
(99, '工作台', '/dashboard', 'Dashboard', 'DashboardOutlined', 'dashboard', 2, NULL, 0, FALSE, TRUE, 'system', NOW(), 0, FALSE),

-- 工作流管理
(100, '流程管理', '/workflow', NULL, 'DeploymentUnitOutlined', NULL, 1, NULL, 1, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 流程设计
(101, '流程设计', '/workflow/definitions', 'Workflow/Definition/List', 'EditOutlined', 'workflow:definition', 2, 100, 10, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 工作流设计器（隐藏路由，用于编辑工作流）
(1011, '工作流设计器', '/workflow/design/:id', 'Workflow/Design', 'EditOutlined', NULL, 2, 100, 11, TRUE, TRUE, 'system', NOW(), 0, FALSE),
-- 流程实例
(102, '流程实例', '/workflow/instances', 'Workflow/Instance/List', 'BranchesOutlined', 'workflow:instance', 2, 100, 20, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 动态表单
(104, '动态表单', '/workflow/form', 'Form/Definition/List', 'FormOutlined', 'workflow:form', 2, 100, 30, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 表单设计器（隐藏路由，用于设计表单）
(1041, '表单设计器', '/workflow/form/:id/design', 'Form/Definition/Designer', 'FormOutlined', NULL, 2, 100, 31, TRUE, TRUE, 'system', NOW(), 0, FALSE),
-- 表单数据详情（隐藏路由，用于查看表单数据）
(1042, '表单数据详情', '/workflow/form/data/:id', 'Form/Data/List/Detail', 'FileTextOutlined', NULL, 2, 100, 32, TRUE, TRUE, 'system', NOW(), 0, FALSE),
-- 运维管理
(200, '运维管理', '/deploy', NULL, 'DeploymentUnitOutlined', NULL, 1, NULL, 2, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 团队管理
(201, '团队管理', '/deploy/teams', 'Deploy/Team/List', 'TeamOutlined', 'deploy:team', 2, 200, 1, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 应用管理
(202, '应用管理', '/deploy/applications', 'Deploy/Application/List', 'AppstoreOutlined', 'deploy:application', 2, 200, 2, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 定时任务管理
(203, '定时任务管理', '/deploy/schedule-jobs', 'Deploy/ScheduleJob/List', 'ClockCircleOutlined', 'deploy:schedule-job', 2, 200, 3, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 环境管理
(204, '环境管理', '/deploy/environments', 'Deploy/Environment/List', 'CloudOutlined', 'deploy:environment', 2, 200, 4, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 消息渠道管理
(205, '消息渠道管理', '/deploy/notification-channels', 'Deploy/NotificationChannel/List', 'BellOutlined', 'deploy:notification-channel', 2, 200, 5, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 通知模板
(206, '通知模板', '/deploy/notification-templates', 'Deploy/NotificationTemplate/List', 'FileTextOutlined', 'deploy:notification-template', 2, 200, 6, FALSE, TRUE, 'system', NOW(), 0, FALSE),

-- 资源管理
(300, '资源管理', '/resource', NULL, 'DatabaseOutlined', NULL, 1, NULL, 3, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 服务器管理
(301, '服务器管理', '/resource/servers', 'Resource/Server/List', 'CloudServerOutlined', 'resource:server', 2, 300, 1, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- Jenkins管理
(302, 'Jenkins管理', '/resource/jenkins', 'Resource/Jenkins/List', 'BuildOutlined', 'resource:jenkins', 2, 300, 2, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- Git管理
(303, 'Git管理', '/resource/git', 'Resource/Git/List', 'GithubOutlined', 'resource:git', 2, 300, 3, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 三方系统管理
(304, '三方系统管理', '/resource/external', 'Resource/External/List', 'ApiOutlined', 'resource:external', 2, 300, 4, FALSE, TRUE, 'system', NOW(), 0, FALSE),

-- 系统管理
(1, '系统管理', '/system', NULL, 'SettingOutlined', NULL, 1, NULL, 99, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 用户管理
(2, '用户管理', '/system/users', 'System/User/List', 'UserOutlined', 'system:user', 2, 1, 10, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 角色管理
(3, '角色管理', '/system/roles', 'System/Role/List', 'TeamOutlined', 'system:role', 2, 1, 20, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 菜单管理
(4, '菜单管理', '/system/menus', 'System/Menu/List', 'MenuOutlined', 'system:menu', 2, 1, 30, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 部门管理
(5, '部门管理', '/system/departments', 'System/Department/List', 'ApartmentOutlined', 'system:department', 2, 1, 40, FALSE, TRUE, 'system', NOW(), 0, FALSE),
-- 权限管理（隐藏菜单）
(6, '权限管理', '/system/permissions', 'System/Permission/List', 'SafetyOutlined', 'system:permission', 2, 1, 50, TRUE, TRUE, 'system', NOW(), 0, FALSE),
-- 在线用户管理
(7, '在线用户', '/system/online', 'System/Online/List', 'UserSwitchOutlined', 'system:online:view', 2, 1, 60, FALSE, TRUE, 'system', NOW(), 0, FALSE);

-- ==================== 初始化角色数据 ====================
DELETE FROM sys_role WHERE id < 100;

INSERT INTO sys_role (id, create_time, code, name, type, description, sort, is_admin)
VALUES
(1, NOW(), 'ROLE_ADMIN', '管理员', 1, '系统管理员，拥有所有权限', 1, 1),
(2, NOW(), 'ROLE_OPS', '运维', 2, '运维人员，负责服务器、部署等运维工作', 2, 0),
(3, NOW(), 'ROLE_DEV', '开发', 2, '开发人员，负责应用开发和部署', 3, 0),
(4, NOW(), 'ROLE_HR', 'HR', 2, '人力资源，负责人员管理', 4, 0),
(5, NOW(), 'ROLE_BA', 'BA/产品', 2, '业务分析/产品经理，负责需求和产品管理', 5, 0);

-- 初始化角色标签
INSERT INTO sys_role_tag (id, create_time, name, color)
VALUES 
(1, NOW(), '系统内置', '#ff4d4f'),
(2, NOW(), '重要角色', '#ffa940'),
(3, NOW(), '普通角色', '#73d13d');

-- 初始化角色标签关联
INSERT INTO sys_role_tag_relation (role_id, tag_id)
VALUES 
(1, 1),
(2, 1),
(2, 2),
(3, 3);

-- 初始化用户角色关联
INSERT INTO sys_user_role (user_id, role_id)
VALUES 
(1, 1),   -- admin - 管理员
(5, 3),   -- tangfengmin - 开发
(6, 3),   -- shengzeqiang - 开发
(7, 3),   -- wengao - 开发
(8, 3),   -- lvchunlin - 开发
(9, 3),   -- yinliyan - 开发
(10, 3),  -- maye - 开发
(11, 1),  -- dengqichen - 管理员
(12, 3),  -- wangdongzhu - 开发
(13, 3);  -- yangzhenfu - 开发

-- 初始化角色菜单关联
INSERT INTO sys_role_menu (role_id, menu_id)
VALUES 
-- 管理员角色（拥有所有菜单）
(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 99), (1, 100), (1, 101), (1, 102), (1, 104), (1, 200), (1, 201), (1, 202), (1, 203), (1, 204), (1, 205), (1, 206), (1, 300), (1, 301), (1, 302), (1, 303), (1, 304), (1, 1011), (1, 1041), (1, 1042),
-- 运维角色
(2, 99), (2, 200), (2, 201), (2, 202), (2, 203), (2, 204), (2, 205), (2, 300), (2, 301), (2, 302), (2, 303), (2, 304),
-- 开发角色（只有工作台）
(3, 99);

-- ==================== 初始化权限数据 ====================
DELETE FROM sys_permission WHERE id < 10000;

-- 系统管理权限
INSERT INTO sys_permission (id, create_time, menu_id, code, name, type, sort) VALUES
-- 工作台 (menu_id=99)
(501, NOW(), 99, 'dashboard:deploy:list', '获取可部署环境', 'FUNCTION', 1),
(502, NOW(), 99, 'dashboard:deploy:execute', '执行部署', 'FUNCTION', 2),
(503, NOW(), 99, 'dashboard:deploy:view-graph', '查看部署流程图', 'FUNCTION', 3),
(504, NOW(), 99, 'dashboard:deploy:logs', '查看节点日志', 'FUNCTION', 4),
(505, NOW(), 99, 'dashboard:approval:list', '获取审批任务', 'FUNCTION', 5),
(506, NOW(), 99, 'dashboard:approval:complete', '完成审批', 'FUNCTION', 6),

-- 用户管理 (menu_id=2)
(1, NOW(), 2, 'system:user:list', '用户查询', 'FUNCTION', 1),
(2, NOW(), 2, 'system:user:view', '用户详情', 'FUNCTION', 2),
(3, NOW(), 2, 'system:user:create', '用户创建', 'FUNCTION', 3),
(4, NOW(), 2, 'system:user:update', '用户修改', 'FUNCTION', 4),
(5, NOW(), 2, 'system:user:delete', '用户删除', 'FUNCTION', 5),
(6, NOW(), 2, 'system:user:reset-password', '重置密码', 'FUNCTION', 6),
(7, NOW(), 2, 'system:user:assign-department', '分配部门', 'FUNCTION', 7),
(8, NOW(), 2, 'system:user:assign-roles', '分配角色', 'FUNCTION', 8),

-- 角色管理 (menu_id=3)
(11, NOW(), 3, 'system:role:list', '角色查询', 'FUNCTION', 1),
(12, NOW(), 3, 'system:role:view', '角色详情', 'FUNCTION', 2),
(13, NOW(), 3, 'system:role:create', '角色创建', 'FUNCTION', 3),
(14, NOW(), 3, 'system:role:update', '角色修改', 'FUNCTION', 4),
(15, NOW(), 3, 'system:role:delete', '角色删除', 'FUNCTION', 5),
(16, NOW(), 3, 'system:role:assign-tags', '分配标签', 'FUNCTION', 6),
(17, NOW(), 3, 'system:role:get-permissions', '获取角色权限', 'FUNCTION', 7),
(18, NOW(), 3, 'system:role:assign-permissions', '分配权限', 'FUNCTION', 8),

-- 菜单管理 (menu_id=4)
(21, NOW(), 4, 'system:menu:list', '菜单查询', 'FUNCTION', 1),
(22, NOW(), 4, 'system:menu:view', '菜单详情', 'FUNCTION', 2),
(23, NOW(), 4, 'system:menu:create', '菜单创建', 'FUNCTION', 3),
(24, NOW(), 4, 'system:menu:update', '菜单修改', 'FUNCTION', 4),
(25, NOW(), 4, 'system:menu:delete', '菜单删除', 'FUNCTION', 5),
(26, NOW(), 4, 'system:menu:tree', '获取菜单树', 'FUNCTION', 6),
(27, NOW(), 4, 'system:menu:permission-tree', '获取权限树', 'FUNCTION', 7),

-- 权限管理 (menu_id=6)
(31, NOW(), 6, 'system:permission:list', '权限查询', 'FUNCTION', 1),
(32, NOW(), 6, 'system:permission:view', '权限详情', 'FUNCTION', 2),
(33, NOW(), 6, 'system:permission:create', '权限创建', 'FUNCTION', 3),
(34, NOW(), 6, 'system:permission:update', '权限修改', 'FUNCTION', 4),
(35, NOW(), 6, 'system:permission:delete', '权限删除', 'FUNCTION', 5),

-- 部门管理 (menu_id=5)
(41, NOW(), 5, 'system:department:list', '部门查询', 'FUNCTION', 1),
(42, NOW(), 5, 'system:department:view', '部门详情', 'FUNCTION', 2),
(43, NOW(), 5, 'system:department:create', '部门创建', 'FUNCTION', 3),
(44, NOW(), 5, 'system:department:update', '部门修改', 'FUNCTION', 4),
(45, NOW(), 5, 'system:department:delete', '部门删除', 'FUNCTION', 5),
(46, NOW(), 5, 'system:department:tree', '获取部门树', 'FUNCTION', 6),

-- 在线用户管理 (menu_id=7)
(51, NOW(), 7, 'system:online:view', '查看在线用户', 'FUNCTION', 1),
(52, NOW(), 7, 'system:online:kick', '强制下线', 'FUNCTION', 2),

-- 运维管理权限
-- 团队管理 (menu_id=201)
(101, NOW(), 201, 'deploy:team:list', '团队查询', 'FUNCTION', 1),
(102, NOW(), 201, 'deploy:team:view', '团队详情', 'FUNCTION', 2),
(103, NOW(), 201, 'deploy:team:create', '团队创建', 'FUNCTION', 3),
(104, NOW(), 201, 'deploy:team:update', '团队修改', 'FUNCTION', 4),
(105, NOW(), 201, 'deploy:team:delete', '团队删除', 'FUNCTION', 5),

-- 应用管理 (menu_id=202)
(111, NOW(), 202, 'deploy:application:list', '应用查询', 'FUNCTION', 1),
(112, NOW(), 202, 'deploy:application:view', '应用详情', 'FUNCTION', 2),
(113, NOW(), 202, 'deploy:application:create', '应用创建', 'FUNCTION', 3),
(114, NOW(), 202, 'deploy:application:update', '应用修改', 'FUNCTION', 4),
(115, NOW(), 202, 'deploy:application:delete', '应用删除', 'FUNCTION', 5),

-- 定时任务管理 (menu_id=203)
(121, NOW(), 203, 'deploy:schedule-job:list', '任务查询', 'FUNCTION', 1),
(122, NOW(), 203, 'deploy:schedule-job:view', '任务详情', 'FUNCTION', 2),
(123, NOW(), 203, 'deploy:schedule-job:create', '任务创建', 'FUNCTION', 3),
(124, NOW(), 203, 'deploy:schedule-job:update', '任务修改', 'FUNCTION', 4),
(125, NOW(), 203, 'deploy:schedule-job:delete', '任务删除', 'FUNCTION', 5),
(126, NOW(), 203, 'deploy:schedule-job:start', '启动任务', 'FUNCTION', 6),
(127, NOW(), 203, 'deploy:schedule-job:pause', '暂停任务', 'FUNCTION', 7),
(128, NOW(), 203, 'deploy:schedule-job:resume', '恢复任务', 'FUNCTION', 8),
(129, NOW(), 203, 'deploy:schedule-job:disable', '禁用任务', 'FUNCTION', 9),
(130, NOW(), 203, 'deploy:schedule-job:enable', '启用任务', 'FUNCTION', 10),
(131, NOW(), 203, 'deploy:schedule-job:trigger', '手动触发', 'FUNCTION', 11),

-- 环境管理 (menu_id=204)
(141, NOW(), 204, 'deploy:environment:list', '环境查询', 'FUNCTION', 1),
(142, NOW(), 204, 'deploy:environment:view', '环境详情', 'FUNCTION', 2),
(143, NOW(), 204, 'deploy:environment:create', '环境创建', 'FUNCTION', 3),
(144, NOW(), 204, 'deploy:environment:update', '环境修改', 'FUNCTION', 4),
(145, NOW(), 204, 'deploy:environment:delete', '环境删除', 'FUNCTION', 5),

-- 消息中心 (menu_id=205)
(151, NOW(), 205, 'deploy:notification-channel:list', '通知渠道查询', 'FUNCTION', 1),
(152, NOW(), 205, 'deploy:notification-channel:view', '通知渠道详情', 'FUNCTION', 2),
(153, NOW(), 205, 'deploy:notification-channel:create', '通知渠道创建', 'FUNCTION', 3),
(154, NOW(), 205, 'deploy:notification-channel:update', '通知渠道修改', 'FUNCTION', 4),
(155, NOW(), 205, 'deploy:notification-channel:delete', '通知渠道删除', 'FUNCTION', 5),
(156, NOW(), 205, 'deploy:notification-channel:test', '测试连接', 'FUNCTION', 6),
(157, NOW(), 205, 'deploy:notification-channel:enable', '启用渠道', 'FUNCTION', 7),
(158, NOW(), 205, 'deploy:notification-channel:disable', '禁用渠道', 'FUNCTION', 8),
(159, NOW(), 205, 'deploy:notification-channel:send', '发送通知', 'FUNCTION', 9),

-- 资源管理权限
-- 服务器管理 (menu_id=301)
(201, NOW(), 301, 'resource:server:list', '服务器查询', 'FUNCTION', 1),
(202, NOW(), 301, 'resource:server:view', '服务器详情', 'FUNCTION', 2),
(203, NOW(), 301, 'resource:server:create', '服务器创建', 'FUNCTION', 3),
(204, NOW(), 301, 'resource:server:update', '服务器修改', 'FUNCTION', 4),
(205, NOW(), 301, 'resource:server:delete', '服务器删除', 'FUNCTION', 5),
(206, NOW(), 301, 'resource:server:initialize', '初始化服务器', 'FUNCTION', 6),
(207, NOW(), 301, 'resource:server:test-connection', '测试连接', 'FUNCTION', 7),

-- Jenkins管理 (menu_id=302)
(211, NOW(), 302, 'resource:jenkins-job:list', 'Jenkins任务查询', 'FUNCTION', 1),
(212, NOW(), 302, 'resource:jenkins-job:view', 'Jenkins任务详情', 'FUNCTION', 2),
(213, NOW(), 302, 'resource:jenkins-job:sync', '同步Jenkins任务', 'FUNCTION', 3),

-- Git管理 (menu_id=303)
(221, NOW(), 303, 'resource:repository-project:list', 'Git项目查询', 'FUNCTION', 1),
(222, NOW(), 303, 'resource:repository-project:view', 'Git项目详情', 'FUNCTION', 2),
(223, NOW(), 303, 'resource:repository-project:sync', '同步Git项目', 'FUNCTION', 3),

-- 三方系统管理 (menu_id=304)
(231, NOW(), 304, 'resource:external:list', '三方系统查询', 'FUNCTION', 1),
(232, NOW(), 304, 'resource:external:view', '三方系统详情', 'FUNCTION', 2),
(233, NOW(), 304, 'resource:external:create', '三方系统创建', 'FUNCTION', 3),
(234, NOW(), 304, 'resource:external:update', '三方系统修改', 'FUNCTION', 4),
(235, NOW(), 304, 'resource:external:delete', '三方系统删除', 'FUNCTION', 5),
(236, NOW(), 304, 'resource:external:test-connection', '测试连接', 'FUNCTION', 6),

-- 工作流管理权限
-- 工作流设计 (menu_id=101)
(301, NOW(), 101, 'workflow:definition:list', '工作流查询', 'FUNCTION', 1),
(302, NOW(), 101, 'workflow:definition:view', '工作流详情', 'FUNCTION', 2),
(303, NOW(), 101, 'workflow:definition:create', '工作流创建', 'FUNCTION', 3),
(304, NOW(), 101, 'workflow:definition:update', '工作流修改', 'FUNCTION', 4),
(305, NOW(), 101, 'workflow:definition:delete', '工作流删除', 'FUNCTION', 5),
(306, NOW(), 101, 'workflow:definition:design', '工作流设计', 'FUNCTION', 6),
(307, NOW(), 101, 'workflow:definition:publish', '发布工作流', 'FUNCTION', 7),

-- 工作流实例 (menu_id=102)
(311, NOW(), 102, 'workflow:instance:list', '实例查询', 'FUNCTION', 1),
(312, NOW(), 102, 'workflow:instance:view', '实例详情', 'FUNCTION', 2),
(313, NOW(), 102, 'workflow:instance:start', '启动实例', 'FUNCTION', 3),
(314, NOW(), 102, 'workflow:instance:suspend', '挂起实例', 'FUNCTION', 4),
(315, NOW(), 102, 'workflow:instance:resume', '恢复实例', 'FUNCTION', 5),

-- 动态表单菜单 (menu_id=104)
(321, NOW(), 104, 'workflow:form:list', '表单查询', 'FUNCTION', 1),
(322, NOW(), 104, 'workflow:form:view', '表单详情', 'FUNCTION', 2),
(323, NOW(), 104, 'workflow:form:create', '表单创建', 'FUNCTION', 3),
(324, NOW(), 104, 'workflow:form:update', '表单修改', 'FUNCTION', 4),
(325, NOW(), 104, 'workflow:form:delete', '表单删除', 'FUNCTION', 5),
(326, NOW(), 104, 'workflow:form:publish', '发布表单', 'FUNCTION', 6),

-- 通知模板管理 (menu_id=206)
(2061, NOW(), 206, 'notification:template:view', '查看通知模板', 'FUNCTION', 1),
(2062, NOW(), 206, 'notification:template:create', '新增通知模板', 'FUNCTION', 2),
(2063, NOW(), 206, 'notification:template:update', '编辑通知模板', 'FUNCTION', 3),
(2064, NOW(), 206, 'notification:template:delete', '删除通知模板', 'FUNCTION', 4),
(2065, NOW(), 206, 'notification:template:toggle', '启用/禁用通知模板', 'FUNCTION', 5),
(2066, NOW(), 206, 'notification:template:copy', '复制通知模板', 'FUNCTION', 6),
(2067, NOW(), 206, 'notification:template:preview', '预览通知模板', 'FUNCTION', 7);

--
-- -- 团队配置管理 (无对应菜单，menu_id=NULL)
-- (151, NOW(), NULL, 'deploy:team-config:list', '团队配置查询', 'FUNCTION', 11),
-- (152, NOW(), NULL, 'deploy:team-config:view', '团队配置详情', 'FUNCTION', 12),
-- (153, NOW(), NULL, 'deploy:team-config:update', '团队配置修改', 'FUNCTION', 13),
--
-- -- 团队成员管理 (无对应菜单，menu_id=NULL)
-- (161, NOW(), NULL, 'deploy:team-member:list', '团队成员查询', 'FUNCTION', 21),
-- (162, NOW(), NULL, 'deploy:team-member:view', '团队成员详情', 'FUNCTION', 22),
-- (163, NOW(), NULL, 'deploy:team-member:create', '团队成员创建', 'FUNCTION', 23),
-- (164, NOW(), NULL, 'deploy:team-member:update', '团队成员修改', 'FUNCTION', 24),
-- (165, NOW(), NULL, 'deploy:team-member:delete', '团队成员删除', 'FUNCTION', 25),
--
-- -- 团队应用管理 (无对应菜单，menu_id=NULL)
-- (171, NOW(), NULL, 'deploy:team-application:list', '团队应用查询', 'FUNCTION', 31),
-- (172, NOW(), NULL, 'deploy:team-application:view', '团队应用详情', 'FUNCTION', 32),
-- (173, NOW(), NULL, 'deploy:team-application:create', '团队应用创建', 'FUNCTION', 33),
-- (174, NOW(), NULL, 'deploy:team-application:update', '团队应用修改', 'FUNCTION', 34),
-- (175, NOW(), NULL, 'deploy:team-application:delete', '团队应用删除', 'FUNCTION', 35),
--
-- -- 应用分类管理 (无对应菜单，menu_id=NULL)
-- (181, NOW(), NULL, 'deploy:application-category:list', '应用分类查询', 'FUNCTION', 11),
-- (182, NOW(), NULL, 'deploy:application-category:view', '应用分类详情', 'FUNCTION', 12),
-- (183, NOW(), NULL, 'deploy:application-category:create', '应用分类创建', 'FUNCTION', 13),
-- (184, NOW(), NULL, 'deploy:application-category:update', '应用分类修改', 'FUNCTION', 14),
-- (185, NOW(), NULL, 'deploy:application-category:delete', '应用分类删除', 'FUNCTION', 15),
--
-- -- 服务器分类管理 (无对应菜单，menu_id=NULL)
-- (191, NOW(), NULL, 'deploy:server-category:list', '服务器分类查询', 'FUNCTION', 11),
-- (192, NOW(), NULL, 'deploy:server-category:view', '服务器分类详情', 'FUNCTION', 12),
-- (193, NOW(), NULL, 'deploy:server-category:create', '服务器分类创建', 'FUNCTION', 13),
-- (194, NOW(), NULL, 'deploy:server-category:update', '服务器分类修改', 'FUNCTION', 14),
-- (195, NOW(), NULL, 'deploy:server-category:delete', '服务器分类删除', 'FUNCTION', 15),
--
-- -- 定时任务日志 (无对应菜单，menu_id=NULL)
-- (201, NOW(), NULL, 'deploy:schedule-job-log:list', '任务日志查询', 'FUNCTION', 21),
-- (202, NOW(), NULL, 'deploy:schedule-job-log:view', '任务日志详情', 'FUNCTION', 22),
-- (203, NOW(), NULL, 'deploy:schedule-job-log:delete', '任务日志删除', 'FUNCTION', 23),
--
-- -- 定时任务分类 (无对应菜单，menu_id=NULL)
-- (211, NOW(), NULL, 'deploy:schedule-job-category:list', '任务分类查询', 'FUNCTION', 31),
-- (212, NOW(), NULL, 'deploy:schedule-job-category:view', '任务分类详情', 'FUNCTION', 32),
-- (213, NOW(), NULL, 'deploy:schedule-job-category:create', '任务分类创建', 'FUNCTION', 33),
-- (214, NOW(), NULL, 'deploy:schedule-job-category:update', '任务分类修改', 'FUNCTION', 34),
-- (215, NOW(), NULL, 'deploy:schedule-job-category:delete', '任务分类删除', 'FUNCTION', 35),
--
-- -- 资源管理权限（继续补充）
-- -- 服务器管理 (menu_id=301)
-- (221, NOW(), 301, 'resource:server:list', '服务器查询', 'FUNCTION', 1),
-- (222, NOW(), 301, 'resource:server:view', '服务器详情', 'FUNCTION', 2),
-- (223, NOW(), 301, 'resource:server:create', '服务器创建', 'FUNCTION', 3),
-- (224, NOW(), 301, 'resource:server:update', '服务器修改', 'FUNCTION', 4),
-- (225, NOW(), 301, 'resource:server:delete', '服务器删除', 'FUNCTION', 5),
--
-- -- Jenkins管理 (menu_id=302)
-- (231, NOW(), 302, 'resource:jenkins:list', 'Jenkins查询', 'FUNCTION', 1),
-- (232, NOW(), 302, 'resource:jenkins:view', 'Jenkins详情', 'FUNCTION', 2),
-- (233, NOW(), 302, 'resource:jenkins:create', 'Jenkins创建', 'FUNCTION', 3),
-- (234, NOW(), 302, 'resource:jenkins:update', 'Jenkins修改', 'FUNCTION', 4),
-- (235, NOW(), 302, 'resource:jenkins:delete', 'Jenkins删除', 'FUNCTION', 5),
--
-- -- Jenkins Job管理 (无对应菜单，menu_id=NULL)
-- (241, NOW(), NULL, 'resource:jenkins-job:list', 'Jenkins任务查询', 'FUNCTION', 11),
-- (242, NOW(), NULL, 'resource:jenkins-job:view', 'Jenkins任务详情', 'FUNCTION', 12),
-- (243, NOW(), NULL, 'resource:jenkins-job:create', 'Jenkins任务创建', 'FUNCTION', 13),
-- (244, NOW(), NULL, 'resource:jenkins-job:update', 'Jenkins任务修改', 'FUNCTION', 14),
-- (245, NOW(), NULL, 'resource:jenkins-job:delete', 'Jenkins任务删除', 'FUNCTION', 15),
-- (246, NOW(), NULL, 'resource:jenkins-job:sync', '同步Jenkins任务', 'FUNCTION', 16),
--
-- -- Jenkins View管理 (无对应菜单，menu_id=NULL)
-- (251, NOW(), NULL, 'resource:jenkins-view:list', 'Jenkins视图查询', 'FUNCTION', 21),
-- (252, NOW(), NULL, 'resource:jenkins-view:view', 'Jenkins视图详情', 'FUNCTION', 22),
-- (253, NOW(), NULL, 'resource:jenkins-view:sync', '同步Jenkins视图', 'FUNCTION', 23),
--
-- -- Jenkins Build管理 (无对应菜单，menu_id=NULL)
-- (261, NOW(), NULL, 'resource:jenkins-build:list', '构建记录查询', 'FUNCTION', 31),
-- (262, NOW(), NULL, 'resource:jenkins-build:view', '构建记录详情', 'FUNCTION', 32),
-- (263, NOW(), NULL, 'resource:jenkins-build:sync', '同步构建记录', 'FUNCTION', 33),
--
-- -- Jenkins Sync History (无对应菜单，menu_id=NULL)
-- (271, NOW(), NULL, 'resource:jenkins-sync:list', '同步历史查询', 'FUNCTION', 41),
-- (272, NOW(), NULL, 'resource:jenkins-sync:view', '同步历史详情', 'FUNCTION', 42),
--
-- -- Git管理 (menu_id=303)
-- (281, NOW(), 303, 'resource:git:list', 'Git查询', 'FUNCTION', 1),
-- (282, NOW(), 303, 'resource:git:view', 'Git详情', 'FUNCTION', 2),
-- (283, NOW(), 303, 'resource:git:create', 'Git创建', 'FUNCTION', 3),
-- (284, NOW(), 303, 'resource:git:update', 'Git修改', 'FUNCTION', 4),
-- (285, NOW(), 303, 'resource:git:delete', 'Git删除', 'FUNCTION', 5),
--
-- -- 仓库组管理 (无对应菜单，menu_id=NULL)
-- (291, NOW(), NULL, 'resource:repository-group:list', '仓库组查询', 'FUNCTION', 11),
-- (292, NOW(), NULL, 'resource:repository-group:view', '仓库组详情', 'FUNCTION', 12),
-- (293, NOW(), NULL, 'resource:repository-group:create', '仓库组创建', 'FUNCTION', 13),
-- (294, NOW(), NULL, 'resource:repository-group:update', '仓库组修改', 'FUNCTION', 14),
-- (295, NOW(), NULL, 'resource:repository-group:delete', '仓库组删除', 'FUNCTION', 15),
--
-- -- 仓库项目管理 (无对应菜单，menu_id=NULL)
-- (301, NOW(), NULL, 'resource:repository-project:list', '仓库项目查询', 'FUNCTION', 21),
-- (302, NOW(), NULL, 'resource:repository-project:view', '仓库项目详情', 'FUNCTION', 22),
-- (303, NOW(), NULL, 'resource:repository-project:create', '仓库项目创建', 'FUNCTION', 23),
-- (304, NOW(), NULL, 'resource:repository-project:update', '仓库项目修改', 'FUNCTION', 24),
-- (305, NOW(), NULL, 'resource:repository-project:delete', '仓库项目删除', 'FUNCTION', 25),
-- (306, NOW(), NULL, 'resource:repository-project:sync', '同步仓库项目', 'FUNCTION', 26),
--
-- -- 仓库分支管理 (无对应菜单，menu_id=NULL)
-- (311, NOW(), NULL, 'resource:repository-branch:list', '仓库分支查询', 'FUNCTION', 31),
-- (312, NOW(), NULL, 'resource:repository-branch:view', '仓库分支详情', 'FUNCTION', 32),
-- (313, NOW(), NULL, 'resource:repository-branch:sync', '同步仓库分支', 'FUNCTION', 33),
--
-- -- 三方系统管理 (menu_id=304)
-- (321, NOW(), 304, 'resource:external:list', '三方系统查询', 'FUNCTION', 1),
-- (322, NOW(), 304, 'resource:external:view', '三方系统详情', 'FUNCTION', 2),
-- (323, NOW(), 304, 'resource:external:create', '三方系统创建', 'FUNCTION', 3),
-- (324, NOW(), 304, 'resource:external:update', '三方系统修改', 'FUNCTION', 4),
-- (325, NOW(), 304, 'resource:external:delete', '三方系统删除', 'FUNCTION', 5),
--
-- -- 工作流管理权限（继续补充）
-- -- 工作流设计 (menu_id=101)
-- (331, NOW(), 101, 'workflow:definition:list', '工作流查询', 'FUNCTION', 1),
-- (332, NOW(), 101, 'workflow:definition:view', '工作流详情', 'FUNCTION', 2),
-- (333, NOW(), 101, 'workflow:definition:create', '工作流创建', 'FUNCTION', 3),
-- (334, NOW(), 101, 'workflow:definition:update', '工作流修改', 'FUNCTION', 4),
-- (335, NOW(), 101, 'workflow:definition:delete', '工作流删除', 'FUNCTION', 5),
--
-- -- 工作流实例 (menu_id=102)
-- (341, NOW(), 102, 'workflow:instance:list', '实例查询', 'FUNCTION', 1),
-- (342, NOW(), 102, 'workflow:instance:view', '实例详情', 'FUNCTION', 2),
-- (343, NOW(), 102, 'workflow:instance:create', '实例创建', 'FUNCTION', 3),
-- (344, NOW(), 102, 'workflow:instance:update', '实例修改', 'FUNCTION', 4),
-- (345, NOW(), 102, 'workflow:instance:delete', '实例删除', 'FUNCTION', 5),
--
-- -- 节点定义管理 (无对应菜单，menu_id=NULL)
-- (351, NOW(), NULL, 'workflow:node-definition:list', '节点定义查询', 'FUNCTION', 11),
-- (352, NOW(), NULL, 'workflow:node-definition:view', '节点定义详情', 'FUNCTION', 12),
-- (353, NOW(), NULL, 'workflow:node-definition:create', '节点定义创建', 'FUNCTION', 13),
-- (354, NOW(), NULL, 'workflow:node-definition:update', '节点定义修改', 'FUNCTION', 14),
-- (355, NOW(), NULL, 'workflow:node-definition:delete', '节点定义删除', 'FUNCTION', 15),
--
-- -- 节点实例管理 (无对应菜单，menu_id=NULL)
-- (361, NOW(), NULL, 'workflow:node-instance:list', '节点实例查询', 'FUNCTION', 11),
-- (362, NOW(), NULL, 'workflow:node-instance:view', '节点实例详情', 'FUNCTION', 12),
-- (363, NOW(), NULL, 'workflow:node-instance:update', '节点实例修改', 'FUNCTION', 13),
-- (364, NOW(), NULL, 'workflow:node-instance:delete', '节点实例删除', 'FUNCTION', 15),
--
-- -- 工作流分类 (无对应菜单，menu_id=NULL)
-- (371, NOW(), NULL, 'workflow:category:list', '工作流分类查询', 'FUNCTION', 21),
-- (372, NOW(), NULL, 'workflow:category:view', '工作流分类详情', 'FUNCTION', 22),
-- (373, NOW(), NULL, 'workflow:category:create', '工作流分类创建', 'FUNCTION', 23),
-- (374, NOW(), NULL, 'workflow:category:update', '工作流分类修改', 'FUNCTION', 24),
-- (375, NOW(), NULL, 'workflow:category:delete', '工作流分类删除', 'FUNCTION', 25),
--
-- -- 动态表单菜单 (menu_id=104)
-- (381, NOW(), 104, 'workflow:form:list', '表单查询', 'FUNCTION', 1),
-- (382, NOW(), 104, 'workflow:form:view', '表单详情', 'FUNCTION', 2),
-- (383, NOW(), 104, 'workflow:form:create', '表单创建', 'FUNCTION', 3),
-- (384, NOW(), 104, 'workflow:form:update', '表单修改', 'FUNCTION', 4),
-- (385, NOW(), 104, 'workflow:form:delete', '表单删除', 'FUNCTION', 5),
--
-- -- 表单数据管理 (无对应菜单，menu_id=NULL)
-- (391, NOW(), NULL, 'workflow:form-data:list', '表单数据查询', 'FUNCTION', 11),
-- (392, NOW(), NULL, 'workflow:form-data:view', '表单数据详情', 'FUNCTION', 12),
-- (393, NOW(), NULL, 'workflow:form-data:create', '表单数据创建', 'FUNCTION', 13),
-- (394, NOW(), NULL, 'workflow:form-data:update', '表单数据修改', 'FUNCTION', 14),
-- (395, NOW(), NULL, 'workflow:form-data:delete', '表单数据删除', 'FUNCTION', 15),
--
-- -- 表单分类管理 (无对应菜单，menu_id=NULL)
-- (401, NOW(), NULL, 'workflow:form-category:list', '表单分类查询', 'FUNCTION', 21),
-- (402, NOW(), NULL, 'workflow:form-category:view', '表单分类详情', 'FUNCTION', 22),
-- (403, NOW(), NULL, 'workflow:form-category:create', '表单分类创建', 'FUNCTION', 23),
-- (404, NOW(), NULL, 'workflow:form-category:update', '表单分类修改', 'FUNCTION', 24),
-- (405, NOW(), NULL, 'workflow:form-category:delete', '表单分类删除', 'FUNCTION', 25),
--
-- -- 审批任务管理 (无对应菜单，menu_id=NULL)
-- (411, NOW(), NULL, 'workflow:approval:list', '审批任务查询', 'FUNCTION', 21),
-- (412, NOW(), NULL, 'workflow:approval:view', '审批任务详情', 'FUNCTION', 22),
-- (413, NOW(), NULL, 'workflow:approval:approve', '审批任务通过', 'FUNCTION', 23),
-- (414, NOW(), NULL, 'workflow:approval:reject', '审批任务驳回', 'FUNCTION', 24),
-- (415, NOW(), NULL, 'workflow:approval:transfer', '审批任务转交', 'FUNCTION', 25),
--
-- -- 系统管理权限（继续补充）
-- -- 角色标签管理 (无对应菜单，menu_id=NULL)
-- (421, NOW(), NULL, 'system:role-tag:list', '角色标签查询', 'FUNCTION', 11),
-- (422, NOW(), NULL, 'system:role-tag:view', '角色标签详情', 'FUNCTION', 12),
-- (423, NOW(), NULL, 'system:role-tag:create', '角色标签创建', 'FUNCTION', 13),
-- (424, NOW(), NULL, 'system:role-tag:update', '角色标签修改', 'FUNCTION', 14),
-- (425, NOW(), NULL, 'system:role-tag:delete', '角色标签删除', 'FUNCTION', 15),
--
-- -- 通知管理权限
-- -- 通知渠道管理 (无对应菜单，menu_id=NULL)
-- (431, NOW(), NULL, 'notification:channel:list', '通知渠道查询', 'FUNCTION', 11),
-- (432, NOW(), NULL, 'notification:channel:view', '通知渠道详情', 'FUNCTION', 12),
-- (433, NOW(), NULL, 'notification:channel:create', '通知渠道创建', 'FUNCTION', 13),
-- (434, NOW(), NULL, 'notification:channel:update', '通知渠道修改', 'FUNCTION', 14),
-- (435, NOW(), NULL, 'notification:channel:delete', '通知渠道删除', 'FUNCTION', 15);

-- ==================== 分配权限给角色 ====================
DELETE FROM sys_role_permission;

-- 管理员拥有所有权限
INSERT INTO sys_role_permission (role_id, permission_id)
VALUES 
(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 11), (1, 12), (1, 13), (1, 14), (1, 15), (1, 16), (1, 17), (1, 18), (1, 21), (1, 22), (1, 23), (1, 24), (1, 25), (1, 26), (1, 27), (1, 31), (1, 32), (1, 33), (1, 34), (1, 35), (1, 41), (1, 42), (1, 43), (1, 44), (1, 45), (1, 46), (1, 51), (1, 52), (1, 101), (1, 102), (1, 103), (1, 104), (1, 105), (1, 111), (1, 112), (1, 113), (1, 114), (1, 115), (1, 121), (1, 122), (1, 123), (1, 124), (1, 125), (1, 126), (1, 127), (1, 128), (1, 129), (1, 130), (1, 131), (1, 141), (1, 142), (1, 143), (1, 144), (1, 145), (1, 151), (1, 152), (1, 153), (1, 154), (1, 155), (1, 156), (1, 157), (1, 158), (1, 159), (1, 201), (1, 202), (1, 203), (1, 204), (1, 205), (1, 206), (1, 207), (1, 211), (1, 212), (1, 213), (1, 221), (1, 222), (1, 223), (1, 231), (1, 232), (1, 233), (1, 234), (1, 235), (1, 236), (1, 301), (1, 302), (1, 303), (1, 304), (1, 305), (1, 306), (1, 307), (1, 311), (1, 312), (1, 313), (1, 314), (1, 315), (1, 321), (1, 322), (1, 323), (1, 324), (1, 325), (1, 326), (1, 501), (1, 502), (1, 503), (1, 504), (1, 505), (1, 506), (1, 2061), (1, 2062), (1, 2063), (1, 2064), (1, 2065), (1, 2066), (1, 2067);

-- 运维角色权限
INSERT INTO sys_role_permission (role_id, permission_id)
VALUES 
(2, 101), (2, 102), (2, 103), (2, 104), (2, 105), (2, 111), (2, 112), (2, 113), (2, 114), (2, 115), (2, 121), (2, 122), (2, 123), (2, 124), (2, 125), (2, 126), (2, 127), (2, 128), (2, 129), (2, 130), (2, 131), (2, 141), (2, 142), (2, 143), (2, 144), (2, 145), (2, 151), (2, 152), (2, 153), (2, 154), (2, 155), (2, 156), (2, 157), (2, 158), (2, 159);

-- 开发角色权限
INSERT INTO sys_role_permission (role_id, permission_id)
VALUES 
(3, 501), (3, 502), (3, 503), (3, 504), (3, 505), (3, 506);

-- 初始化权限模板
INSERT INTO sys_permission_template (id, create_time, code, name, type, description, enabled)
VALUES 
(1, NOW(), 'FULL_PERMISSION', '完整权限模板', 1, '包含所有系统权限的模板', 1),
(2, NOW(), 'BASIC_PERMISSION', '基础权限模板', 1, '包含基本操作权限的模板', 1);

-- 初始化模板菜单关联
INSERT INTO sys_template_menu (template_id, menu_id)
SELECT 1, id FROM sys_menu;  -- 完整权限模板关联所有菜单

INSERT INTO sys_template_menu (template_id, menu_id)
VALUES (2, 304);  -- 基础权限模板关联三方系统菜单

-- --------------------------------------------------------------------------------------
-- 初始化外部系统数据
-- --------------------------------------------------------------------------------------
-- 注意：password和token字段支持加密存储（AES-256）
-- 1. 初始化数据可以使用明文，首次编辑保存时会自动加密
-- 2. 表结构已扩展为VARCHAR(500)以容纳加密后的数据
-- 3. 生产环境建议通过管理界面添加外部系统，避免在SQL中暴露明文密码
-- --------------------------------------------------------------------------------------

-- 初始化外部系统（密码和Token已加密）
INSERT INTO sys_external_system (
    id, create_by, create_time, deleted, update_by, update_time, version,
    name, type, url, remark, sort, enabled, auth_type, username, password, token,
    sync_status, last_sync_time, last_connect_time, config
) VALUES 
(1, 'admin', NOW(), 0, 'admin', NOW(), 9,
 '链宇JENKINS', 'JENKINS', 'https://ly-jenkins.iscmtech.com', '链宇JENKINS', 1, 1,
 'BASIC', 'admin', 'b2d6f7e59ba92d0e7e5924018cfd91d61c1faf16b38daaaad27b9b273068c45ce9ace612c33800454db4c8099a5802ae', NULL,
 'SUCCESS', NOW(), NOW(), NULL),

(2, 'admin', NOW(), 0, 'admin', NOW(), 12,
 '链宇GIT', 'GIT', 'https://ly-gitlab.iscmtech.com/', NULL, 1, 1,
 'TOKEN', NULL, NULL, 'a966e69226d353d020f8e21021cf88b0e688768720afc34bc7cb544bf42aa4ff77ce4c2f8b8fa52b19c2bfd4ef7d310c',
 NULL, NULL, NOW(), NULL),

(3, 'admin', NOW(), 0, 'admin', NOW(), 12,
 '隆基JENKINS（代理）', 'JENKINS', 'https://develop1.iscmtech.com/longi/jenkins/', NULL, 1, 1,
 'BASIC', 'ibpuser', 'a3d0c50bcb2eef22230d0be1699d03f940c9fbe930a3b172cd34da193f96fefe', NULL,
 NULL, NULL, NOW(), NULL),

(4, 'admin', NOW(), 0, 'admin', NOW(), 18,
 '隆基GIT（代理）', 'GIT', 'https://develop1.iscmtech.com/longi/git/', 'bLxnkjN4Tq3W7zSwumsW', 1, 1,
 'TOKEN', 'admin', '0e4b34f53cbc8a337f92925256d0bfa2343c318521cebcc897b3a7b3f280ef8db6e5d90f2a70bba07bc7972d552fb50ffe143d7e7e1bd6ce8362e52dde500dcbebdf54b53ee06c2d7c49959d20786abf64bae5702f9e2c4a762d33d72c3c441a64066d97377a3a1190511e083dcdc178c60fc05d0c54ceaf15edbefc1b46f55a9d229bc1d88a6c0102251f25d30c490ea19158351acfb799d87c0be98ad1d2d13731ec0395bf81f54c7d51160039e6fb647562f68c0208a535519e2b52b08c7641e1c173695d7de4c2051ac35d9188103886e8ac9202a3410c44016bb336bbd1', 'd8c67ef9009640cff636ebde8f5ff19b3ae352ab068cec2159f6ea42193664794a191eb5e4ad2852f42d21c27922307e',
 NULL, NULL, NOW(), NULL),

(5, 'admin', NOW(), 0, 'admin', NOW(), 7,
 '链宇本地JENKINS', 'JENKINS', 'http://192.168.2.201:9096/', NULL, 1, 1,
 'BASIC', 'admin', '1953e9314f6e81d616f7e4e6d0aab0c581b25581280be8858d602cfe81d698ee782de42eeb8e0d288d60414bbbb5cd89', NULL,
 NULL, NULL, NOW(), NULL),

(6, 'admin', NOW(), 0, 'admin', NOW(), 3,
 '供应计划GIT', 'GIT', 'http://192.168.1.74:18888', NULL, 1, 1,
 'TOKEN', 'admin', '1efa55a082da05c7b744ab09aa819f3950627215d0352e0f0197880ec2c9f75b', '9aa1357bf0823ee2027818ff07a850d9bd82fc07d62e03ad42250a6dce9c6417c5cb01caf65f5e77b85f2c4936fc1209',
 NULL, NULL, NOW(), NULL);

-- --------------------------------------------------------------------------------------
-- 初始化工作流相关数据
-- --------------------------------------------------------------------------------------

-- 工作流分类初始数据
INSERT INTO workflow_category (name, code, description, icon, sort, supported_triggers, enabled, create_by, create_time, update_by, update_time, version, deleted)
VALUES
('脚本执行', 'SCRIPT_EXECUTION', '用于执行各类脚本的流程', 'CodeOutlined', 1, '["MANUAL","SCHEDULED"]', 1, 'system', NOW(), 'system', NOW(), 0, 0),
('应用部署', 'DEPLOYMENT', '用于应用部署的流程', 'DeploymentUnitOutlined', 2, '["MANUAL","SCHEDULED","APPROVAL"]', 1, 'system', NOW(), 'system', NOW(), 0, 0),
('数据同步', 'DATA_SYNC', '用于第三方系统数据同步的流程', 'SyncOutlined', 3, '["MANUAL","SCHEDULED"]', 1, 'system', NOW(), 'system', NOW(), 0, 0),
('配置同步', 'CONFIG_SYNC', '用于配置中心数据同步的流程', 'SettingOutlined', 4, '["MANUAL","APPROVAL"]', 1, 'system', NOW(), 'system', NOW(), 0, 0),
('审批流程', 'APPROVAL', '纯审批流程', 'AuditOutlined', 5, '["MANUAL"]', 1, 'system', NOW(), 'system', NOW(), 0, 0),
('其他', 'OTHER', '其他类型流程', 'AppstoreOutlined', 99, '["MANUAL"]', 1, 'system', NOW(), 'system', NOW(), 0, 0);

-- 表单分类初始数据
INSERT INTO form_category (name, code, description, icon, sort, enabled, create_by, create_time, update_by, update_time, version, deleted)
VALUES
('审批表单', 'APPROVAL', '用于审批流程的表单', 'CheckCircleOutlined', 1, 1, 'system', NOW(), 'system', NOW(), 0, 0),
('数据采集', 'DATA_COLLECTION', '用于数据采集的表单', 'DatabaseOutlined', 2, 1, 'system', NOW(), 'system', NOW(), 0, 0),
('问卷调查', 'SURVEY', '用于问卷调查的表单', 'FormOutlined', 3, 1, 'system', NOW(), 'system', NOW(), 0, 0),
('其他', 'OTHER', '其他类型的表单', 'FileOutlined', 99, 1, 'system', NOW(), 'system', NOW(), 0, 0);

-- 表单定义数据（schema字段已压缩为单行JSON）
INSERT INTO form_definition (
    id, name, `key`, form_version, category_id, description, `schema`, tags, status, is_template,
    create_by, create_time, update_by, update_time, version, deleted
) VALUES
(2, '部署表单', 'deploy-form', 1, 4, '', '{"fields":[{"id":"field_1762752319676_e1xws30b1","name":"grid_1762752319676","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752361412_f30h9gjou","name":"jenkins.serverId","type":"input","label":"JENKINS服务器","hidden":true,"required":false,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752334430_66a0kzims","name":"grid_1762752319676_copy_1762752334430","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752390005_a50w8lszi","name":"jenkins.jobName","type":"input","label":"jobName","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752335032_8bky41k4c","name":"grid_1762752319676_copy_1762752335032","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752418342_8inxz8rvi","name":"jenkins.branch","type":"input","label":"分支","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752335398_5xhewg0zq","name":"grid_1762752319676_copy_1762752335398","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752438046_6twc4raqr","name":"teamId","type":"input","label":"teamId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752335577_0x4amo9qf","name":"grid_1762752319676_copy_1762752335577","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752448941_i82959069","name":"teamApplicationId","type":"input","label":"teamApplicationId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752335769_0qiosnz76","name":"grid_1762752319676_copy_1762752335769","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752459828_bepmj343m","name":"applicationId","type":"input","label":"applicationId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752335942_131m2qjq6","name":"grid_1762752319676_copy_1762752335942","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752474328_73gkcmzq7","name":"applicationCode","type":"input","label":"applicationCode","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752336090_89by9g7th","name":"grid_1762752319676_copy_1762752336090","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752482872_wz9x42mw3","name":"applicationName","type":"input","label":"applicationName","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752336283_f3bxgxm6r","name":"grid_1762752319676_copy_1762752336283","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752497372_cdy3hw5wv","name":"environmentId","type":"input","label":"environmentId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752336459_m385kcntl","name":"grid_1762752319676_copy_1762752336459","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752491499_1x19c8nii","name":"environmentCode","type":"input","label":"environmentCode","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752336623_ucx26c6gz","name":"grid_1762752319676_copy_1762752336623","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752517722_cf7urti6m","name":"environmentName","type":"input","label":"environmentName","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752336800_0oyor17da","name":"grid_1762752319676_copy_1762752336800","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752531624_3ts5glb6a","name":"approval.required","type":"input","label":"approval.required","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752336961_wvkhpamoc","name":"grid_1762752319676_copy_1762752336961","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752551116_45izftfxb","name":"approval.userNames","type":"input","label":"approval.userNames","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752337312_p7sycmpz7","name":"grid_1762752319676_copy_1762752337312","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752593304_st091maez","name":"notification.notificationChannelId","type":"input","label":"notification.notificationChannelId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1763083334603_4lilw52rl","name":"grid_1762752319676_copy_1762752337137_copy_1763083311988_copy_1763083334603","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1763083334603_7k9h8bbjo","name":"notification.preApprovalNotificationEnabled","type":"input","label":"notification.preApprovalNotificationEnabled","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752337137_j3c61hpyo","name":"grid_1762752319676_copy_1762752337137","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752611613_53p41q60n","name":"notification.diffNotificationTemplateId","type":"input","label":"notification.diffNotificationTemplateId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1763083311988_gv2xmdyx8","name":"grid_1762752319676_copy_1762752337137_copy_1763083311988","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1763083311988_i1e1wgifa","name":"notification.preApprovalNotificationTemplateId","type":"input","label":"notification.preApprovalNotificationTemplateId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1763083335787_v48wsdpfo","name":"grid_1762752319676_copy_1762752337137_copy_1763083311988_copy_1763083335787","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1763083335787_ooy472ae9","name":"notification.buildNotificationEnabled","type":"input","label":"notification.buildNotificationEnabled","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1763083336723_tgg9f4mmm","name":"grid_1762752319676_copy_1762752337137_copy_1763083311988_copy_1763083336723","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1763083336723_89tbrzif1","name":"notification.buildNotificationTemplateId","type":"input","label":"notification.buildNotificationTemplateId","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1763083337546_m3ll1juva","name":"grid_1762752319676_copy_1762752337137_copy_1763083311988_copy_1763083337546","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1763083337546_gkmdgnrua","name":"notification.buildFailureFileEnabled","type":"input","label":"notification.buildFailureFileEnabled","hidden":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1764840600568_1wx1u41dn","name":"grid_1762752611613_copy_1763175632590_copy_1764840600568","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1764840600568_y86iq0p2p","name":"sourceRepository.systemId","type":"input","label":"sourceRepository.systemId","hidden":true,"required":true,"placeholder":"请输入","validationRules":[]}],[]],"columnSpans":[4,16,4]},{"id":"field_1764840651019_4hfu2no9x","name":"grid_1762752611613_copy_1763175632590_copy_1764840600568_copy_1764840651019","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1764840651019_4pqkrtq51","name":"sourceRepository.projectId","type":"input","label":"sourceRepository.projectId","hidden":true,"required":true,"placeholder":"请输入","validationRules":[]}],[]],"columnSpans":[4,16,4]},{"id":"field_1764840687061_oklskdh7l","name":"grid_1762752611613_copy_1763175632590_copy_1764840600568_copy_1764840651019_copy_1764840687061","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1764840687061_rrzoz2r6v","name":"sourceRepository.branch","type":"input","label":"sourceRepository.branch","hidden":true,"required":true,"placeholder":"请输入","validationRules":[]}],[]],"columnSpans":[4,16,4]},{"id":"field_1764840701760_kh8d6xuh0","name":"grid_1762752611613_copy_1763175632590_copy_1764840600568_copy_1764840651019_copy_1764840687061_copy_1764840701760","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1764840701760_h6nsr16i7","name":"targetRepository.projectId","type":"input","label":"targetRepository.projectId","hidden":true,"required":true,"placeholder":"请输入","validationRules":[]}],[]],"columnSpans":[4,16,4]},{"id":"field_1764840701235_mefcrmow6","name":"grid_1762752611613_copy_1763175632590_copy_1764840600568_copy_1764840651019_copy_1764840687061_copy_1764840701235","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1764840701235_rqipw1duz","name":"targetRepository.systemId","type":"input","label":"targetRepository.systemId","hidden":true,"required":true,"placeholder":"请输入","validationRules":[]}],[]],"columnSpans":[4,16,4]},{"id":"field_1764840702192_00wdhyb8p","name":"grid_1762752611613_copy_1763175632590_copy_1764840600568_copy_1764840651019_copy_1764840687061_copy_1764840702192","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1764840702192_ueel90096","name":"targetRepository.branch","type":"input","label":"targetRepository.branch","hidden":true,"required":true,"placeholder":"请输入","validationRules":[]}],[]],"columnSpans":[4,16,4]},{"id":"field_1762752611613_7fwwwheii","name":"grid_1762752611613","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1762752617388_qisqw9kxo","name":"deployUser","type":"input","label":"部署人","hidden":true,"required":true,"placeholder":"请输入"}],[]],"columnSpans":[4,16,4]},{"id":"field_1763175632590_dxl45pyit","name":"grid_1762752611613_copy_1763175632590","type":"grid","label":"栅格布局","gutter":16,"columns":3,"children":[[],[{"id":"field_1763175632590_ifgs4x8zm","name":"deployRemark","type":"input","label":"部署内容","required":true,"placeholder":"请输入","validationRules":[{"type":"pattern","value":"/^\\\\[(task|bugfix)-\\\\d+\\\\].+$/","message":"请填写正确的[task-x]或者[bugfix-x]","trigger":"blur"}]}],[]],"columnSpans":[4,16,4]}],"version":"1.0","formConfig":{"size":"middle","labelAlign":"top"}}', 
 NULL, 'PUBLISHED', 0, 'admin', NOW(), 'admin', NOW(), 0, 0);

-- 工作流定义数据（graph字段已压缩为单行JSON）
-- 注意：graph字段包含完整的流程图配置，数据较大
INSERT INTO `deploy-ease-platform`.`workflow_definition` (`id`, `name`, `key`, `category_id`, `form_definition_id`, `process_definition_id`, `flow_version`, `description`, `bpmn_xml`, `graph`, `status`, `create_by`, `create_time`, `deleted`, `update_by`, `update_time`, `version`) VALUES (1, 'JENKINS部署项目流程', 'jenkins-deploy-project-workflow', 2, 2, '', 1, '', '', '{\"edges\": [{\"id\": \"eid_a56acab7_5877_489d_a798_40ac0e3f7269\", \"to\": \"sid_20005e1e_f5e1_4ae7_a2cd_18e58434e095\", \"from\": \"sid_f1188946_c6ff_4480_964e_82f65fdcc514\", \"name\": \"${approval.required == \'true\'}\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"EXPRESSION\", \"priority\": 10, \"expression\": \"${approval.required == \'true\'}\"}}, \"vertices\": [{\"x\": -307, \"y\": -457}, {\"x\": -150, \"y\": -630}, {\"x\": 8, \"y\": -802}]}, {\"id\": \"eid_3a6a1429_8b9e_4b99_a762_3a99e6edc511\", \"to\": \"sid_ef9e9d5a_a6ac_4140_bac7_1747f0eab188\", \"from\": \"sid_f1188946_c6ff_4480_964e_82f65fdcc514\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": [{\"x\": -214, \"y\": -154}, {\"x\": 38, \"y\": -22}, {\"x\": 289, \"y\": 109}]}, {\"id\": \"eid_e80dd7a8_d81a_43b4_8dd4_9a5fa21d80dd\", \"to\": \"sid_ef9e9d5a_a6ac_4140_bac7_1747f0eab188\", \"from\": \"sid_20005e1e_f5e1_4ae7_a2cd_18e58434e095\", \"name\": \"${sid_20005e1e_f5e1_4ae7_a2cd_18e58434e095.outputs.approvalResult == \'APPROVED\'}\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"EXPRESSION\", \"priority\": 10, \"expression\": \"${sid_20005e1e_f5e1_4ae7_a2cd_18e58434e095.outputs.approvalResult == \'APPROVED\'}\"}}, \"vertices\": []}, {\"id\": \"eid_3eecd0ca_81e2_460f_a650_7ac2edc45bc8\", \"to\": \"sid_90bb343a_9bf9_48c4_be7c_334aeb71bf9d\", \"from\": \"sid_ef9e9d5a_a6ac_4140_bac7_1747f0eab188\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}, {\"id\": \"eid_1291d31c_5edf_475d_8f85_fd3ac232f487\", \"to\": \"sid_90bb343a_9bf9_48c4_be7c_334aeb71bf9d\", \"from\": \"sid_20005e1e_f5e1_4ae7_a2cd_18e58434e095\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}, {\"id\": \"eid_ee1b5152_2eb0_4013_9ab6_8d88561d2801\", \"to\": \"sid_e5f930da_062e_4819_b976_8d8172c7f14a\", \"from\": \"sid_dc8b078d_be3e_4644_b8c5_ed077e32dab2\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}, {\"id\": \"eid_ac3aca2b_a52a_4a91_a880_73a6757d030f\", \"to\": \"sid_0d0eb0be_a427_4966_8114_475ebeb5e724\", \"from\": \"sid_e5f930da_062e_4819_b976_8d8172c7f14a\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}, {\"id\": \"eid_d206c7b5_d839_4a53_ad24_976d91466f94\", \"to\": \"sid_f1188946_c6ff_4480_964e_82f65fdcc514\", \"from\": \"sid_0d0eb0be_a427_4966_8114_475ebeb5e724\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 999}}, \"vertices\": []}, {\"id\": \"eid_bd62e311_dd06_418d_ba98_e5e6cdb7a083\", \"to\": \"sid_ee2f5ea0_48d3_40dd_8ba3_5595ad49eb63\", \"from\": \"sid_0d0eb0be_a427_4966_8114_475ebeb5e724\", \"name\": \"${sid_e5f930da_062e_4819_b976_8d8172c7f14a.outputs.status == \'FAILURE\'}\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"EXPRESSION\", \"priority\": 10, \"expression\": \"${sid_e5f930da_062e_4819_b976_8d8172c7f14a.outputs.hasDifference == true}\"}}, \"vertices\": []}, {\"id\": \"eid_ce499e46_99db_4519_867c_d9d65a53b62e\", \"to\": \"sid_f1188946_c6ff_4480_964e_82f65fdcc514\", \"from\": \"sid_ee2f5ea0_48d3_40dd_8ba3_5595ad49eb63\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}], \"nodes\": [{\"id\": \"sid_dc8b078d_be3e_4644_b8c5_ed077e32dab2\", \"configs\": {\"nodeCode\": \"START_EVENT\", \"nodeName\": \"开始\", \"description\": \"工作流的起始节点\"}, \"outputs\": [], \"nodeCode\": \"START_EVENT\", \"nodeName\": \"开始\", \"nodeType\": \"START_EVENT\", \"position\": {\"x\": -2025, \"y\": -225}, \"inputMapping\": {}}, {\"id\": \"sid_ef9e9d5a_a6ac_4140_bac7_1747f0eab188\", \"configs\": {\"nodeCode\": \"JENKINS_BUILD\", \"nodeName\": \"Jenkins构建\", \"description\": \"通过Jenkins执行构建任务\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": [\"SUCCESS\", \"FAILURE\", \"ABORTED\", \"NOT_FOUND\"], \"name\": \"buildStatus\", \"type\": \"string\", \"title\": \"构建状态\", \"example\": null, \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": null, \"name\": \"buildNumber\", \"type\": \"number\", \"title\": \"构建编号\", \"example\": 123, \"required\": true, \"description\": \"Jenkins构建的唯一编号\"}, {\"enum\": null, \"name\": \"buildUrl\", \"type\": \"string\", \"title\": \"构建URL\", \"example\": \"http://jenkins.example.com/job/app/123/\", \"required\": true, \"description\": \"Jenkins构建页面的访问地址\"}, {\"enum\": null, \"name\": \"artifactUrl\", \"type\": \"string\", \"title\": \"构建产物地址\", \"example\": \"http://jenkins.example.com/job/app/123/artifact/target/app-1.0.0.jar\", \"required\": false, \"description\": \"构建生成的jar/war包下载地址\"}, {\"enum\": null, \"name\": \"gitCommitId\", \"type\": \"string\", \"title\": \"Git提交ID\", \"example\": \"a3f5e8d2c4b1a5e9f2d3e7b8c9d1a2f3e4b5c6d7\", \"required\": true, \"description\": \"本次构建使用的Git提交哈希值\"}, {\"enum\": null, \"name\": \"buildDuration\", \"type\": \"number\", \"title\": \"构建时长\", \"example\": 120, \"required\": true, \"description\": \"构建执行的时长（秒）\"}, {\"enum\": null, \"name\": \"buildDurationMillis\", \"type\": \"number\", \"title\": \"构建时长(毫秒)\", \"example\": 158000, \"required\": false, \"description\": \"构建执行的时长（毫秒）\"}, {\"enum\": null, \"name\": \"buildDurationFormatted\", \"type\": \"string\", \"title\": \"构建时长(格式)\", \"example\": \"00:02:39\", \"required\": false, \"description\": \"构建执行的时长（格式：HH:mm:ss）\"}, {\"enum\": null, \"name\": \"buildEndTimeMillis\", \"type\": \"number\", \"title\": \"部署结束时间(ms)\", \"example\": 1700000000000, \"required\": false, \"description\": \"部署结束时间（毫秒）\"}, {\"enum\": null, \"name\": \"buildEndTime\", \"type\": \"string\", \"title\": \"部署结束时间\", \"example\": \"2025-11-14 15:30:00\", \"required\": false, \"description\": \"部署结束时间（格式化）\"}], \"nodeCode\": \"JENKINS_BUILD\", \"nodeName\": \"Jenkins构建\", \"nodeType\": \"JENKINS_BUILD\", \"position\": {\"x\": 435, \"y\": -315}, \"inputMapping\": {\"jobName\": \"${jenkins.jobName}\", \"serverId\": \"${jenkins.serverId}\", \"continueOnFailure\": true}}, {\"id\": \"sid_90bb343a_9bf9_48c4_be7c_334aeb71bf9d\", \"configs\": {\"nodeCode\": \"END_EVENT\", \"nodeName\": \"结束\", \"description\": \"工作流的结束节点\"}, \"outputs\": [], \"nodeCode\": \"END_EVENT\", \"nodeName\": \"结束\", \"nodeType\": \"END_EVENT\", \"position\": {\"x\": 2100, \"y\": -210}, \"inputMapping\": {}}, {\"id\": \"sid_20005e1e_f5e1_4ae7_a2cd_18e58434e095\", \"configs\": {\"nodeCode\": \"APPROVAL\", \"nodeName\": \"审批部署\", \"description\": \"人工审批节点，支持多种审批模式\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": [\"APPROVED\", \"REJECTED\", \"TIMEOUT\"], \"name\": \"approvalResult\", \"type\": \"string\", \"title\": \"审批结果\", \"example\": \"APPROVED\", \"required\": true, \"description\": \"审批的最终结果\"}, {\"enum\": null, \"name\": \"approver\", \"type\": \"string\", \"title\": \"审批人\", \"example\": \"张三\", \"required\": true, \"description\": \"实际执行审批的用户\"}, {\"enum\": null, \"name\": \"approverUserId\", \"type\": \"number\", \"title\": \"审批人ID\", \"example\": 1001, \"required\": true, \"description\": \"审批人的用户ID\"}, {\"enum\": null, \"name\": \"approvalTime\", \"type\": \"string\", \"title\": \"审批时间\", \"example\": \"2025-10-23T10:30:00Z\", \"required\": true, \"description\": \"审批完成的时间\"}, {\"enum\": null, \"name\": \"approvalComment\", \"type\": \"string\", \"title\": \"审批意见\", \"example\": \"同意发布到生产环境\", \"required\": false, \"description\": \"审批人填写的意见\"}, {\"enum\": null, \"name\": \"approvalDuration\", \"type\": \"number\", \"title\": \"审批用时（秒）\", \"example\": 3600, \"required\": true, \"description\": \"从创建到完成审批的时长\"}, {\"enum\": null, \"name\": \"allApprovers\", \"type\": \"array\", \"title\": \"所有审批人\", \"example\": [{\"time\": \"2025-10-23T10:30:00Z\", \"result\": \"APPROVED\", \"userId\": 1001, \"comment\": \"同意\", \"userName\": \"张三\"}], \"required\": false, \"description\": \"参与审批的所有人员列表（会签/或签时），格式：[{userId, userName, result, comment, time}]\"}], \"nodeCode\": \"APPROVAL\", \"nodeName\": \"审批部署\", \"nodeType\": \"APPROVAL\", \"position\": {\"x\": -45, \"y\": -900}, \"inputMapping\": {\"allowAddSign\": false, \"approvalMode\": \"ANY\", \"approverType\": \"VARIABLE\", \"allowDelegate\": false, \"approvalTitle\": \"部署工单\", \"timeoutAction\": \"NONE\", \"requireComment\": false, \"approvalContent\": \"部署工单待审批\", \"timeoutDuration\": 0, \"approverVariable\": \"${approval.userNames}\", \"continueOnFailure\": true}}, {\"id\": \"sid_f1188946_c6ff_4480_964e_82f65fdcc514\", \"configs\": {\"nodeCode\": \"GATEWAY\", \"nodeName\": \"是否需要审批\", \"description\": \"流程分支控制节点，支持排他、并行、包容三种模式\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": null, \"name\": \"selectedBranches\", \"type\": \"array\", \"title\": \"已选分支\", \"example\": [\"branch_1\", \"branch_2\"], \"required\": true, \"description\": \"实际执行的分支ID列表（排他网关返回1个，并行网关返回多个，包容网关返回1-N个）\"}, {\"enum\": null, \"name\": \"gatewayType\", \"type\": \"string\", \"title\": \"网关类型\", \"example\": \"EXCLUSIVE\", \"required\": true, \"description\": \"当前网关的类型\"}, {\"enum\": null, \"name\": \"evaluationResults\", \"type\": \"object\", \"title\": \"条件评估结果\", \"example\": {\"branch_1\": true, \"branch_2\": false}, \"required\": false, \"description\": \"各分支条件的评估结果（仅当启用日志时）\"}], \"nodeCode\": \"GATEWAY\", \"nodeName\": \"是否需要审批\", \"nodeType\": \"GATEWAY_NODE\", \"position\": {\"x\": -570, \"y\": -300}, \"inputMapping\": {\"gatewayType\": \"exclusiveGateway\"}}, {\"id\": \"sid_e5f930da_062e_4819_b976_8d8172c7f14a\", \"configs\": {\"nodeCode\": \"GIT_SYNC_CHECK\", \"nodeName\": \"Git同步检测\", \"description\": \"检测源分支与目标分支的同步状态\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": null, \"name\": \"hasDifference\", \"type\": \"boolean\", \"title\": \"是否存在差异\", \"example\": true, \"required\": true, \"description\": \"源分支和目标分支是否存在代码差异\"}, {\"enum\": null, \"name\": \"commitsAhead\", \"type\": \"number\", \"title\": \"源分支领先提交数\", \"example\": 5, \"required\": true, \"description\": \"源分支比目标分支多出的提交数量\"}, {\"enum\": null, \"name\": \"commitsBehind\", \"type\": \"number\", \"title\": \"目标分支领先提交数\", \"example\": 0, \"required\": true, \"description\": \"目标分支比源分支多出的提交数量\"}, {\"enum\": null, \"name\": \"differenceCommits\", \"type\": \"array\", \"title\": \"差异提交列表\", \"example\": [{\"author\": \"张三\", \"message\": \"feat: 添加新功能\", \"commitId\": \"a3f5e8d\", \"commitTime\": \"2025-12-04 10:30:00\"}], \"required\": false, \"description\": \"差异提交详情列表（最多显示20条）\"}, {\"enum\": null, \"name\": \"sourceLatestCommit\", \"type\": \"string\", \"title\": \"源分支最新提交SHA\", \"example\": \"a3f5e8d2c4b1a5e9f2d3e7b8c9d1a2f3e4b5c6d7\", \"required\": true, \"description\": \"源分支最新提交的完整SHA值\"}, {\"enum\": null, \"name\": \"targetLatestCommit\", \"type\": \"string\", \"title\": \"目标分支最新提交SHA\", \"example\": \"b2e4c7f8d1a3e5b9c2d6f9a8e7d1c4b5a3f6e8d2\", \"required\": true, \"description\": \"目标分支最新提交的完整SHA值\"}, {\"enum\": null, \"name\": \"checkDetail\", \"type\": \"string\", \"title\": \"检查结果详情\", \"example\": \"源分支 \'develop\' 领先目标分支 \'master\' 5个提交，需要同步代码\", \"required\": true, \"description\": \"检查结果的详细说明（用于通知模板）\"}], \"nodeCode\": \"GIT_SYNC_CHECK\", \"nodeName\": \"Git同步检测\", \"nodeType\": \"GIT_SYNC_CHECK\", \"position\": {\"x\": -1815, \"y\": -345}, \"inputMapping\": {\"sourceBranch\": \"${sourceRepository.branch}\", \"targetBranch\": \"${targetRepository.branch}\", \"continueOnFailure\": true, \"sourceGitSystemId\": \"${sourceRepository.systemId}\", \"targetGitSystemId\": \"${targetRepository.systemId}\", \"sourceGitProjectId\": \"${sourceRepository.projectId}\", \"targetGitProjectId\": \"${targetRepository.projectId}\"}}, {\"id\": \"sid_0d0eb0be_a427_4966_8114_475ebeb5e724\", \"configs\": {\"nodeCode\": \"GATEWAY\", \"nodeName\": \"代码同步检查网关\", \"description\": \"流程分支控制节点，支持排他、并行、包容三种模式\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": null, \"name\": \"selectedBranches\", \"type\": \"array\", \"title\": \"已选分支\", \"example\": [\"branch_1\", \"branch_2\"], \"required\": true, \"description\": \"实际执行的分支ID列表（排他网关返回1个，并行网关返回多个，包容网关返回1-N个）\"}, {\"enum\": null, \"name\": \"gatewayType\", \"type\": \"string\", \"title\": \"网关类型\", \"example\": \"EXCLUSIVE\", \"required\": true, \"description\": \"当前网关的类型\"}, {\"enum\": null, \"name\": \"evaluationResults\", \"type\": \"object\", \"title\": \"条件评估结果\", \"example\": {\"branch_1\": true, \"branch_2\": false}, \"required\": false, \"description\": \"各分支条件的评估结果（仅当启用日志时）\"}], \"nodeCode\": \"GATEWAY\", \"nodeName\": \"代码同步检查网关\", \"nodeType\": \"GATEWAY_NODE\", \"position\": {\"x\": -1275, \"y\": -300}, \"inputMapping\": {\"gatewayType\": \"exclusiveGateway\"}}, {\"id\": \"sid_ee2f5ea0_48d3_40dd_8ba3_5595ad49eb63\", \"configs\": {\"nodeCode\": \"NOTIFICATION\", \"nodeName\": \"Git同步检测异常通知\", \"description\": \"发送通知消息到指定渠道\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}], \"nodeCode\": \"NOTIFICATION\", \"nodeName\": \"Git同步检测异常通知\", \"nodeType\": \"NOTIFICATION\", \"position\": {\"x\": -885, \"y\": 60}, \"inputMapping\": {\"channelId\": \"${notification.notificationChannelId}\", \"continueOnFailure\": true, \"notificationTemplateId\": 10}}]}', 'DRAFT', 'admin', NOW(), b'0', 'dengqichen', NOW(), 83);
INSERT INTO `deploy-ease-platform`.`workflow_definition` (`id`, `name`, `key`, `category_id`, `form_definition_id`, `process_definition_id`, `flow_version`, `description`, `bpmn_xml`, `graph`, `status`, `create_by`, `create_time`, `deleted`, `update_by`, `update_time`, `version`) VALUES (2, '国产化部署流程', 'localization-deploy-workflow', 2, 2, '', 1, '', '', '{\"edges\": [{\"id\": \"eid_353a1306_8521_4a45_851e_b5d1715e16d5\", \"to\": \"sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf\", \"from\": \"sid_d377019d_5dd0_4e24_9dc7_c81be855ad89\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}, {\"id\": \"eid_cc5d51f1_e380_4748_92e9_f4c86f0f06ba\", \"to\": \"sid_25103e74_107b_4cb8_98d8_8265e3e09fa0\", \"from\": \"sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}, {\"id\": \"eid_ce83cb80_bd13_43ba_98b0_916ce9eca8c7\", \"to\": \"sid_a2de62df_0b29_4d2d_8a82_43a1aaf2566a\", \"from\": \"sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf\", \"name\": \"${notification.deployNotificationEnabled == \'true\'}\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"EXPRESSION\", \"priority\": 10, \"expression\": \"${notification.buildNotificationEnabled == \'true\'}\"}}, \"vertices\": []}, {\"id\": \"eid_cb5f1775_919f_4313_a665_0de1a3a16d76\", \"to\": \"sid_e881dab6_4ec1_44d1_81d1_f68a1bca582a\", \"from\": \"sid_6c622e3c_4eec_44a9_b00b_8933dc89b98c\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}, {\"id\": \"eid_2afd01f2_b2c7_4336_b05e_6ebdd8977ef4\", \"to\": \"sid_d377019d_5dd0_4e24_9dc7_c81be855ad89\", \"from\": \"sid_e881dab6_4ec1_44d1_81d1_f68a1bca582a\", \"name\": \"${notification.buildNotificationEnabled == \'true\'}\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"EXPRESSION\", \"priority\": 10, \"expression\": \"${notification.buildNotificationEnabled == \'true\'}\"}}, \"vertices\": []}, {\"id\": \"eid_b91cf09f_4816_4665_aed2_0644017e6938\", \"to\": \"sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf\", \"from\": \"sid_e881dab6_4ec1_44d1_81d1_f68a1bca582a\", \"name\": \"\", \"config\": {\"type\": \"sequence\", \"condition\": {\"type\": \"DEFAULT\", \"priority\": 10}}, \"vertices\": []}], \"nodes\": [{\"id\": \"sid_6c622e3c_4eec_44a9_b00b_8933dc89b98c\", \"configs\": {\"nodeCode\": \"START_EVENT\", \"nodeName\": \"开始\", \"description\": \"工作流的起始节点\"}, \"outputs\": [], \"nodeCode\": \"START_EVENT\", \"nodeName\": \"开始\", \"nodeType\": \"START_EVENT\", \"position\": {\"x\": -480, \"y\": -15}, \"inputMapping\": {}}, {\"id\": \"sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf\", \"configs\": {\"nodeCode\": \"HTTP_REQUEST\", \"nodeName\": \"HTTP请求\", \"description\": \"发送HTTP/HTTPS请求并解析响应\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": null, \"name\": \"statusCode\", \"type\": \"number\", \"title\": \"HTTP状态码\", \"example\": 200, \"required\": true, \"description\": \"响应的HTTP状态码（如 200, 404, 500）\"}, {\"enum\": null, \"name\": \"isSuccess\", \"type\": \"boolean\", \"title\": \"是否成功\", \"example\": true, \"required\": true, \"description\": \"状态码为2xx时返回true\"}, {\"enum\": null, \"name\": \"responseBody\", \"type\": \"object\", \"title\": \"响应体\", \"example\": {\"data\": {}, \"status\": \"success\"}, \"required\": false, \"description\": \"响应内容，JSON格式会自动解析为对象\"}, {\"enum\": null, \"name\": \"responseTime\", \"type\": \"number\", \"title\": \"响应时间（毫秒）\", \"example\": 150, \"required\": true, \"description\": \"请求耗时（毫秒）\"}, {\"enum\": null, \"name\": \"errorMessage\", \"type\": \"string\", \"title\": \"错误信息\", \"example\": \"Connection timeout\", \"required\": false, \"description\": \"失败时的错误描述\"}, {\"enum\": null, \"name\": \"responseHeaders\", \"type\": \"object\", \"title\": \"响应头\", \"example\": {\"content-type\": \"application/json\"}, \"required\": false, \"description\": \"HTTP响应头信息\"}], \"nodeCode\": \"HTTP_REQUEST\", \"nodeName\": \"HTTP请求\", \"nodeType\": \"HTTP_REQUEST\", \"position\": {\"x\": 885, \"y\": 120}, \"inputMapping\": {\"url\": \"http://124.127.238.38:8080/api/deploy\", \"body\": \"{\\n    \\\"appName\\\": \\\"themetis-planner-workbench-server\\\"\\n}\", \"method\": \"POST\", \"headers\": [{\"key\": \"Content-Type\", \"value\": \"application/json\"}], \"timeout\": 300000, \"verifySsl\": false, \"queryParams\": [], \"followRedirects\": true, \"responseBodyType\": \"JSON\", \"continueOnFailure\": true}}, {\"id\": \"sid_25103e74_107b_4cb8_98d8_8265e3e09fa0\", \"configs\": {\"nodeCode\": \"END_EVENT\", \"nodeName\": \"结束\", \"description\": \"工作流的结束节点\"}, \"outputs\": [], \"nodeCode\": \"END_EVENT\", \"nodeName\": \"结束\", \"nodeType\": \"END_EVENT\", \"position\": {\"x\": 2250, \"y\": 240}, \"inputMapping\": {}}, {\"id\": \"sid_d377019d_5dd0_4e24_9dc7_c81be855ad89\", \"configs\": {\"nodeCode\": \"NOTIFICATION\", \"nodeName\": \"构建部署通知\", \"description\": \"发送通知消息到指定渠道\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}], \"nodeCode\": \"NOTIFICATION\", \"nodeName\": \"构建部署通知\", \"nodeType\": \"NOTIFICATION\", \"position\": {\"x\": 420, \"y\": -420}, \"inputMapping\": {\"channelId\": \"${notification.notificationChannelId}\", \"continueOnFailure\": true, \"notificationTemplateId\": \"${notification.buildNotificationTemplateId}\"}}, {\"id\": \"sid_a2de62df_0b29_4d2d_8a82_43a1aaf2566a\", \"configs\": {\"nodeCode\": \"NOTIFICATION\", \"nodeName\": \"部署结束通知\", \"description\": \"发送通知消息到指定渠道\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}], \"nodeCode\": \"NOTIFICATION\", \"nodeName\": \"部署结束通知\", \"nodeType\": \"NOTIFICATION\", \"position\": {\"x\": 1350, \"y\": -405}, \"inputMapping\": {\"channelId\": \"${notification.notificationChannelId}\", \"continueOnFailure\": true, \"notificationTemplateId\": \"${notification.buildNotificationTemplateId}\"}}, {\"id\": \"sid_e881dab6_4ec1_44d1_81d1_f68a1bca582a\", \"configs\": {\"nodeCode\": \"GATEWAY\", \"nodeName\": \"网关节点\", \"description\": \"流程分支控制节点，支持排他、并行、包容三种模式\"}, \"outputs\": [{\"enum\": [\"SUCCESS\", \"FAILURE\"], \"name\": \"status\", \"type\": \"string\", \"title\": \"执行状态\", \"example\": \"SUCCESS\", \"required\": true, \"description\": \"节点执行的最终状态\"}, {\"enum\": null, \"name\": \"selectedBranches\", \"type\": \"array\", \"title\": \"已选分支\", \"example\": [\"branch_1\", \"branch_2\"], \"required\": true, \"description\": \"实际执行的分支ID列表（排他网关返回1个，并行网关返回多个，包容网关返回1-N个）\"}, {\"enum\": null, \"name\": \"gatewayType\", \"type\": \"string\", \"title\": \"网关类型\", \"example\": \"EXCLUSIVE\", \"required\": true, \"description\": \"当前网关的类型\"}, {\"enum\": null, \"name\": \"evaluationResults\", \"type\": \"object\", \"title\": \"条件评估结果\", \"example\": {\"branch_1\": true, \"branch_2\": false}, \"required\": false, \"description\": \"各分支条件的评估结果（仅当启用日志时）\"}], \"nodeCode\": \"GATEWAY\", \"nodeName\": \"网关节点\", \"nodeType\": \"GATEWAY_NODE\", \"position\": {\"x\": -165, \"y\": -90}, \"inputMapping\": {\"gatewayType\": \"exclusiveGateway\"}}]}', 'DRAFT', 'admin', NOW(), b'0', 'admin', NOW(), 62);
-- --------------------------------------------------------------------------------------
-- 初始化项目管理数据
-- --------------------------------------------------------------------------------------
INSERT INTO `deploy-ease-platform`.`deploy_application_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `enabled`, `sort`) VALUES (1, 'admin', NOW(), 'admin', NOW(), 1, b'0', 'DL-SCP', '需求计划', '', '', b'1', 0);
INSERT INTO `deploy-ease-platform`.`deploy_application_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `enabled`, `sort`) VALUES (2, 'admin', NOW(), 'admin', NOW(), 1, b'0', 'SZ-ISCP', '供应计划', '', '', b'1', 0);


INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (1, 'scp-meta', '元数据', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (2, 'scp-longi-module', 'scp-longi-module', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (3, 'scp-longi', 'scp-longi', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (4, 'themetis-planner-workbench-server', 'themetis-planner-workbench-server', '', 0, 2, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (5, 'scp-font-pro', 'scp-font-pro', '', 1, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (6, 'scp-ws', 'scp-ws', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (7, 'scp-data-center', 'scp-data-center', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (8, 'scp-dsl', 'scp-dsl', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (9, 'scp-idaas-bsm', 'scp-idaas-bsm', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (10, 'scp-gateway', 'scp-gateway', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (11, 'scp-performance-batch', 'scp-performance-batch', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (12, 'scp-process', 'scp-process', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (13, 'scp-service-manager', 'scp-service-manager', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_application` (`id`, `app_code`, `app_name`, `app_desc`, `language`, `application_category_id`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (14, 'scp-customization-engine', 'scp-customization-engine', '', 0, 1, b'1', 0, 'admin', NOW(), 'admin', NOW(), 1, b'0');


INSERT INTO `deploy-ease-platform`.`deploy_environment` (`id`, `tenant_code`, `env_code`, `env_name`, `env_desc`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (1, NULL, 'LONGI-DEV', '隆基DEV', NULL, b'1', 1, 'admin', NOW(), 'admin', NOW(), 2, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_environment` (`id`, `tenant_code`, `env_code`, `env_name`, `env_desc`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (2, NULL, 'LONGI-UAT', '隆基UAT', NULL, b'1', 1, 'admin', NOW(), 'admin', NOW(), 3, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_environment` (`id`, `tenant_code`, `env_code`, `env_name`, `env_desc`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (5, NULL, 'LOCALIZATION_DEV', '国产化DEV', NULL, b'1', 1, 'admin', NOW(), 'admin', NOW(), 1, b'0');
INSERT INTO `deploy-ease-platform`.`deploy_environment` (`id`, `tenant_code`, `env_code`, `env_name`, `env_desc`, `enabled`, `sort`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`) VALUES (6, NULL, 'DEMO1', 'DEMO1', NULL, b'1', 1, 'admin', NOW(), 'admin', NOW(), 1, b'0');


INSERT INTO `deploy-ease-platform`.`deploy_team` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_code`, `team_name`, `description`, `owner_id`, `owner_name`, `enabled`, `sort`, `development_mode`, `enable_git_sync_check`) VALUES (3, 'admin', NOW(), 'admin', NOW(), 1, b'0', 'DP_SCP', '需求计划', '', 1, '超级管理员', b'1', 0, 'STANDARD', b'0');
INSERT INTO `deploy-ease-platform`.`deploy_team` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_code`, `team_name`, `description`, `owner_id`, `owner_name`, `enabled`, `sort`, `development_mode`, `enable_git_sync_check`) VALUES (4, 'admin', NOW(), 'admin', NOW(), 2, b'0', 'DL_SCP_LONGI', '隆基项目', '', 1, '超级管理员', b'1', 0, 'SYNC_MODE', b'1');
INSERT INTO `deploy-ease-platform`.`deploy_team` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_code`, `team_name`, `description`, `owner_id`, `owner_name`, `enabled`, `sort`, `development_mode`, `enable_git_sync_check`) VALUES (5, 'admin', NOW(), 'admin', NOW(), 3, b'0', 'LOCALIZATION', '国产化改造', '', 1, '超级管理员', b'1', 0, 'STANDARD', b'0');

INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (25, 'admin', NOW(), 'admin', NOW(), 1, b'0', 5, 5, '汤峰岷', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (26, 'admin', NOW(), 'admin', NOW(), 1, b'0', 5, 11, '邓骐辰', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (27, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 13, '杨振夫', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (28, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 10, '马也', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (29, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 11, '邓骐辰', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (30, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 8, '吕春林', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (31, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 9, '尹丽妍', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (32, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 7, '文高', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (33, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 6, '盛泽强', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (34, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 5, '汤峰岷', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (35, 'admin', NOW(), 'admin', NOW(), 1, b'0', 3, 5, '汤峰岷', '', NOW());
INSERT INTO `deploy-ease-platform`.`deploy_team_member` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `user_id`, `user_name`, `role_in_team`, `join_time`) VALUES (36, 'admin', NOW(), 'admin', NOW(), 1, b'0', 3, 11, '邓骐辰', '', NOW());

INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (2, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 2, 2, 'JENKINS', 2, 497, 'release/1.4.0', 4, 401, 'release/1.4.1', 3, 'ibp-uat-scp-longi-module', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (9, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 1, 2, 'JENKINS', 4, 413, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-meta', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (17, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 5, 2, 'JENKINS', 4, 423, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-font-pro', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (27, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 14, 1, 'JENKINS', 2, 504, 'release/1.7.0', NULL, NULL, NULL, 3, 'ibp-dev-scp-customization-engine', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (28, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 13, 1, 'JENKINS', 2, 305, 'release/1.7.0', NULL, NULL, NULL, 3, 'ibp-dev-scp-service-manager', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (29, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 3, 1, 'JENKINS', 2, 465, 'release/1.7.0', 4, 402, 'release/1.7.0', 3, 'ibp-dev-scp-longi', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (30, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 2, 1, 'JENKINS', 2, 497, 'release/1.7.0', 4, 401, 'release/1.7.0', 3, 'ibp-dev-scp-longi-module', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (31, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 12, 1, 'JENKINS', 2, 344, 'release/1.7.0', NULL, NULL, NULL, 3, 'ibp-dev-scp-process', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (32, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 11, 1, 'JENKINS', 2, 557, 'release/1.7.0', NULL, NULL, NULL, 3, 'ibp-dev-scp-performance-batch', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (33, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 10, 1, 'JENKINS', 2, 337, 'release/1.7.0', 4, 420, 'release/1.7.0', 3, 'ibp-dev-scp-gateway', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (34, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 9, 1, 'JENKINS', 2, 336, 'release/1.7.0', 4, 418, 'release/1.7.0', 3, 'ibp-dev-scp-idaas-bsm', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (35, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 8, 1, 'JENKINS', 2, 345, 'release/1.7.0', 4, 423, 'release/1.7.0', 3, 'ibp-dev-scp-dsl', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (36, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 7, 1, 'JENKINS', 2, 304, 'release/1.7.0', 4, 412, 'release/1.7.0', 3, 'ibp-dev-scp-data-center', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (37, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 6, 1, 'JENKINS', 2, 300, 'release/1.7.0', 4, 410, 'release/1.7.0', 3, 'ibp-dev-scp-ws', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (38, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 1, 1, 'JENKINS', 2, 288, 'release/1.7.0', 4, 413, 'release/1.7.0', 3, 'ibp-dev-scp-meta', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (39, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 5, 1, 'JENKINS', 2, 315, 'release/1.7.0', 4, 422, 'release/1.7.0', 3, 'ibp-dev-scp-font-pro', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (40, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 14, 2, 'JENKINS', 2, 504, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-customization-engine', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (41, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 13, 2, 'JENKINS', 2, 305, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-service-manager', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (42, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 12, 2, 'JENKINS', 2, 344, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-process', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (46, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 8, 2, 'JENKINS', 2, 345, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-dsl', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (47, 'admin', NOW(), 'admin', NOW(), 1, b'0', 5, 4, 5, 'NATIVE', 6, 38, 'release/1.0-localization', NULL, NULL, NULL, NULL, '', 2);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (48, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 6, 2, 'JENKINS', 2, 300, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-ws', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (49, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 9, 2, 'JENKINS', 2, 336, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-idaas-bsm', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (50, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 10, 2, 'JENKINS', 2, 337, 'release/1.4.0', NULL, NULL, NULL, 3, 'ibp-uat-scp-gateway', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (52, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 11, 2, 'JENKINS', 2, 557, 'release/1.4.0', 4, 462, 'release/1.4.0', 3, 'ibp-uat-scp-performance-batch', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (53, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 7, 2, 'JENKINS', 4, 412, 'release/1.4.1', NULL, NULL, NULL, 3, 'ibp-uat-scp-data-center', 1);
INSERT INTO `deploy-ease-platform`.`deploy_team_application` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `application_id`, `environment_id`, `build_type`, `source_git_system_id`, `source_git_project_id`, `source_branch`, `target_git_system_id`, `target_git_project_id`, `target_branch`, `deploy_system_id`, `deploy_job`, `workflow_definition_id`) VALUES (54, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 3, 2, 'JENKINS', 2, 465, 'release/1.4.0', 4, 402, 'release/1.4.0', 3, 'ibp-uat-scp-longi', 1);

INSERT INTO `deploy-ease-platform`.`deploy_team_environment_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `environment_id`, `approval_required`, `approver_user_ids`, `require_code_review`, `remark`) VALUES (8, 'admin', NOW(), 'admin', NOW(), 1, b'0', 5, 5, b'0', NULL, b'0', '');
INSERT INTO `deploy-ease-platform`.`deploy_team_environment_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `environment_id`, `approval_required`, `approver_user_ids`, `require_code_review`, `remark`) VALUES (9, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 1, b'0', NULL, b'0', '');
INSERT INTO `deploy-ease-platform`.`deploy_team_environment_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `environment_id`, `approval_required`, `approver_user_ids`, `require_code_review`, `remark`) VALUES (10, 'admin', NOW(), 'admin', NOW(), 1, b'0', 4, 2, b'1', '[6]', b'0', '');
INSERT INTO `deploy-ease-platform`.`deploy_team_environment_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `environment_id`, `approval_required`, `approver_user_ids`, `require_code_review`, `remark`) VALUES (11, 'admin', NOW(), 'admin', NOW(), 1, b'0', 3, 6, b'0', NULL, b'0', '');

INSERT INTO `deploy-ease-platform`.`deploy_team_environment_notification_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `environment_id`, `notification_channel_id`, `pre_approval_notification_enabled`, `pre_approval_notification_template_id`, `build_notification_enabled`, `build_notification_template_id`, `build_failure_file_enabled`) VALUES (7, 'admin', NOW(), 'admin', NOW(), 2, b'0', 5, 5, 3, b'0', NULL, b'1', 9, b'1');
INSERT INTO `deploy-ease-platform`.`deploy_team_environment_notification_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `environment_id`, `notification_channel_id`, `pre_approval_notification_enabled`, `pre_approval_notification_template_id`, `build_notification_enabled`, `build_notification_template_id`, `build_failure_file_enabled`) VALUES (8, 'admin', NOW(), 'admin', NOW(), 2, b'0', 4, 2, 4, b'0', NULL, b'1', 8, b'1');
INSERT INTO `deploy-ease-platform`.`deploy_team_environment_notification_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `team_id`, `environment_id`, `notification_channel_id`, `pre_approval_notification_enabled`, `pre_approval_notification_template_id`, `build_notification_enabled`, `build_notification_template_id`, `build_failure_file_enabled`) VALUES (9, 'admin', NOW(), 'admin', NOW(), 2, b'0', 4, 1, 4, b'0', NULL, b'1', 8, b'1');
-- --------------------------------------------------------------------------------------
-- 初始化通知渠道数据
-- --------------------------------------------------------------------------------------

-- =====================================================
-- 服务器管理初始数据
-- =====================================================

-- 服务器分类
INSERT INTO deploy_server_category (id, name, code, icon, description, sort, enabled, create_by, create_time, update_by, update_time, version, deleted) VALUES
(1, 'Web服务器', 'WEB_SERVER', 'server', 'Web应用服务器、前端服务器', 1, 1, 'system', NOW(), 'system', NOW(), 1, 0),
(2, '数据库服务器', 'DATABASE_SERVER', 'database', '数据库服务器、缓存服务器', 2, 1, 'system', NOW(), 'system', NOW(), 1, 0),
(3, '中间件服务器', 'MIDDLEWARE_SERVER', 'cluster', '消息队列、搜索引擎等中间件', 3, 1, 'system', NOW(), 'system', NOW(), 1, 0),
(4, '应用服务器', 'APP_SERVER', 'cloud-server', '业务应用服务器', 4, 1, 'system', NOW(), 'system', NOW(), 1, 0),
(5, '其他', 'OTHER', 'hdd', '其他类型服务器', 99, 1, 'system', NOW(), 'system', NOW(), 1, 0);

-- =====================================================
-- 通知模板初始数据
-- =====================================================
INSERT INTO `deploy-ease-platform`.`sys_notification_channel` (`id`, `create_by`, `create_time`, `deleted`, `update_by`, `update_time`, `version`, `name`, `channel_type`, `config`, `enabled`, `description`) VALUES (2, 'admin', NOW(), b'0', 'admin', NOW(), 7, '测试企业微信群', 'WEWORK', '{\"key\": \"614b110b-8957-4be8-95b9-4eca84c15028\", \"channelType\": \"WEWORK\"}', b'1', '');
INSERT INTO `deploy-ease-platform`.`sys_notification_channel` (`id`, `create_by`, `create_time`, `deleted`, `update_by`, `update_time`, `version`, `name`, `channel_type`, `config`, `enabled`, `description`) VALUES (3, 'admin', NOW(), b'0', 'admin', NOW(), 2, '国产化群', 'WEWORK', '{\"key\": \"d8b23e8f-cffb-4703-917d-d4c420f88db3\", \"channelType\": \"WEWORK\"}', b'1', '');
INSERT INTO `deploy-ease-platform`.`sys_notification_channel` (`id`, `create_by`, `create_time`, `deleted`, `update_by`, `update_time`, `version`, `name`, `channel_type`, `config`, `enabled`, `description`) VALUES (4, 'admin', NOW(), b'0', 'admin', NOW(), 1, '隆基群', 'WEWORK', '{\"key\": \"d6c93df2-76fe-4204-965d-cc49ae56c5e4\", \"channelType\": \"WEWORK\"}', b'1', '');

INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (8, 'admin', NOW(), 'dengqichen', NOW(), 36, b'0', 'JENKINS构建状态通知', 'jenkins_build_notification', '', 'WEWORK', '## <#if environmentName??>${environmentName}</#if>环境构建通知', '>项目：<#if applicationName??><font>${applicationName}(${applicationCode})</font></#if>\r\n<#if buildStatus??>\r\n<#switch buildStatus>\r\n<#case \"SUCCESS\">\r\n>状态：<font color=\"info\">构建成功</font>\r\n<#break>\r\n<#case \"BUILDING\">\r\n>状态：<font color=\"comment\">构建中</font>\r\n<#break>\r\n<#case \"ABORTED\">\r\n>状态：<font color=\"warning\">构建被取消</font>\r\n<#break>\r\n<#default>\r\n>状态：<font color=\"warning\">构建失败</font>\r\n</#switch>\r\n</#if>\r\n<#if buildStatus?? && buildStatus != \"BUILDING\">\r\n<#if buildDurationFormatted??>\r\n>耗时：${buildDurationFormatted}\r\n</#if>\r\n<#if buildEndTime??>\r\n>时间：${buildEndTime}\r\n</#if>\r\n<#else>\r\n<#if buildStartTime??>\r\n>时间：${buildStartTime}\r\n</#if>\r\n</#if>\r\n<#if commitMessage??>\r\n>内容：\r\n<#list commitMessage?split(\'\\n\') as line>\r\n>${line}\r\n</#list>\r\n</#if>', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (9, 'admin', NOW(), 'admin', NOW(), 10, b'0', '国产化构建通知', 'localization_build_notification', '国产化模版', 'WEWORK', '## <#if environmentName??>${environmentName}</#if>环境变更通知', '>项目：<#if applicationName??><font>${applicationName}(${applicationCode})</font></#if>\r\n<#-- 通过判断HTTP节点输出是否存在来区分阶段 -->\r\n<#if sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf?? && sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf.outputs??>\r\n<#-- ========== 构建结束阶段（HTTP节点已执行）========== -->\r\n<#assign httpOutput = sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf.outputs>\r\n<#if httpOutput.isSuccess!false>\r\n<#if httpOutput.responseBody?? && httpOutput.responseBody.status?? && httpOutput.responseBody.status == \"success\">\r\n>状态：<font color=\"info\">构建成功</font>\r\n<#if httpOutput.responseBody.duration??>\r\n>耗时：${httpOutput.responseBody.duration}秒\r\n</#if>\r\n<#if httpOutput.responseBody.endTime??>\r\n>时间：${httpOutput.responseBody.endTime}\r\n</#if>\r\n<#else>\r\n>状态：<font color=\"warning\">构建失败</font>\r\n<#if httpOutput.responseBody?? && httpOutput.responseBody.error??>\r\n>错误：${httpOutput.responseBody.error}\r\n</#if>\r\n</#if>\r\n<#else>\r\n>状态：<font color=\"warning\">构建失败</font>\r\n<#if httpOutput.statusCode?? && httpOutput.statusCode gt 0>\r\n>HTTP状态码：${httpOutput.statusCode}\r\n<#else>\r\n>错误类型：网络连接异常\r\n</#if>\r\n<#if httpOutput.errorMessage??>\r\n>错误详情：${httpOutput.errorMessage}\r\n</#if>\r\n<#if httpOutput.responseTime??>\r\n>请求耗时：${httpOutput.responseTime}ms\r\n</#if>\r\n</#if>\r\n<#else>\r\n<#-- ========== 构建中阶段（HTTP节点未执行）========== -->\r\n>状态：<font color=\"comment\">构建中</font>\r\n<#if deployDate??>\r\n<#attempt>\r\n<#assign deployDateTime = deployDate?datetime.iso>\r\n>时间：${deployDateTime?string(\"yyyy-MM-dd HH:mm:ss\")}\r\n<#recover>\r\n>时间：${deployDate}\r\n</#attempt>\r\n</#if>\r\n</#if>\r\n>内容：<#if deployRemark??><font>${deployRemark}</font><#else>无构建内容</#if>\r\n', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (10, 'admin', NOW(), 'admin', NOW(), 3, b'0', 'Git同步检测通知', 'git_sync_code_check_notification', '', 'WEWORK', '## 代码同步检查异常', '${sid_e5f930da_062e_4819_b976_8d8172c7f14a.outputs.checkDetail}', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (11, 'admin', NOW(), 'admin', NOW(), 1, b'0', '服务器阈值预警通知', 'server_threshold_warning_notification', '', 'WEWORK', '## 服务器资源告警通知', '**告警级别：**<font color=\"warning\">${alertLevel}</font>\r\n\r\n---\r\n\r\n**服务器信息**\r\n> 服务器名称：${serverName}\r\n> 服务器IP：${serverIp}\r\n\r\n**告警详情**\r\n> 告警规则：${ruleName}\r\n> 告警类型：${alertType}\r\n> 资源信息：${resourceInfo}\r\n\r\n**监控数据**\r\n> 当前值：<font color=\"warning\">${currentValue}%</font>\r\n> 阈值：${threshold}%\r\n> 告警时间：${alertTime}\r\n\r\n---\r\n\r\n请及时处理告警信息！', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (12, 'admin', NOW(), 'admin', NOW(), 1, b'0', '服务器离线预警', 'server_offline_warning_notification', '', 'WEWORK', '## 服务器离线预警', '**服务器信息**\r\n> 服务器名称：${serverName}\r\n> 服务器IP：${serverIp}\r\n\r\n**离线详情**\r\n> 检测时间：${offlineTime}\r\n> 状态：<font color=\"warning\">SSH连接失败，服务器无法访问</font>\r\n\r\n---\r\n\r\n**处理建议：**\r\n> 1. 检查服务器网络连接状态\r\n> 2. 检查服务器是否关机或重启\r\n> 3. 检查防火墙和SSH服务状态\r\n> 4. 联系运维人员进行故障排查\r\n\r\n请立即处理服务器离线问题！', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');

INSERT INTO `deploy-ease-platform`.`schedule_job_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `color`, `enabled`, `sort`) VALUES (1, 'system', NOW(), 'system', NOW(), 1, b'0', 'DATA_CLEAN', '数据清理', '定期清理系统历史数据和临时文件', 'DeleteOutlined', '#ff4d4f', b'1', 1);
INSERT INTO `deploy-ease-platform`.`schedule_job_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `color`, `enabled`, `sort`) VALUES (2, 'system', NOW(), 'system', NOW(), 1, b'0', 'DATA_SYNC', '数据同步', '同步外部系统数据到本地', 'SyncOutlined', '#1890ff', b'1', 2);
INSERT INTO `deploy-ease-platform`.`schedule_job_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `color`, `enabled`, `sort`) VALUES (3, 'system', NOW(), 'system', NOW(), 1, b'0', 'REPORT', '报表生成', '定期生成和发送各类统计报表', 'BarChartOutlined', '#52c41a', b'1', 3);
INSERT INTO `deploy-ease-platform`.`schedule_job_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `color`, `enabled`, `sort`) VALUES (4, 'system', NOW(), 'system', NOW(), 1, b'0', 'MONITOR', '系统监控', '监控系统健康状态和性能指标', 'EyeOutlined', '#faad14', b'1', 4);
INSERT INTO `deploy-ease-platform`.`schedule_job_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `color`, `enabled`, `sort`) VALUES (5, 'system', NOW(), 'system', NOW(), 1, b'0', 'BACKUP', '备份任务', '定期备份数据库和重要文件', 'DatabaseOutlined', '#722ed1', b'1', 5);


INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (2, 'admin', NOW(), 'admin', NOW(), 27, b'0', '链宇Git仓库组同步', '定期同步Git仓库组信息，每天凌晨2点执行', 2, 'repositoryGroupServiceImpl', 'syncGroups', NULL, '{\"externalSystemId\": 2}', '0 0 2 * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 3600, 2, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (3, 'admin', NOW(), 'admin', NOW(), 29, b'0', '链宇Git项目同步', '定期同步Git项目信息，每天凌晨3点执行', 2, 'repositoryProjectServiceImpl', 'syncProjects', NULL, '{\"externalSystemId\": 2}', '0 0 3 * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 3600, 2, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (4, 'admin', NOW(), 'admin', NOW(), 5718, b'0', '链宇Git分支同步', '定期同步Git仓库分支信息，每5分钟执行一次', 2, 'repositoryBranchServiceImpl', 'syncBranches', NULL, '{\"externalSystemId\": 2}', '0 */5 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 3600, 2, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (8, 'admin', NOW(), 'admin', NOW(), 1202, b'0', '链宇Jenkins视图同步', '', 2, 'jenkinsViewServiceImpl', 'syncViews', NULL, '{\"externalSystemId\": 1}', '0 */5 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 300, 0, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (9, 'admin', NOW(), 'admin', NOW(), 1202, b'0', '链宇Jenkins任务同步', '', 2, 'jenkinsJobServiceImpl', 'syncJobs', NULL, '{\"externalSystemId\": 1}', '0 */5 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 300, 0, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (10, 'admin', NOW(), 'admin', NOW(), 10138, b'0', '链宇Jenkins构建同步', '', 2, 'jenkinsBuildServiceImpl', 'syncBuilds', NULL, '{\"externalSystemId\": 1}', '0 */2 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 300, 0, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (11, 'admin', NOW(), 'admin', NOW(), 1203, b'0', '隆基Jenkins视图同步', '', 2, 'jenkinsViewServiceImpl', 'syncViews', NULL, '{\"externalSystemId\": 3}', '0 */5 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 300, 0, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (12, 'admin', NOW(), 'admin', NOW(), 1203, b'0', '隆基Jenkins任务同步', '', 2, 'jenkinsJobServiceImpl', 'syncJobs', NULL, '{\"externalSystemId\": 3}', '0 */5 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 300, 0, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (13, 'admin', NOW(), 'admin', NOW(), 10162, b'0', '隆基Jenkins构建同步', '', 2, 'jenkinsBuildServiceImpl', 'syncBuilds', NULL, '{\"externalSystemId\": 3}', '0 */2 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 300, 0, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (14, 'admin', NOW(), 'admin', NOW(), 26, b'0', '隆基Git仓库组同步', '定期同步Git仓库组信息，每天凌晨2点执行', 2, 'repositoryGroupServiceImpl', 'syncGroups', NULL, '{\"externalSystemId\": 4}', '0 0 3 * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 3600, 2, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (15, 'admin', NOW(), 'admin', NOW(), 1204, b'0', '隆基Git项目同步', '定期同步Git项目信息，每天凌晨3点执行', 2, 'repositoryProjectServiceImpl', 'syncProjects', NULL, '{\"externalSystemId\": 4}', '0 */5 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 3600, 2, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (16, 'admin', NOW(), 'admin', NOW(), 5719, b'0', '隆基Git分支同步', '定期同步Git仓库分支信息，每5分钟执行一次', 2, 'repositoryBranchServiceImpl', 'syncBranches', NULL, '{\"externalSystemId\": 4}', '0 */5 * * * ?', 'ENABLED', b'0', NOW(), NOW(), 0, 0, 0, 3600, 2, '');
INSERT INTO `deploy-ease-platform`.`schedule_job` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `job_name`, `job_description`, `category_id`, `bean_name`, `method_name`, `form_definition_id`, `method_params`, `cron_expression`, `status`, `concurrent`, `last_execute_time`, `next_execute_time`, `execute_count`, `success_count`, `fail_count`, `timeout_seconds`, `retry_count`, `alert_email`) VALUES (17, 'admin', NOW(), 'admin', NOW(), 2, b'0', '服务器预警', '', 4, 'serverMonitorScheduler', 'collectServerMetrics', NULL, '{\n  \"notificationChannelId\": 1,\n  \"resourceAlertTemplateId\": 11\n  \"serverOfflineTemplateId\": 12,\n}', '0 */5 * * * ?', 'DISABLED', b'0', NULL, NULL, 0, 0, 0, 300, 0, '');



INSERT INTO `deploy-ease-platform`.`deploy_server_alert_rule` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `server_id`, `rule_name`, `alert_type`, `warning_threshold`, `critical_threshold`, `duration_minutes`, `enabled`, `description`) VALUES (1, NULL, NOW(), NULL, NOW(), 0, 0, NULL, '全局内存告警规则', 'MEMORY', 75.00, 90.00, 5, 1, '全局规则：内存使用率超过75%触发警告，超过90%触发严重告警');