DROP TABLE IF EXISTS wflow_departments;
CREATE TABLE wflow_departments (
  id bigserial NOT NULL,
  dept_name varchar(255),
  leader varchar(255),
  parent_id int8,
  created timestamp,
  updated timestamp,
  CONSTRAINT "wflow_departments_pri" PRIMARY KEY ("id")
)
CREATE  INDEX parent_idx  ON wflow_departments(parent_id);
CREATE  INDEX leader_idx  ON wflow_departments(leader);
comment ON TABLE wflow_departments IS '部门表';
comment ON column wflow_departments.id IS '主键';
comment ON column wflow_departments.dept_name IS '部门名';
comment ON column wflow_departments.leader IS '部门主管';
comment ON column wflow_departments.parent_id IS '父部门id';
-- ----------------------------
-- Records of wflow_departments
-- ----------------------------
INSERT INTO wflow_departments VALUES (35453, '业务部', '3286432', 4319868, '2020-09-16 13:30:37', '2022-09-25 17:49:29');
INSERT INTO wflow_departments VALUES (231535, '生产管理部', NULL, 1486186, '2020-09-16 13:30:39', '2020-09-16 13:30:42');
INSERT INTO wflow_departments VALUES (264868, '行政人事部', NULL, 1486186, '2020-09-16 13:30:42', '2020-09-16 13:30:44');
INSERT INTO wflow_departments VALUES (689698, '客服部', '489564', 4319868, '2020-09-16 13:30:34', '2022-09-04 18:26:20');
INSERT INTO wflow_departments VALUES (1486186, 'xx科技有限公司', '381496', 0, '2020-09-16 13:26:25', '2022-09-04 18:25:12');
INSERT INTO wflow_departments VALUES (4319868, '销售服务部', '927438', 1486186, '2020-09-16 13:30:44', '2022-09-04 18:26:07');
INSERT INTO wflow_departments VALUES (6179678, '研发部', '6418616', 1486186, '2020-09-16 13:26:56', '2022-09-04 18:25:49');