MERGE INTO sys_dept (id, dept_name, dept_code, parent_id, sort_order, status) KEY(id) VALUES
(1, '总裁办', 'CEO', 0, 1, 1),
(2, '技术部', 'TECH', 0, 2, 1),
(3, '财务部', 'FIN', 0, 3, 1),
(4, '人事部', 'HR', 0, 4, 1),
(5, '前端组', 'FE', 2, 1, 1),
(6, '后端组', 'BE', 2, 2, 1);

MERGE INTO sys_user (id, username, password, real_name, phone, email, dept_id, employee_type, status) KEY(id) VALUES
(1, 'admin', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', '超级管理员', '13800138000', 'admin@qqflow.com', 1, 'super_admin', 0),
(2, 'zhangsan', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', '张三', '13800138001', 'zhangsan@qqflow.com', 2, 'common_user', 0),
(3, 'lisi', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', '李四', '13800138002', 'lisi@qqflow.com', 3, 'dept_manager', 0),
(4, 'wangwu', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', '王五', '13800138003', 'wangwu@qqflow.com', 4, 'flow_manager', 0);

MERGE INTO sys_role (id, role_code, role_name, role_scope, parent_id, dept_id, username, password, status) KEY(id) VALUES
(1, 'super_admin', '超级管理员', 'platform', 0, 1, 'role_super_admin', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', 1),
(2, 'flow_admin', '流程管理员', 'tenant', 0, 1, 'role_flow_admin', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', 1),
(3, 'normal_user', '普通用户', 'tenant', 0, 2, 'role_normal_user', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', 1),
(4, 'dept_manager', '部门经理', 'tenant', 3, 3, 'role_dept_manager', '$2a$10$Wnh8Jnt2AGHNNu1XTyyNveqkXvE1BnuzvHt1xS5AL3YdDif/7iXta', 1);

MERGE INTO sys_menu (id, menu_name, menu_type, permission, parent_id, sort_order, component, icon, status) KEY(id) VALUES
(1, '系统管理', 0, NULL, 0, 1, NULL, 'Setting', 1),
(2, '用户管理', 1, 'system:user:list', 1, 1, 'system/user/index', 'User', 1),
(3, '角色管理', 1, 'system:role:list', 1, 2, 'system/role/index', 'Role', 1),
(4, '流程管理', 0, NULL, 0, 2, NULL, 'Connection', 1),
(5, '流程设计', 1, 'flow:designer:list', 4, 1, 'flow/designer/index', 'Edit', 1),
(6, '流程定义', 1, 'flow:definition:list', 4, 2, 'flow/definition/index', 'Document', 1),
(7, '审批中心', 0, NULL, 0, 3, NULL, 'Stamp', 1),
(8, '我的待办', 1, 'flow:task:todo', 7, 1, 'flow/task/todo', 'Bell', 1),
(17, '我的已办', 1, 'flow:task:handled', 7, 2, 'flow/task/handled', 'CircleCheck', 1),
(9, '我的流程', 1, 'flow:instance:mine', 7, 3, 'flow/instance/mine', 'List', 1),
(10, '新增用户', 2, 'system:user:create', 2, 1, NULL, NULL, 1),
(11, '编辑用户', 2, 'system:user:update', 2, 2, NULL, NULL, 1),
(12, '删除用户', 2, 'system:user:delete', 2, 3, NULL, NULL, 1),
(13, '新增流程', 2, 'flow:designer:create', 5, 1, NULL, NULL, 1),
(14, '发布流程', 2, 'flow:designer:publish', 5, 2, NULL, NULL, 1),
(15, '审批通过', 2, 'flow:task:approve', 8, 1, NULL, NULL, 1),
(16, '审批拒绝', 2, 'flow:task:reject', 8, 2, NULL, NULL, 1);

MERGE INTO sys_user_role (id, user_id, role_id) KEY(id) VALUES
(1, 1, 1),
(2, 2, 4),
(3, 3, 3),
(4, 4, 3);


MERGE INTO sys_role_menu (id, role_id, menu_id) KEY(id) VALUES
(1, 1, 1), (2, 1, 2), (3, 1, 3), (4, 1, 4), (5, 1, 5), (6, 1, 6), (7, 1, 7), (8, 1, 8), (9, 1, 9),
(10, 1, 10), (11, 1, 11), (12, 1, 12), (13, 1, 13), (14, 1, 14), (15, 1, 15), (16, 1, 16), (32, 1, 17),
(17, 2, 4), (18, 2, 5), (19, 2, 6), (20, 2, 13), (21, 2, 14),
(22, 3, 7), (23, 3, 8), (24, 3, 9), (25, 3, 15), (26, 3, 16),
(27, 4, 7), (28, 4, 8), (29, 4, 9), (30, 4, 15), (31, 4, 16);
