create table sys_dept
(
    dept_id       bigint                        not null comment '部门id'
        primary key,
    tenant_id     varchar(20)  default '000000' null comment '租户编号',
    parent_id     bigint       default 0        null comment '父部门id',
    ancestors     varchar(500) default ''       null comment '祖级列表',
    dept_name     varchar(30)  default ''       null comment '部门名称',
    dept_category varchar(100)                  null comment '部门类别编码',
    order_num     int          default 0        null comment '显示顺序',
    leader        bigint                        null comment '负责人',
    phone         varchar(11)                   null comment '联系电话',
    email         varchar(50)                   null comment '邮箱',
    status        char         default '0'      null comment '部门状态（0正常 1停用）',
    del_flag      char         default '0'      null comment '删除标志（0代表存在 1代表删除）',
    create_dept   bigint                        null comment '创建部门',
    create_by     bigint                        null comment '创建者',
    create_time   datetime                      null comment '创建时间',
    update_by     bigint                        null comment '更新者',
    update_time   datetime                      null comment '更新时间'
)
    comment '部门表';

INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (100, '000000', 0, '0', 'XXX科技', null, 0, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, '2025-08-23 21:51:22', null, null);
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (101, '000000', 100, '0,100', '深圳总公司', null, 1, null, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, '2025-08-23 21:51:22', null, null);
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (102, '000000', 100, '0,100', '长沙分公司', null, 2, null, '15888888888', 'xxx@qq.com', '0', '1', 103, 1, '2025-08-23 21:51:22', 1, '2025-08-25 21:42:05');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (103, '000000', 101, '0,100,101', '研发部门', null, 1, 1, '15888888888', 'xxx@qq.com', '0', '0', 103, 1, '2025-08-23 21:51:22', null, null);
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (104, '000000', 101, '0,100,101', '市场部门', null, 2, null, '15888888888', 'xxx@qq.com', '0', '1', 103, 1, '2025-08-23 21:51:22', 1, '2025-08-25 21:42:13');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (105, '000000', 101, '0,100,101', '测试部门', null, 3, null, '15888888888', 'xxx@qq.com', '0', '1', 103, 1, '2025-08-23 21:51:22', 1, '2025-08-25 21:42:11');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (106, '000000', 101, '0,100,101', '财务部门', null, 4, null, '15888888888', 'xxx@qq.com', '0', '1', 103, 1, '2025-08-23 21:51:22', 1, '2025-08-25 21:42:10');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (107, '000000', 101, '0,100,101', '运维部门', null, 5, null, '15888888888', 'xxx@qq.com', '0', '1', 103, 1, '2025-08-23 21:51:22', 1, '2025-08-25 21:42:09');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (108, '000000', 102, '0,100,102', '市场部门', null, 1, null, '15888888888', 'xxx@qq.com', '0', '1', 103, 1, '2025-08-23 21:51:22', 1, '2025-08-25 21:42:03');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (109, '000000', 102, '0,100,102', '财务部门', null, 2, null, '15888888888', 'xxx@qq.com', '0', '1', 103, 1, '2025-08-23 21:51:22', 1, '2025-08-25 21:42:01');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959256835975835649, '889144', 0, '0', '医梦AI', null, 0, 1959256836340740098, null, null, '0', '0', 103, 1, '2025-08-23 22:10:06', 1, '2025-08-23 22:10:06');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959258497121546242, '889144', 1959256835975835649, '0,1959256835975835649', '开发技术部', null, 0, 1959258627635703810, null, null, '0', '1', 1959256835975835649, 1959256836340740098, '2025-08-23 22:16:42', 1, '2025-08-25 21:34:18');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959923940537176065, '889144', 1959258497121546242, '0,1959256835975835649,1959258497121546242', '后端开发部', null, 0, null, null, null, '0', '1', 103, 1, '2025-08-25 18:20:56', 1, '2025-08-25 21:34:16');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959972661333364738, '889144', 1959256835975835649, '0,1959256835975835649', '深圳总部', null, 0, null, null, null, '0', '0', 103, 1, '2025-08-25 21:34:32', 1, '2025-08-25 21:34:32');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959972718552059906, '889144', 1959256835975835649, '0,1959256835975835649', '陕西运营中心', null, 1, null, null, null, '0', '0', 103, 1, '2025-08-25 21:34:45', 1, '2025-08-25 21:34:45');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959973138921984002, '889144', 1959972661333364738, '0,1959256835975835649,1959972661333364738', '总经办', null, 0, null, null, null, '0', '0', 103, 1, '2025-08-25 21:36:26', 1, '2025-08-25 21:36:26');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959973199605174273, '889144', 1959972661333364738, '0,1959256835975835649,1959972661333364738', '开发技术中心', null, 2, null, null, null, '0', '0', 103, 1, '2025-08-25 21:36:40', 1, '2025-08-25 21:36:40');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959976407618588674, '841063', 0, '0', '医梦 2', null, 0, 1959976407979298818, null, null, '0', '0', 103, 1, '2025-08-25 21:49:25', 1, '2025-08-25 21:49:25');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1959977653628866561, '841063', 1959976407618588674, '0,1959976407618588674', '技术部', null, 1, null, null, null, '0', '0', 103, 1, '2025-08-25 21:54:22', 1, '2025-08-25 21:54:22');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1960316477680717825, '938163', 0, '0', '医梦 3', null, 0, 1960316478058205186, null, null, '0', '0', 103, 1, '2025-08-26 20:20:44', 1, '2025-08-26 20:20:44');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1960317015717646337, '938163', 1960316477680717825, '0,1960316477680717825', '技术开发部', null, 1, null, null, null, '0', '0', 1960316477680717825, 1960316478058205186, '2025-08-26 20:22:52', 1960316478058205186, '2025-08-26 20:22:52');
INSERT INTO ruoyi.sys_dept (dept_id, tenant_id, parent_id, ancestors, dept_name, dept_category, order_num, leader, phone, email, status, del_flag, create_dept, create_by, create_time, update_by, update_time) VALUES (1960317285679828994, '938163', 1960316477680717825, '0,1960316477680717825', '木叶忍者村', null, 2, null, null, null, '0', '0', 1960316477680717825, 1960316478058205186, '2025-08-26 20:23:56', 1960316478058205186, '2025-08-26 20:23:56');
