-- SmartFlow V3 数据库初始化脚本 - 人大金仓版本
-- 创建时间：2026-03-12
-- 数据库类型：KingbaseES V8
-- 源版本：MySQL 8.0+

-- ----------------------------
-- Table structure for flow_definition
-- ----------------------------
DROP TABLE IF EXISTS flow_definition;
CREATE TABLE flow_definition (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  flow_code VARCHAR(40) NOT NULL,
  flow_name VARCHAR(100) NOT NULL,
  model_value VARCHAR(20) NOT NULL DEFAULT 'CLASSICS',
  category VARCHAR(100),
  version VARCHAR(20) NOT NULL,
  is_publish SMALLINT NOT NULL DEFAULT 0,
  form_custom CHAR(1) DEFAULT 'N',
  form_path VARCHAR(100),
  activity_status SMALLINT NOT NULL DEFAULT 1,
  listener_type VARCHAR(100),
  listener_path VARCHAR(400),
  ext VARCHAR(500),
  create_time TIMESTAMP,
  update_time TIMESTAMP,
  create_by  varchar(64) ,
  update_by  varchar(64),
  del_flag CHAR(1) DEFAULT '0',
  tenant_id VARCHAR(40)
);

COMMENT ON TABLE flow_definition IS '流程定义表';
COMMENT ON COLUMN flow_definition.id IS '主键 id';
COMMENT ON COLUMN flow_definition.flow_code IS '流程编码';
COMMENT ON COLUMN flow_definition.flow_name IS '流程名称';
COMMENT ON COLUMN flow_definition.category IS '流程类别';
COMMENT ON COLUMN flow_definition.version IS '流程版本';
COMMENT ON COLUMN flow_definition.is_publish IS '是否发布（0 未发布 1 已发布 9 失效）';
COMMENT ON COLUMN flow_definition.form_custom IS '审批表单是否自定义（Y 是 N 否）';
COMMENT ON COLUMN flow_definition.form_path IS '审批表单路径';
COMMENT ON COLUMN flow_definition.activity_status IS '流程激活状态（0 挂起 1 激活）';
COMMENT ON COLUMN flow_definition.listener_type IS '监听器类型';
COMMENT ON COLUMN flow_definition.listener_path IS '监听器路径';
COMMENT ON COLUMN flow_definition.ext IS '业务详情 存业务表对象 json 字符串';
COMMENT ON COLUMN flow_definition.create_time IS '创建时间';
COMMENT ON COLUMN flow_definition.update_time IS '更新时间';
COMMENT ON COLUMN flow_definition.update_by IS '更新人';
COMMENT ON COLUMN flow_definition.create_by IS '创建人';
COMMENT ON COLUMN flow_definition.del_flag IS '删除标志';
COMMENT ON COLUMN flow_definition.model_value IS '设计器模型（CLASSICS经典模型 MIMIC仿钉钉模型）';
COMMENT ON COLUMN flow_definition.tenant_id IS '租户 id';

CREATE INDEX idx_flow_definition_del_flag ON flow_definition(del_flag);

-- ----------------------------
-- Table structure for flow_his_task
-- ----------------------------
DROP TABLE IF EXISTS flow_his_task;
CREATE TABLE flow_his_task (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  definition_id BIGINT NOT NULL,
  instance_id BIGINT NOT NULL,
  task_id BIGINT NOT NULL,
  node_code VARCHAR(100),
  node_name VARCHAR(100),
  node_type SMALLINT,
  target_node_code VARCHAR(200),
  target_node_name VARCHAR(200),
  approver VARCHAR(40),
  cooperate_type SMALLINT NOT NULL DEFAULT 0,
  collaborator VARCHAR(40),
  skip_type VARCHAR(10) NOT NULL,
  flow_status VARCHAR(20) NOT NULL,
  form_custom CHAR(1) DEFAULT 'N',
  form_path VARCHAR(100),
  message VARCHAR(500),
  variable TEXT,
  ext TEXT,
  create_time TIMESTAMP,
  update_time TIMESTAMP,
  del_flag CHAR(1) DEFAULT '0',
  tenant_id VARCHAR(40)
);

COMMENT ON TABLE flow_his_task IS '历史任务记录表';
COMMENT ON COLUMN flow_his_task.id IS '主键 id';
COMMENT ON COLUMN flow_his_task.definition_id IS '对应 flow_definition 表的 id';
COMMENT ON COLUMN flow_his_task.instance_id IS '对应 flow_instance 表的 id';
COMMENT ON COLUMN flow_his_task.task_id IS '对应 flow_task 表的 id';
COMMENT ON COLUMN flow_his_task.node_code IS '开始节点编码';
COMMENT ON COLUMN flow_his_task.node_name IS '开始节点名称';
COMMENT ON COLUMN flow_his_task.node_type IS '开始节点类型（0 开始节点 1 中间节点 2 结束节点 3 互斥网关 4 并行网关）';
COMMENT ON COLUMN flow_his_task.target_node_code IS '目标节点编码';
COMMENT ON COLUMN flow_his_task.target_node_name IS '结束节点名称';
COMMENT ON COLUMN flow_his_task.approver IS '审批者';
COMMENT ON COLUMN flow_his_task.cooperate_type IS '协作方式 (1 审批 2 转办 3 委派 4 会签 5 票签 6 加签 7 减签)';
COMMENT ON COLUMN flow_his_task.collaborator IS '协作人';
COMMENT ON COLUMN flow_his_task.skip_type IS '流转类型（PASS 通过 REJECT 退回 NONE 无动作）';
COMMENT ON COLUMN flow_his_task.flow_status IS '流程状态（0 待提交 1 审批中 2 审批通过 4 终止 5 作废 6 撤销 8 已完成 9 已退回 10 失效 11 拿回）';
COMMENT ON COLUMN flow_his_task.form_custom IS '审批表单是否自定义（Y 是 N 否）';
COMMENT ON COLUMN flow_his_task.form_path IS '审批表单路径';
COMMENT ON COLUMN flow_his_task.message IS '审批意见';
COMMENT ON COLUMN flow_his_task.variable IS '任务变量';
COMMENT ON COLUMN flow_his_task.ext IS '业务详情 存业务表对象 json 字符串';
COMMENT ON COLUMN flow_his_task.create_time IS '任务开始时间';
COMMENT ON COLUMN flow_his_task.update_time IS '审批完成时间';
COMMENT ON COLUMN flow_his_task.del_flag IS '删除标志';
COMMENT ON COLUMN flow_his_task.tenant_id IS '租户 id';

CREATE INDEX idx_flow_his_task_del_flag ON flow_his_task(del_flag);

-- ----------------------------
-- Table structure for flow_instance
-- ----------------------------
DROP TABLE IF EXISTS flow_instance;
CREATE TABLE flow_instance (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  definition_id BIGINT NOT NULL,
  business_id VARCHAR(40) NOT NULL,
  node_type SMALLINT NOT NULL,
  node_code VARCHAR(40) NOT NULL,
  node_name VARCHAR(100),
  variable TEXT,
  flow_status VARCHAR(20) NOT NULL,
  activity_status SMALLINT NOT NULL DEFAULT 1,
  def_json TEXT,
  create_by VARCHAR(64),
  create_time TIMESTAMP,
  update_time TIMESTAMP,
  update_by  varchar(64),
  ext VARCHAR(500),
  del_flag CHAR(1) DEFAULT '0',
  tenant_id VARCHAR(40)
);

COMMENT ON TABLE flow_instance IS '流程实例表';
COMMENT ON COLUMN flow_instance.id IS '主键 id';
COMMENT ON COLUMN flow_instance.definition_id IS '对应 flow_definition 表的 id';
COMMENT ON COLUMN flow_instance.business_id IS '业务 id';
COMMENT ON COLUMN flow_instance.node_type IS '节点类型（0 开始节点 1 中间节点 2 结束节点 3 互斥网关 4 并行网关）';
COMMENT ON COLUMN flow_instance.node_code IS '流程节点编码';
COMMENT ON COLUMN flow_instance.node_name IS '流程节点名称';
COMMENT ON COLUMN flow_instance.variable IS '任务变量';
COMMENT ON COLUMN flow_instance.flow_status IS '流程状态（0 待提交 1 审批中 2 审批通过 4 终止 5 作废 6 撤销 8 已完成 9 已退回 10 失效 11 拿回）';
COMMENT ON COLUMN flow_instance.activity_status IS '流程激活状态（0 挂起 1 激活）';
COMMENT ON COLUMN flow_instance.def_json IS '流程定义 json';
COMMENT ON COLUMN flow_instance.create_by IS '创建者';
COMMENT ON COLUMN flow_instance.create_time IS '创建时间';
COMMENT ON COLUMN flow_instance.update_time IS '更新时间';
COMMENT ON COLUMN flow_instance.ext IS '扩展字段，预留给业务系统使用';
COMMENT ON COLUMN flow_instance.del_flag IS '删除标志';
COMMENT ON COLUMN flow_instance.tenant_id IS '租户 id';

CREATE INDEX idx_flow_instance_del_flag ON flow_instance(del_flag);

-- ----------------------------
-- Table structure for flow_node
-- ----------------------------
DROP TABLE IF EXISTS flow_node;
CREATE TABLE flow_node (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  node_type SMALLINT NOT NULL,
  definition_id BIGINT NOT NULL,
  node_code VARCHAR(100) NOT NULL,
  node_name VARCHAR(100),
  permission_flag VARCHAR(200),
  node_ratio NUMERIC(6,3),
  coordinate VARCHAR(100),
  any_node_skip VARCHAR(100),
  listener_type VARCHAR(100),
  listener_path VARCHAR(400),
  handler_type VARCHAR(100),
  handler_path VARCHAR(400),
  form_custom CHAR(1) DEFAULT 'N',
  form_path VARCHAR(100),
  version VARCHAR(20) NOT NULL,
  create_time TIMESTAMP,
  update_time TIMESTAMP,
  create_by  varchar(64) ,
  update_by  varchar(64),
  ext TEXT,
  del_flag CHAR(1) DEFAULT '0',
  tenant_id VARCHAR(40)
);

COMMENT ON TABLE flow_node IS '流程节点表';
COMMENT ON COLUMN flow_node.id IS '主键 id';
COMMENT ON COLUMN flow_node.node_type IS '节点类型（0 开始节点 1 中间节点 2 结束节点 3 互斥网关 4 并行网关）';
COMMENT ON COLUMN flow_node.definition_id IS '流程定义 id';
COMMENT ON COLUMN flow_node.node_code IS '流程节点编码';
COMMENT ON COLUMN flow_node.node_name IS '流程节点名称';
COMMENT ON COLUMN flow_node.permission_flag IS '权限标识（权限类型：权限标识，可以多个，用逗号隔开)';
COMMENT ON COLUMN flow_node.node_ratio IS '流程签署比例值';
COMMENT ON COLUMN flow_node.coordinate IS '坐标';
COMMENT ON COLUMN flow_node.any_node_skip IS '任意结点跳转';
COMMENT ON COLUMN flow_node.listener_type IS '监听器类型';
COMMENT ON COLUMN flow_node.listener_path IS '监听器路径';
COMMENT ON COLUMN flow_node.handler_type IS '处理器类型';
COMMENT ON COLUMN flow_node.handler_path IS '处理器路径';
COMMENT ON COLUMN flow_node.form_custom IS '审批表单是否自定义（Y 是 N 否）';
COMMENT ON COLUMN flow_node.form_path IS '审批表单路径';
COMMENT ON COLUMN flow_node.version IS '版本';
COMMENT ON COLUMN flow_node.create_time IS '创建时间';
COMMENT ON COLUMN flow_node.update_time IS '更新时间';
COMMENT ON COLUMN flow_node.ext IS '扩展属性';
COMMENT ON COLUMN flow_node.del_flag IS '删除标志';
COMMENT ON COLUMN flow_node.tenant_id IS '租户 id';

CREATE INDEX idx_flow_node_del_flag ON flow_node(del_flag);

-- ----------------------------
-- Table structure for flow_skip
-- ----------------------------
DROP TABLE IF EXISTS flow_skip;
CREATE TABLE flow_skip (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  definition_id BIGINT NOT NULL,
  now_node_code VARCHAR(100) NOT NULL,
  now_node_type SMALLINT,
  next_node_code VARCHAR(100) NOT NULL,
  next_node_type SMALLINT,
  skip_name VARCHAR(100),
  skip_type VARCHAR(40),
  skip_condition VARCHAR(200),
  coordinate VARCHAR(100),
  create_time TIMESTAMP,
  update_time TIMESTAMP,
  create_by  varchar(64) ,
  update_by  varchar(64),
  del_flag CHAR(1) DEFAULT '0',
  tenant_id VARCHAR(40)
);

COMMENT ON TABLE flow_skip IS '节点跳转关联表';
COMMENT ON COLUMN flow_skip.id IS '主键 id';
COMMENT ON COLUMN flow_skip.definition_id IS '流程定义 id';
COMMENT ON COLUMN flow_skip.now_node_code IS '当前流程节点的编码';
COMMENT ON COLUMN flow_skip.now_node_type IS '当前节点类型（0 开始节点 1 中间节点 2 结束节点 3 互斥网关 4 并行网关）';
COMMENT ON COLUMN flow_skip.next_node_code IS '下一个流程节点的编码';
COMMENT ON COLUMN flow_skip.next_node_type IS '下一个节点类型（0 开始节点 1 中间节点 2 结束节点 3 互斥网关 4 并行网关）';
COMMENT ON COLUMN flow_skip.skip_name IS '跳转名称';
COMMENT ON COLUMN flow_skip.skip_type IS '跳转类型（PASS 审批通过 REJECT 退回）';
COMMENT ON COLUMN flow_skip.skip_condition IS '跳转条件';
COMMENT ON COLUMN flow_skip.coordinate IS '坐标';
COMMENT ON COLUMN flow_skip.create_time IS '创建时间';
COMMENT ON COLUMN flow_skip.update_time IS '更新时间';
COMMENT ON COLUMN flow_skip.del_flag IS '删除标志';
COMMENT ON COLUMN flow_skip.tenant_id IS '租户 id';

CREATE INDEX idx_flow_skip_del_flag ON flow_skip(del_flag);

-- ----------------------------
-- Table structure for flow_task
-- ----------------------------
DROP TABLE IF EXISTS flow_task;
CREATE TABLE flow_task (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  definition_id BIGINT NOT NULL,
  instance_id BIGINT NOT NULL,
  node_code VARCHAR(100) NOT NULL,
  node_name VARCHAR(100),
  node_type SMALLINT NOT NULL,
  flow_status VARCHAR(20) NOT NULL,
  form_custom CHAR(1) DEFAULT 'N',
  form_path VARCHAR(100),
  create_time TIMESTAMP,
  update_time TIMESTAMP,
  create_by  varchar(64) ,
  update_by  varchar(64),
  del_flag CHAR(1) DEFAULT '0',
  tenant_id VARCHAR(40)
);

COMMENT ON TABLE flow_task IS '待办任务表';
COMMENT ON COLUMN flow_task.id IS '主键 id';
COMMENT ON COLUMN flow_task.definition_id IS '对应 flow_definition 表的 id';
COMMENT ON COLUMN flow_task.instance_id IS '对应 flow_instance 表的 id';
COMMENT ON COLUMN flow_task.node_code IS '节点编码';
COMMENT ON COLUMN flow_task.node_name IS '节点名称';
COMMENT ON COLUMN flow_task.node_type IS '节点类型（0 开始节点 1 中间节点 2 结束节点 3 互斥网关 4 并行网关）';
COMMENT ON COLUMN flow_task.flow_status IS '流程状态（0 待提交 1 审批中 2 审批通过 4 终止 5 作废 6 撤销 8 已完成 9 已退回 10 失效 11 拿回）';
COMMENT ON COLUMN flow_task.form_custom IS '审批表单是否自定义（Y 是 N 否）';
COMMENT ON COLUMN flow_task.form_path IS '审批表单路径';
COMMENT ON COLUMN flow_task.create_time IS '创建时间';
COMMENT ON COLUMN flow_task.update_time IS '更新时间';
COMMENT ON COLUMN flow_task.del_flag IS '删除标志';
COMMENT ON COLUMN flow_task.tenant_id IS '租户 id';

CREATE INDEX idx_flow_task_del_flag ON flow_task(del_flag);

-- ----------------------------
-- Table structure for flow_user
-- ----------------------------
DROP TABLE IF EXISTS flow_user;
CREATE TABLE flow_user (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  type CHAR(1) NOT NULL,
  processed_by VARCHAR(80),
  associated BIGINT NOT NULL,
  create_time TIMESTAMP,
  create_by  varchar(64) ,
  update_by  varchar(64),
  update_time TIMESTAMP,
  del_flag CHAR(1) DEFAULT '0',
  tenant_id VARCHAR(40)
);

COMMENT ON TABLE flow_user IS '流程用户表';
COMMENT ON COLUMN flow_user.id IS '主键 id';
COMMENT ON COLUMN flow_user.type IS '人员类型（1 待办任务的审批人权限 2 待办任务的转办人权限 3 待办任务的委托人权限）';
COMMENT ON COLUMN flow_user.processed_by IS '权限人';
COMMENT ON COLUMN flow_user.associated IS '任务表 id';
COMMENT ON COLUMN flow_user.create_time IS '创建时间';
COMMENT ON COLUMN flow_user.create_by IS '创建人';
COMMENT ON COLUMN flow_user.update_time IS '更新时间';
COMMENT ON COLUMN flow_user.del_flag IS '删除标志';
COMMENT ON COLUMN flow_user.tenant_id IS '租户 id';

CREATE INDEX idx_flow_user_processed_type ON flow_user(processed_by, type);
CREATE INDEX idx_flow_user_associated ON flow_user(associated);
CREATE INDEX idx_flow_user_del_flag ON flow_user(del_flag);

-- ----------------------------
-- Table structure for t_category
-- ----------------------------
DROP TABLE IF EXISTS t_category;
CREATE TABLE t_category (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  parent_id BIGINT NOT NULL DEFAULT 0,
  sort INT NOT NULL DEFAULT 0,
  icon VARCHAR(255),
  create_user_id BIGINT NOT NULL,
  update_user_id BIGINT,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  deleted_flag SMALLINT NOT NULL DEFAULT 0
);

COMMENT ON TABLE t_category IS '商品分类表';
COMMENT ON COLUMN t_category.id IS '主键 ID';
COMMENT ON COLUMN t_category.name IS '分类名称';
COMMENT ON COLUMN t_category.parent_id IS '父分类 ID';
COMMENT ON COLUMN t_category.sort IS '排序';
COMMENT ON COLUMN t_category.icon IS '图标';
COMMENT ON COLUMN t_category.create_user_id IS '创建人 ID';
COMMENT ON COLUMN t_category.update_user_id IS '更新人 ID';
COMMENT ON COLUMN t_category.create_time IS '创建时间';
COMMENT ON COLUMN t_category.update_time IS '更新时间';
COMMENT ON COLUMN t_category.deleted_flag IS '删除标志';

CREATE INDEX idx_category_parent_id ON t_category(parent_id);
CREATE INDEX idx_category_deleted_flag ON t_category(deleted_flag);

-- ----------------------------
-- Table structure for t_config
-- ----------------------------
DROP TABLE IF EXISTS t_config;
CREATE TABLE t_config (
  config_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  config_name VARCHAR(100) NOT NULL,
  config_key VARCHAR(100) NOT NULL,
  config_value text,
  remark VARCHAR(100),
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_config IS '参数配置表';
COMMENT ON COLUMN t_config.config_id IS '主键 ID';
COMMENT ON COLUMN t_config.config_key IS '配置键';
COMMENT ON COLUMN t_config.config_value IS '配置值';
COMMENT ON COLUMN t_config.config_name IS '配置名称';
COMMENT ON COLUMN t_config.remark IS '备注';
COMMENT ON COLUMN t_config.create_time IS '创建时间';
COMMENT ON COLUMN t_config.update_time IS '更新时间';

-- ----------------------------
-- Records of t_config
-- ----------------------------
INSERT INTO t_config VALUES (1, '万能密码', 'super_password', '1024ok', '执行示例任务2', '2025-03-31 19:40:20', '2021-12-16 23:32:46');
INSERT INTO "public"."t_config" VALUES (2, '三级等保', 'level3_protect_config', '{
	"fileDetectFlag":true,
	"loginActiveTimeoutMinutes":30,
	"loginFailLockMinutes":30,
	"loginFailMaxTimes":3,
	"maxUploadFileSizeMb":30,
	"passwordComplexityEnabled":true,
	"regularChangePasswordMonths":3,
	"regularChangePasswordNotAllowRepeatTimes":3,
	"twoFactorLoginEnabled":false
}', 'SmartJob Sample2 update', '2024-09-03 21:49:23', '2024-08-13 11:44:49');
-- ----------------------------
-- Table structure for t_department
-- ----------------------------
DROP TABLE IF EXISTS t_department;
CREATE TABLE t_department (
  department_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 2 INCREMENT BY 1) PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  code varchar COLLATE pg_catalog.default,
  police_type varchar COLLATE pg_catalog.default,
  parent_id BIGINT NOT NULL DEFAULT 0,
  sort INT NOT NULL DEFAULT 0,
  manager_id BIGINT,
  phone VARCHAR(50),
  email VARCHAR(100),
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_user_id BIGINT,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_department IS '部门表';
COMMENT ON COLUMN t_department.department_id IS '部门 ID';
COMMENT ON COLUMN t_department.name IS '部门名称';
COMMENT ON COLUMN t_department.parent_id IS '父部门 ID';
COMMENT ON COLUMN t_department.sort IS '排序';
COMMENT ON COLUMN t_department.manager_id IS '负责人 ID';
COMMENT ON COLUMN t_department.phone IS '联系电话';
COMMENT ON COLUMN t_department.email IS '邮箱';
COMMENT ON COLUMN t_department.disabled_flag IS '是否禁用';
COMMENT ON COLUMN t_department.deleted_flag IS '删除标志';
COMMENT ON COLUMN t_department.create_user_id IS '创建人 ID';
COMMENT ON COLUMN t_department.create_time IS '创建时间';
COMMENT ON COLUMN t_department.update_user_id IS '更新人 ID';
COMMENT ON COLUMN t_department.update_time IS '更新时间';
COMMENT ON COLUMN public.t_department.police_type IS '警种';
COMMENT ON COLUMN public.t_department.code IS '机构编码';

CREATE INDEX idx_department_parent_id ON t_department(parent_id);
CREATE INDEX idx_department_deleted_flag ON t_department(deleted_flag);

-- ----------------------------
-- Records of t_department
-- ----------------------------
INSERT INTO public.t_department VALUES (1, '安徽省公安厅', '340000000000', '99',0, 0,null,null,null, 0, 1, 1,'2022-10-19 20:17:09',1, '2022-10-19 20:17:09');
-- ----------------------------
-- Table structure for t_dict
-- ----------------------------
DROP TABLE IF EXISTS t_dict;
CREATE TABLE t_dict (
  dict_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  dict_name VARCHAR(100) NOT NULL,
  dict_code VARCHAR(100) NOT NULL,
  remark VARCHAR(255),
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_dict IS '数据字典表';
COMMENT ON COLUMN t_dict.dict_id IS '字典 ID';
COMMENT ON COLUMN t_dict.dict_name IS '字典名称';
COMMENT ON COLUMN t_dict.dict_code IS '字典类型';
COMMENT ON COLUMN t_dict.remark IS '备注';
COMMENT ON COLUMN t_dict.create_time IS '创建时间';
COMMENT ON COLUMN t_dict.update_time IS '更新时间';

CREATE UNIQUE INDEX uk_dict_dict_type ON t_dict(dict_code);

-- ----------------------------
-- Records of t_dict
-- ----------------------------
INSERT INTO public.t_dict VALUES (2, '警种', 'POLICE_TYPE', '', 0, '2026-03-10 16:05:06', '2026-03-10 16:05:06');
INSERT INTO public.t_dict VALUES (5, '维权申请类型', 'RIGHTS_APPLY_TYPE', '', 0, '2026-03-11 14:31:07', '2026-03-11 14:31:07');

-- ----------------------------
-- Table structure for t_dict_data
-- ----------------------------
DROP TABLE IF EXISTS t_dict_data;
CREATE TABLE t_dict_data (
  dict_data_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 24 INCREMENT BY 1) PRIMARY KEY,
  dict_id BIGINT NOT NULL,
  data_value VARCHAR(100) NOT NULL,
  data_label VARCHAR(100) NOT NULL,
  remark VARCHAR(255),
  sort_order INT NOT NULL DEFAULT 0,
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_dict_data IS '字典数据表';
COMMENT ON COLUMN t_dict_data.dict_data_id IS '字典数据 ID';
COMMENT ON COLUMN t_dict_data.dict_id IS '字典 ID';
COMMENT ON COLUMN t_dict_data.data_label IS '字典标签';
COMMENT ON COLUMN t_dict_data.data_value IS '字典值';
COMMENT ON COLUMN t_dict_data.sort_order IS '排序';
COMMENT ON COLUMN t_dict_data.remark IS '备注';
COMMENT ON COLUMN t_dict_data.disabled_flag IS '是否禁用';
COMMENT ON COLUMN t_dict_data.create_time IS '创建时间';
COMMENT ON COLUMN t_dict_data.update_time IS '更新时间';

CREATE INDEX idx_dict_data_dict_id ON t_dict_data(dict_id);

-- ----------------------------
-- Records of t_dict_data
-- ----------------------------
INSERT INTO public.t_dict_data VALUES (1, 5, '1', '本人申请', '', 0, 0, '2026-03-11 14:34:50', '2026-03-11 14:34:50');
INSERT INTO public.t_dict_data VALUES (2, 5, '2', '非本人申请', '', 1, 0, '2026-03-11 14:35:02', '2026-03-11 14:35:02');
INSERT INTO public.t_dict_data VALUES (3, 2, '1', '派出所', '', 0, 0, '2026-03-10 16:05:21', '2026-03-10 16:05:21');
INSERT INTO public.t_dict_data VALUES (4, 2, '2', '治安', '', 0, 0, '2026-03-10 16:06:53', '2026-03-10 16:06:53');
INSERT INTO public.t_dict_data VALUES (5, 2, '3', '交警', '', 0, 0, '2026-03-10 16:07:00', '2026-03-10 16:07:00');
INSERT INTO public.t_dict_data VALUES (6, 2, '99', '其他', '', 0, 0, '2026-03-11 14:35:09', '2026-03-11 14:35:09');
INSERT INTO public.t_dict_data VALUES (7, 2, '4', '刑侦', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (8, 2, '5', '经侦', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (9, 2, '6', '禁毒', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (10, 2, '7', '网安', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (11, 2, '8', '特警', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (12, 2, '9', '户政', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (13, 2, '10', '出入境', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (14, 2, '11', '法制', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (15, 2, '12', '督审信', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (16, 2, '13', '监所管理', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (17, 2, '14', '食药环侦', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (18, 2, '15', '科信', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (19, 2, '16', '警务保障', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (20, 2, '17', '政治部', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (22, 2, '19', '机关党委', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public.t_dict_data VALUES (23, 2, '20', '离退休工作处', '', 0, 0, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);

-- ----------------------------
-- Table structure for t_employee
-- ----------------------------
DROP TABLE IF EXISTS t_employee;
CREATE TABLE t_employee (
  employee_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  login_name varchar COLLATE pg_catalog.default NOT NULL,
  login_pwd varchar COLLATE pg_catalog.default NOT NULL,
  actual_name varchar COLLATE pg_catalog.default NOT NULL,
  id_no varchar COLLATE pg_catalog.default,
  police_no varchar COLLATE pg_catalog.default,
  user_type smallint,
  avatar varchar COLLATE pg_catalog.default,
  gender smallint NOT NULL,
  phone varchar COLLATE pg_catalog.default,
  department_id bigint NOT NULL,
  position_id bigint,
  email varchar COLLATE pg_catalog.default,
  disabled_flag smallint NOT NULL,
  deleted_flag smallint NOT NULL,
  administrator_flag smallint NOT NULL,
  remark varchar COLLATE pg_catalog.default,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON COLUMN public.t_employee.employee_id IS '主键';
COMMENT ON COLUMN public.t_employee.login_name IS '登录帐号';
COMMENT ON COLUMN public.t_employee.login_pwd IS '登录密码';
COMMENT ON COLUMN public.t_employee.actual_name IS '员工名称';
COMMENT ON COLUMN public.t_employee.gender IS '性别';
COMMENT ON COLUMN public.t_employee.phone IS '手机号码';
COMMENT ON COLUMN public.t_employee.department_id IS '部门id';
COMMENT ON COLUMN public.t_employee.position_id IS '职务ID';
COMMENT ON COLUMN public.t_employee.email IS '邮箱';
COMMENT ON COLUMN public.t_employee.disabled_flag IS '是否被禁用 0否1是';
COMMENT ON COLUMN public.t_employee.deleted_flag IS '是否删除0否 1是';
COMMENT ON COLUMN public.t_employee.administrator_flag IS '是否为超级管理员: 0 不是，1是';
COMMENT ON COLUMN public.t_employee.remark IS '备注';
COMMENT ON COLUMN public.t_employee.update_time IS '更新时间';
COMMENT ON COLUMN public.t_employee.create_time IS '创建时间';
COMMENT ON COLUMN public.t_employee.id_no IS '身份证号';
COMMENT ON COLUMN public.t_employee.police_no IS '警官号';
COMMENT ON COLUMN public.t_employee.user_type IS '人员类型（1：民警；2：辅警）';
COMMENT ON TABLE public.t_employee IS '员工表';

-- ----------------------------
-- Records of t_employee
-- ----------------------------
INSERT INTO t_employee VALUES (1, 'admin', '$argon2id$v=19$m=16384,t=2,p=1$e/hqRAZYCYHydMS3SPo7yA$5hdCxLG7q+Jtf6KLJHVg/yb0I8LZrPuKUF66jLq+Drc', '管理员', '340100202603131614','admin', 1,'public/common/e2322af94c074632835a8ababee28e3e_20250412123613.jpg', 0, '13500000000', 1, 3, '1@1.com', 0, 0, 1, NULL, '2025-04-12 12:36:11', '2022-10-04 21:33:50');


-- ----------------------------
-- Table structure for t_file
-- ----------------------------
DROP TABLE IF EXISTS t_file;
CREATE TABLE t_file (
  file_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  folder_type VARCHAR(255) NOT NULL,
  file_name VARCHAR(255) NOT NULL,
  file_size BIGINT NOT NULL DEFAULT 0,
  file_key VARCHAR(255) NOT NULL,
  file_type VARCHAR(50),
  creator_id BIGINT NOT NULL,
  creator_user_type int  NULL DEFAULT NULL,
  creator_name VARCHAR(255) NULL,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);


CREATE UNIQUE INDEX uk_file_file_key ON t_file(file_key);
CREATE INDEX idx_file_create_time ON t_file(create_time);

-- ----------------------------
-- Table structure for t_goods
-- ----------------------------
DROP TABLE IF EXISTS t_goods;
CREATE TABLE t_goods (
  goods_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  goods_name VARCHAR(200) NOT NULL,
  goods_code VARCHAR(100),
  category_id BIGINT NOT NULL,
  price NUMERIC(10,2) NOT NULL DEFAULT 0.00,
  stock INT NOT NULL DEFAULT 0,
  description TEXT,
  main_image_url TEXT,
  image_urls TEXT,
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_user_id BIGINT,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_goods IS '商品表';
COMMENT ON COLUMN t_goods.goods_id IS '商品 ID';
COMMENT ON COLUMN t_goods.goods_name IS '商品名称';
COMMENT ON COLUMN t_goods.goods_code IS '商品编码';
COMMENT ON COLUMN t_goods.category_id IS '分类 ID';
COMMENT ON COLUMN t_goods.price IS '价格';
COMMENT ON COLUMN t_goods.stock IS '库存';
COMMENT ON COLUMN t_goods.description IS '描述';
COMMENT ON COLUMN t_goods.main_image_url IS '主图 URL';
COMMENT ON COLUMN t_goods.image_urls IS '图片 URLs';
COMMENT ON COLUMN t_goods.disabled_flag IS '是否禁用';
COMMENT ON COLUMN t_goods.deleted_flag IS '删除标志';
COMMENT ON COLUMN t_goods.create_user_id IS '创建人 ID';
COMMENT ON COLUMN t_goods.create_time IS '创建时间';
COMMENT ON COLUMN t_goods.update_user_id IS '更新人 ID';
COMMENT ON COLUMN t_goods.update_time IS '更新时间';

CREATE INDEX idx_goods_category_id ON t_goods(category_id);
CREATE INDEX idx_goods_deleted_flag ON t_goods(deleted_flag);

-- ----------------------------
-- Table structure for t_leave
-- ----------------------------
DROP TABLE IF EXISTS t_leave;
CREATE TABLE t_leave (
  leave_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  employee_id BIGINT NOT NULL,
  leave_type SMALLINT NOT NULL,
  start_date TIMESTAMP NOT NULL,
  end_date TIMESTAMP NOT NULL,
  days NUMERIC(6,2) NOT NULL,
  reason TEXT,
  flow_status VARCHAR(20),
  instance_id BIGINT,
  node_name VARCHAR(100),
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_user_id BIGINT,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_leave IS '请假申请表';
COMMENT ON COLUMN t_leave.leave_id IS '请假 ID';
COMMENT ON COLUMN t_leave.employee_id IS '员工 ID';
COMMENT ON COLUMN t_leave.leave_type IS '请假类型';
COMMENT ON COLUMN t_leave.start_date IS '开始日期';
COMMENT ON COLUMN t_leave.end_date IS '结束日期';
COMMENT ON COLUMN t_leave.days IS '请假天数';
COMMENT ON COLUMN t_leave.reason IS '请假事由';
COMMENT ON COLUMN t_leave.flow_status IS '流程状态';
COMMENT ON COLUMN t_leave.instance_id IS '流程实例 ID';
COMMENT ON COLUMN t_leave.node_name IS '节点名称';
COMMENT ON COLUMN t_leave.deleted_flag IS '删除标志';
COMMENT ON COLUMN t_leave.create_user_id IS '创建人 ID';
COMMENT ON COLUMN t_leave.create_time IS '创建时间';
COMMENT ON COLUMN t_leave.update_user_id IS '更新人 ID';
COMMENT ON COLUMN t_leave.update_time IS '更新时间';

CREATE INDEX idx_leave_employee_id ON t_leave(employee_id);
CREATE INDEX idx_leave_deleted_flag ON t_leave(deleted_flag);

-- ----------------------------
-- Table structure for t_login_log
-- ----------------------------
DROP TABLE IF EXISTS t_login_log;
CREATE TABLE t_login_log (
                             login_log_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 2042) PRIMARY KEY,
                             user_id INTEGER NOT NULL,
                             user_type INTEGER NOT NULL,
                             user_name VARCHAR(1000) NOT NULL,
                             login_ip VARCHAR(1000),
                             login_ip_region VARCHAR(1000),
                             user_agent TEXT,
                             login_device VARCHAR(1000),
                             login_result INTEGER NOT NULL,
                             remark VARCHAR(2000),
                             update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
                             create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_login_log IS '用户登录日志';
COMMENT ON COLUMN t_login_log.login_log_id IS '主键';
COMMENT ON COLUMN t_login_log.user_id IS '用户id';
COMMENT ON COLUMN t_login_log.user_type IS '用户类型';
COMMENT ON COLUMN t_login_log.user_name IS '用户名';
COMMENT ON COLUMN t_login_log.login_ip IS '用户ip';
COMMENT ON COLUMN t_login_log.login_ip_region IS '用户ip地区';
COMMENT ON COLUMN t_login_log.user_agent IS 'user-agent信息';
COMMENT ON COLUMN t_login_log.login_device IS '登录设备';
COMMENT ON COLUMN t_login_log.login_result IS '登录结果：0成功 1失败 2 退出';
COMMENT ON COLUMN t_login_log.remark IS '备注';
COMMENT ON COLUMN t_login_log.update_time IS '更新时间';
COMMENT ON COLUMN t_login_log.create_time IS '创建时间';

CREATE INDEX idx_t_login_log_user_id ON t_login_log (user_id);

-- ----------------------------
-- Table structure for t_work_book
-- ----------------------------
DROP TABLE IF EXISTS t_work_book;
CREATE TABLE t_work_book (
  work_book_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  file_id BIGINT NOT NULL,
  folder_type SMALLINT NOT NULL,
  file_name VARCHAR(255) NOT NULL,
  file_size BIGINT NOT NULL DEFAULT 0,
  file_key VARCHAR(255) NOT NULL,
  file_type VARCHAR(50),
  creator_id BIGINT NOT NULL,
  creator_user_type SMALLINT,
  creator_name VARCHAR(255),
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_work_book IS '工作手册表';
COMMENT ON COLUMN t_work_book.work_book_id IS '工作手册 ID';
COMMENT ON COLUMN t_work_book.file_id IS '文件 ID';
COMMENT ON COLUMN t_work_book.folder_type IS '手册类型 (1 常用文书 2 法律文书 3 相关规定 4 其他)';
COMMENT ON COLUMN t_work_book.file_name IS '文件名称';
COMMENT ON COLUMN t_work_book.file_size IS '文件大小 (字节)';
COMMENT ON COLUMN t_work_book.file_key IS '文件 key，用于下载';
COMMENT ON COLUMN t_work_book.file_type IS '文件类型 (扩展名)';
COMMENT ON COLUMN t_work_book.creator_id IS '创建人 ID';
COMMENT ON COLUMN t_work_book.creator_user_type IS '创建人类型';
COMMENT ON COLUMN t_work_book.creator_name IS '创建人姓名';
COMMENT ON COLUMN t_work_book.update_time IS '更新时间';
COMMENT ON COLUMN t_work_book.create_time IS '创建时间';

CREATE UNIQUE INDEX uk_work_book_file_key ON t_work_book(file_key);
CREATE INDEX idx_work_book_folder_type ON t_work_book(folder_type);
CREATE INDEX idx_work_book_create_time ON t_work_book(create_time);
CREATE INDEX idx_work_book_creator_id ON t_work_book(creator_id);

-- ----------------------------
-- Table structure for t_operate_log
-- ----------------------------
-- 人大金仓（KingbaseES）兼容的建表语句
-- 注意：KingbaseES不支持 ROW_FORMAT 和 USING BTREE 语法，已移除
-- 自增列使用 SERIAL 或 IDENTITY 语法，此处采用兼容性更好的 SERIAL
-- 注释语法调整为 KingbaseES 支持的格式

DROP TABLE IF EXISTS t_operate_log;
CREATE TABLE t_operate_log (
                               operate_log_id BIGSERIAL NOT NULL, -- 使用 BIGSERIAL 替代 BIGINT NOT NULL AUTO_INCREMENT
                               operate_user_id BIGINT NOT NULL,
                               operate_user_type INTEGER NOT NULL,
                               operate_user_name VARCHAR(50) NOT NULL,
                               module VARCHAR(50),
                               content VARCHAR(500),
                               url VARCHAR(100),
                               method VARCHAR(100),
                               param TEXT,
                               ip VARCHAR(255),
                               ip_region VARCHAR(1000),
                               user_agent TEXT,
                               success_flag SMALLINT, -- KingbaseES 无 TINYINT，使用 SMALLINT
                               fail_reason TEXT, -- KingbaseES 无 LONGTEXT，使用 TEXT
                               update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                               create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                               PRIMARY KEY (operate_log_id)
);

-- 添加表注释和列注释（KingbaseES 使用 COMMENT ON 语法）
COMMENT ON TABLE t_operate_log IS '操作记录';
COMMENT ON COLUMN t_operate_log.operate_log_id IS '主键';
COMMENT ON COLUMN t_operate_log.operate_user_id IS '用户id';
COMMENT ON COLUMN t_operate_log.operate_user_type IS '用户类型';
COMMENT ON COLUMN t_operate_log.operate_user_name IS '用户名称';
COMMENT ON COLUMN t_operate_log.module IS '操作模块';
COMMENT ON COLUMN t_operate_log.content IS '操作内容';
COMMENT ON COLUMN t_operate_log.url IS '请求路径';
COMMENT ON COLUMN t_operate_log.method IS '请求方法';
COMMENT ON COLUMN t_operate_log.param IS '请求参数';
COMMENT ON COLUMN t_operate_log.ip IS '请求ip';
COMMENT ON COLUMN t_operate_log.ip_region IS '请求ip地区';
COMMENT ON COLUMN t_operate_log.user_agent IS '请求user-agent';
COMMENT ON COLUMN t_operate_log.success_flag IS '请求结果 0失败 1成功';
COMMENT ON COLUMN t_operate_log.fail_reason IS '失败原因';
COMMENT ON COLUMN t_operate_log.update_time IS '更新时间';
COMMENT ON COLUMN t_operate_log.create_time IS '创建时间';

-- ----------------------------
-- Table structure for t_change_log
-- ----------------------------
DROP TABLE IF EXISTS t_change_log;
CREATE TABLE t_change_log (
  change_log_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  version VARCHAR(255) NOT NULL,
  type INT NOT NULL,
  publish_author VARCHAR(255) NOT NULL,
  public_date DATE NOT NULL,
  content TEXT NOT NULL,
  link TEXT,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_change_log IS '系统更新日志';
COMMENT ON COLUMN t_change_log.change_log_id IS '更新日志id';
COMMENT ON COLUMN t_change_log.version IS '版本';
COMMENT ON COLUMN t_change_log.type IS '更新类型:[1:特大版本功能更新;2:功能更新;3:bug修复]';
COMMENT ON COLUMN t_change_log.publish_author IS '发布人';
COMMENT ON COLUMN t_change_log.public_date IS '发布日期';
COMMENT ON COLUMN t_change_log.content IS '更新内容';
COMMENT ON COLUMN t_change_log.link IS '跳转链接';
COMMENT ON COLUMN t_change_log.create_time IS '创建时间';
COMMENT ON COLUMN t_change_log.update_time IS '更新时间';

CREATE UNIQUE INDEX version_unique ON t_change_log(version);

-- ----------------------------
-- Table structure for t_code_generator_config
-- ----------------------------
DROP TABLE IF EXISTS t_code_generator_config;
CREATE TABLE t_code_generator_config (
  table_name VARCHAR(255) NOT NULL PRIMARY KEY,
  basic TEXT,
  fields TEXT,
  insert_and_update TEXT,
  delete_info TEXT,
  query_fields TEXT,
  table_fields TEXT,
  detail TEXT,
  create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_code_generator_config IS '代码生成器的每个表的配置';
COMMENT ON COLUMN t_code_generator_config.table_name IS '表名';
COMMENT ON COLUMN t_code_generator_config.basic IS '基础命名信息';
COMMENT ON COLUMN t_code_generator_config.fields IS '字段列表';
COMMENT ON COLUMN t_code_generator_config.insert_and_update IS '新建、修改';
COMMENT ON COLUMN t_code_generator_config.delete_info IS '删除';
COMMENT ON COLUMN t_code_generator_config.query_fields IS '查询';
COMMENT ON COLUMN t_code_generator_config.table_fields IS '列表';
COMMENT ON COLUMN t_code_generator_config.detail IS '详情';
COMMENT ON COLUMN t_code_generator_config.create_time IS '创建时间';
COMMENT ON COLUMN t_code_generator_config.update_time IS '更新时间';

CREATE UNIQUE INDEX table_unique ON t_code_generator_config(table_name);

-- ----------------------------
-- Table structure for t_data_tracer
-- ----------------------------
DROP TABLE IF EXISTS t_data_tracer;
CREATE TABLE t_data_tracer (
  data_tracer_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  data_id BIGINT NOT NULL,
  type INT NOT NULL,
  content TEXT,
  diff_old TEXT,
  diff_new TEXT,
  extra_data TEXT,
  user_id BIGINT NOT NULL,
  user_type INT NOT NULL,
  user_name VARCHAR(50) NOT NULL,
  ip VARCHAR(50),
  ip_region VARCHAR(1000),
  user_agent VARCHAR(2000),
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_data_tracer IS '各种单据操作记录';
COMMENT ON COLUMN t_data_tracer.data_tracer_id IS '自增id';
COMMENT ON COLUMN t_data_tracer.data_id IS '各种单据的id';
COMMENT ON COLUMN t_data_tracer.type IS '单据类型';
COMMENT ON COLUMN t_data_tracer.content IS '操作内容';
COMMENT ON COLUMN t_data_tracer.diff_old IS '差异：旧的数据';
COMMENT ON COLUMN t_data_tracer.diff_new IS '差异：新的数据';
COMMENT ON COLUMN t_data_tracer.extra_data IS '额外信息';
COMMENT ON COLUMN t_data_tracer.user_id IS '用户id';
COMMENT ON COLUMN t_data_tracer.user_type IS '用户类型：1 后管用户 ';
COMMENT ON COLUMN t_data_tracer.user_name IS '用户名称';
COMMENT ON COLUMN t_data_tracer.ip IS 'ip';
COMMENT ON COLUMN t_data_tracer.ip_region IS 'ip地区';
COMMENT ON COLUMN t_data_tracer.user_agent IS '用户ua';
COMMENT ON COLUMN t_data_tracer.update_time IS '更新时间';
COMMENT ON COLUMN t_data_tracer.create_time IS '创建时间';

CREATE INDEX idx_data_tracer_data_id ON t_data_tracer(data_id, type);

-- ----------------------------
-- Table structure for t_feedback
-- ----------------------------
DROP TABLE IF EXISTS t_feedback;
CREATE TABLE t_feedback (
  feedback_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  feedback_content TEXT,
  feedback_attachment VARCHAR(500),
  user_id BIGINT NOT NULL,
  user_type INT NOT NULL,
  user_name VARCHAR(50) NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_feedback IS '意见反馈';
COMMENT ON COLUMN t_feedback.feedback_id IS '主键';
COMMENT ON COLUMN t_feedback.feedback_content IS '反馈内容';
COMMENT ON COLUMN t_feedback.feedback_attachment IS '反馈图片';
COMMENT ON COLUMN t_feedback.user_id IS '创建人id';
COMMENT ON COLUMN t_feedback.user_type IS '创建人用户类型';
COMMENT ON COLUMN t_feedback.user_name IS '创建人姓名';
COMMENT ON COLUMN t_feedback.create_time IS '创建时间';
COMMENT ON COLUMN t_feedback.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_heart_beat_record
-- ----------------------------
DROP TABLE IF EXISTS t_heart_beat_record;
CREATE TABLE t_heart_beat_record (
  heart_beat_record_id INT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  project_path VARCHAR(100) NOT NULL,
  server_ip VARCHAR(200) NOT NULL,
  process_no INT NOT NULL,
  process_start_time TIMESTAMP NOT NULL,
  heart_beat_time TIMESTAMP NOT NULL
);

COMMENT ON TABLE t_heart_beat_record IS '公用服务 - 服务心跳';
COMMENT ON COLUMN t_heart_beat_record.heart_beat_record_id IS '自增id';
COMMENT ON COLUMN t_heart_beat_record.project_path IS '项目名称';
COMMENT ON COLUMN t_heart_beat_record.server_ip IS '服务器ip';
COMMENT ON COLUMN t_heart_beat_record.process_no IS '进程号';
COMMENT ON COLUMN t_heart_beat_record.process_start_time IS '进程开启时间';
COMMENT ON COLUMN t_heart_beat_record.heart_beat_time IS '心跳时间';

-- ----------------------------
-- Table structure for t_help_doc
-- ----------------------------
DROP TABLE IF EXISTS t_help_doc;
CREATE TABLE t_help_doc (
  help_doc_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  help_doc_catalog_id BIGINT NOT NULL,
  title VARCHAR(200) NOT NULL,
  content_text TEXT NOT NULL,
  content_html TEXT NOT NULL,
  attachment VARCHAR(1000),
  sort INT NOT NULL DEFAULT 0,
  page_view_count INT NOT NULL DEFAULT 0,
  user_view_count INT NOT NULL DEFAULT 0,
  author VARCHAR(1000),
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_help_doc IS '帮助文档';
COMMENT ON COLUMN t_help_doc.help_doc_id IS '自增id';
COMMENT ON COLUMN t_help_doc.help_doc_catalog_id IS '类型1公告 2动态';
COMMENT ON COLUMN t_help_doc.title IS '标题';
COMMENT ON COLUMN t_help_doc.content_text IS '文本内容';
COMMENT ON COLUMN t_help_doc.content_html IS 'html内容';
COMMENT ON COLUMN t_help_doc.attachment IS '附件';
COMMENT ON COLUMN t_help_doc.sort IS '排序';
COMMENT ON COLUMN t_help_doc.page_view_count IS '页面浏览量，传说中的pv';
COMMENT ON COLUMN t_help_doc.user_view_count IS '用户浏览量，传说中的uv';
COMMENT ON COLUMN t_help_doc.author IS '作者';
COMMENT ON COLUMN t_help_doc.update_time IS '更新时间';
COMMENT ON COLUMN t_help_doc.create_time IS '创建时间';

-- ----------------------------
-- Table structure for t_help_doc_catalog
-- ----------------------------
DROP TABLE IF EXISTS t_help_doc_catalog;
CREATE TABLE t_help_doc_catalog (
  help_doc_catalog_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  name VARCHAR(1000) NOT NULL,
  sort INT NOT NULL DEFAULT 0,
  parent_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_help_doc_catalog IS '帮助文档-目录';
COMMENT ON COLUMN t_help_doc_catalog.help_doc_catalog_id IS '帮助文档目录';
COMMENT ON COLUMN t_help_doc_catalog.name IS '名称';
COMMENT ON COLUMN t_help_doc_catalog.sort IS '排序字段';
COMMENT ON COLUMN t_help_doc_catalog.parent_id IS '父级id';
COMMENT ON COLUMN t_help_doc_catalog.create_time IS '创建时间';
COMMENT ON COLUMN t_help_doc_catalog.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_help_doc_relation
-- ----------------------------
DROP TABLE IF EXISTS t_help_doc_relation;
CREATE TABLE t_help_doc_relation (
  relation_id BIGINT NOT NULL,
  relation_name VARCHAR(255),
  help_doc_id BIGINT NOT NULL,
  create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (relation_id, help_doc_id)
);

COMMENT ON TABLE t_help_doc_relation IS '帮助文档-关联表';
COMMENT ON COLUMN t_help_doc_relation.relation_id IS '关联id';
COMMENT ON COLUMN t_help_doc_relation.relation_name IS '关联名称';
COMMENT ON COLUMN t_help_doc_relation.help_doc_id IS '文档id';
COMMENT ON COLUMN t_help_doc_relation.create_time IS '创建时间';
COMMENT ON COLUMN t_help_doc_relation.update_time IS '更新时间';

CREATE UNIQUE INDEX uni_menu_help_doc ON t_help_doc_relation(relation_id, help_doc_id);

-- ----------------------------
-- Table structure for t_help_doc_view_record
-- ----------------------------
DROP TABLE IF EXISTS t_help_doc_view_record;
CREATE TABLE t_help_doc_view_record (
  help_doc_id BIGINT NOT NULL,
  user_id BIGINT NOT NULL,
  user_name VARCHAR(255),
  page_view_count INT DEFAULT 0,
  first_ip VARCHAR(255),
  first_user_agent VARCHAR(1000),
  last_ip VARCHAR(255),
  last_user_agent VARCHAR(1000),
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (help_doc_id, user_id)
);

COMMENT ON TABLE t_help_doc_view_record IS '帮助文档-查看记录';
COMMENT ON COLUMN t_help_doc_view_record.help_doc_id IS '通知公告id';
COMMENT ON COLUMN t_help_doc_view_record.user_id IS '用户id';
COMMENT ON COLUMN t_help_doc_view_record.user_name IS '用户名称';
COMMENT ON COLUMN t_help_doc_view_record.page_view_count IS '查看次数';
COMMENT ON COLUMN t_help_doc_view_record.first_ip IS '首次ip';
COMMENT ON COLUMN t_help_doc_view_record.first_user_agent IS '首次用户设备等标识';
COMMENT ON COLUMN t_help_doc_view_record.last_ip IS '最后一次ip';
COMMENT ON COLUMN t_help_doc_view_record.last_user_agent IS '最后一次用户设备等标识';
COMMENT ON COLUMN t_help_doc_view_record.create_time IS '创建时间';
COMMENT ON COLUMN t_help_doc_view_record.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_login_fail
-- ----------------------------
DROP TABLE IF EXISTS t_login_fail;
CREATE TABLE t_login_fail (
  login_fail_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  user_id BIGINT NOT NULL,
  user_type INT NOT NULL,
  login_name VARCHAR(1000),
  login_fail_count INT,
  lock_flag SMALLINT DEFAULT 0,
  login_lock_begin_time TIMESTAMP,
  create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_login_fail IS '登录失败次数记录表';
COMMENT ON COLUMN t_login_fail.login_fail_id IS '自增id';
COMMENT ON COLUMN t_login_fail.user_id IS '用户id';
COMMENT ON COLUMN t_login_fail.user_type IS '用户类型';
COMMENT ON COLUMN t_login_fail.login_name IS '登录名';
COMMENT ON COLUMN t_login_fail.login_fail_count IS '连续登录失败次数';
COMMENT ON COLUMN t_login_fail.lock_flag IS '锁定状态:1锁定，0未锁定';
COMMENT ON COLUMN t_login_fail.login_lock_begin_time IS '连续登录失败锁定开始时间';
COMMENT ON COLUMN t_login_fail.create_time IS '创建时间';
COMMENT ON COLUMN t_login_fail.update_time IS '更新时间';

CREATE UNIQUE INDEX uid_and_utype ON t_login_fail(user_id, user_type);

-- ----------------------------
-- Table structure for t_mail_template
-- ----------------------------
DROP TABLE IF EXISTS t_mail_template;
CREATE TABLE t_mail_template (
  template_code VARCHAR(200) NOT NULL PRIMARY KEY,
  template_subject VARCHAR(100) NOT NULL,
  template_content TEXT NOT NULL,
  template_type VARCHAR(50) NOT NULL,
  disable_flag SMALLINT NOT NULL DEFAULT 0,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_mail_template IS '邮件模板表';
COMMENT ON COLUMN t_mail_template.template_code IS '模板编码';
COMMENT ON COLUMN t_mail_template.template_subject IS '模板名称';
COMMENT ON COLUMN t_mail_template.template_content IS '模板内容';
COMMENT ON COLUMN t_mail_template.template_type IS '解析类型 string，freemarker';
COMMENT ON COLUMN t_mail_template.disable_flag IS '是否禁用';
COMMENT ON COLUMN t_mail_template.update_time IS '更新时间';
COMMENT ON COLUMN t_mail_template.create_time IS '创建时间';

-- ----------------------------
-- Table structure for t_menu
-- ----------------------------
DROP TABLE IF EXISTS t_menu;
CREATE TABLE t_menu (
  menu_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  menu_name VARCHAR(200) NOT NULL,
  menu_type INT NOT NULL,
  parent_id BIGINT NOT NULL,
  sort INT,
  path VARCHAR(255),
  component VARCHAR(255),
  perms_type INT,
  api_perms TEXT,
  web_perms TEXT,
  icon VARCHAR(100),
  context_menu_id BIGINT,
  frame_flag SMALLINT NOT NULL DEFAULT 0,
  frame_url TEXT,
  cache_flag SMALLINT NOT NULL DEFAULT 0,
  visible_flag SMALLINT NOT NULL DEFAULT 1,
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_user_id BIGINT,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_menu IS '菜单表';
COMMENT ON COLUMN t_menu.menu_id IS '菜单ID';
COMMENT ON COLUMN t_menu.menu_name IS '菜单名称';
COMMENT ON COLUMN t_menu.menu_type IS '类型';
COMMENT ON COLUMN t_menu.parent_id IS '父菜单ID';
COMMENT ON COLUMN t_menu.sort IS '显示顺序';
COMMENT ON COLUMN t_menu.path IS '路由地址';
COMMENT ON COLUMN t_menu.component IS '组件路径';
COMMENT ON COLUMN t_menu.perms_type IS '权限类型';
COMMENT ON COLUMN t_menu.api_perms IS '后端权限字符串';
COMMENT ON COLUMN t_menu.web_perms IS '前端权限字符串';
COMMENT ON COLUMN t_menu.icon IS '菜单图标';
COMMENT ON COLUMN t_menu.context_menu_id IS '功能点关联菜单ID';
COMMENT ON COLUMN t_menu.frame_flag IS '是否为外链';
COMMENT ON COLUMN t_menu.frame_url IS '外链地址';
COMMENT ON COLUMN t_menu.cache_flag IS '是否缓存';
COMMENT ON COLUMN t_menu.visible_flag IS '显示状态';
COMMENT ON COLUMN t_menu.disabled_flag IS '禁用状态';
COMMENT ON COLUMN t_menu.deleted_flag IS '删除状态';
COMMENT ON COLUMN t_menu.create_user_id IS '创建人';
COMMENT ON COLUMN t_menu.create_time IS '创建时间';
COMMENT ON COLUMN t_menu.update_user_id IS '更新人';
COMMENT ON COLUMN t_menu.update_time IS '更新时间';

INSERT INTO t_menu VALUES (26, '菜单管理', 2, 50, 1, '/menu/list', '/system/menu/menu-list.vue', NULL, NULL, NULL, 'CopyOutlined', NULL, 0, NULL, 1, 1, 0, 0, 2, '2021-08-09 15:04:35', 1, '2023-12-01 19:39:03');
INSERT INTO t_menu VALUES (40, '删除', 3, 26, NULL, NULL, NULL, 1, 'system:menu:batchDelete', 'system:menu:batchDelete', NULL, 26, 0, NULL, 0, 1, 0, 0, 1, '2021-08-12 09:45:56', 1, '2023-10-07 18:15:50');
INSERT INTO t_menu VALUES (45, '组织架构', 1, 0, 3, '/organization', NULL, NULL, NULL, NULL, 'UserSwitchOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2021-08-12 16:13:27', 1, '2024-07-02 19:27:44');
INSERT INTO t_menu VALUES (46, '员工管理', 2, 45, 3, '/organization/employee', '/system/employee/index.vue', NULL, NULL, NULL, 'AuditOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2021-08-12 16:21:50', 1, '2024-07-02 20:15:23');
INSERT INTO t_menu VALUES (50, '系统设置', 1, 0, 6, '/setting', NULL, NULL, NULL, NULL, 'SettingOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2021-08-13 16:41:33', 1, '2023-12-01 19:38:03');
INSERT INTO t_menu VALUES (76, '角色管理', 2, 45, 4, '/organization/role', '/system/role/index.vue', NULL, NULL, NULL, 'SlidersOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2021-08-26 10:31:00', 1, '2024-07-02 20:15:28');
INSERT INTO t_menu VALUES (81, '用户操作记录', 2, 213, 6, '/support/operate-log/operate-log-list', '/support/operate-log/operate-log-list.vue', NULL, NULL, NULL, 'VideoCameraOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-20 12:37:24', 44, '2024-08-13 14:34:10');
INSERT INTO t_menu VALUES (85, '组件演示', 2, 84, NULL, '/demonstration/index', '/support/demonstration/index.vue', NULL, NULL, NULL, 'ClearOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-20 23:16:46', NULL, '2022-05-20 23:16:46');
INSERT INTO t_menu VALUES (86, '添加部门', 3, 46, 1, NULL, NULL, 1, 'system:department:add', 'system:department:add', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-26 23:33:37', 1, '2023-10-07 18:26:35');
INSERT INTO t_menu VALUES (87, '修改部门', 3, 46, 2, NULL, NULL, 1, 'system:department:update', 'system:department:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-26 23:34:11', 1, '2023-10-07 18:26:44');
INSERT INTO t_menu VALUES (88, '删除部门', 3, 46, 3, NULL, NULL, 1, 'system:department:delete', 'system:department:delete', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-26 23:34:49', 1, '2023-10-07 18:26:49');
INSERT INTO t_menu VALUES (91, '添加员工', 3, 46, NULL, NULL, NULL, 1, 'system:employee:add', 'system:employee:add', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:11:38', 1, '2023-10-07 18:27:46');
INSERT INTO t_menu VALUES (92, '编辑员工', 3, 46, NULL, NULL, NULL, 1, 'system:employee:update', 'system:employee:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:12:10', 1, '2023-10-07 18:27:49');
INSERT INTO t_menu VALUES (93, '禁用启用员工', 3, 46, NULL, NULL, NULL, 1, 'system:employee:disabled', 'system:employee:disabled', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:12:37', 1, '2023-10-07 18:27:53');
INSERT INTO t_menu VALUES (94, '调整员工部门', 3, 46, NULL, NULL, NULL, 1, 'system:employee:department:update', 'system:employee:department:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:12:59', 1, '2023-10-07 18:27:34');
INSERT INTO t_menu VALUES (95, '重置密码', 3, 46, NULL, NULL, NULL, 1, 'system:employee:password:[REDACTED] 'system:employee:password:[REDACTED] NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:13:30', 1, '2023-10-07 18:27:57');
INSERT INTO t_menu VALUES (96, '删除员工', 3, 46, NULL, NULL, NULL, 1, 'system:employee:delete', 'system:employee:delete', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:14:08', 1, '2023-10-07 18:28:01');
INSERT INTO t_menu VALUES (97, '添加角色', 3, 76, NULL, NULL, NULL, 1, 'system:role:add', 'system:role:add', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:34:00', 1, '2023-10-07 18:42:31');
INSERT INTO t_menu VALUES (98, '删除角色', 3, 76, NULL, NULL, NULL, 1, 'system:role:delete', 'system:role:delete', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:34:19', 1, '2023-10-07 18:42:35');
INSERT INTO t_menu VALUES (99, '编辑角色', 3, 76, NULL, NULL, NULL, 1, 'system:role:update', 'system:role:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:34:55', 1, '2023-10-07 18:42:44');
INSERT INTO t_menu VALUES (100, '更新数据范围', 3, 76, NULL, NULL, NULL, 1, 'system:role:dataScope:update', 'system:role:dataScope:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:37:03', 1, '2023-10-07 18:41:49');
INSERT INTO t_menu VALUES (101, '批量移除员工', 3, 76, NULL, NULL, NULL, 1, 'system:role:employee:batch:delete', 'system:role:employee:batch:delete', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:39:05', 1, '2023-10-07 18:43:32');
INSERT INTO t_menu VALUES (102, '移除员工', 3, 76, NULL, NULL, NULL, 1, 'system:role:employee:delete', 'system:role:employee:delete', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:39:21', 1, '2023-10-07 18:43:37');
INSERT INTO t_menu VALUES (103, '添加员工', 3, 76, NULL, NULL, NULL, 1, 'system:role:employee:add', 'system:role:employee:add', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:39:38', 1, '2023-10-07 18:44:05');
INSERT INTO t_menu VALUES (104, '修改权限', 3, 76, NULL, NULL, NULL, 1, 'system:role:menu:update', 'system:role:menu:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:41:55', 1, '2023-10-07 18:44:11');
INSERT INTO t_menu VALUES (105, '添加', 3, 26, NULL, NULL, NULL, 1, 'system:menu:add', 'system:menu:add', NULL, 26, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:44:37', 1, '2023-10-07 17:35:35');
INSERT INTO t_menu VALUES (106, '编辑', 3, 26, NULL, NULL, NULL, 1, 'system:menu:update', 'system:menu:update', NULL, 26, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 00:44:59', 1, '2023-10-07 17:35:48');
INSERT INTO t_menu VALUES (109, '参数配置', 2, 50, 3, '/config/config-list', '/support/config/config-list.vue', NULL, NULL, NULL, 'AntDesignOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 13:34:41', 1, '2022-06-23 16:24:16');
INSERT INTO t_menu VALUES (110, '数据字典', 2, 50, 4, '/setting/dict', '/support/dict/index.vue', NULL, NULL, NULL, 'BarcodeOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-05-27 17:53:00', 1, '2022-05-27 18:09:14');
INSERT INTO t_menu VALUES (111, '监控服务', 1, 0, 100, '/monitor', NULL, NULL, NULL, NULL, 'BarChartOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-17 11:13:23', 1, '2023-11-28 17:43:56');
INSERT INTO t_menu VALUES (113, '查询', 3, 112, NULL, NULL, NULL, NULL, NULL, 'ad', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-17 11:31:36', NULL, '2022-06-17 11:31:36');
INSERT INTO t_menu VALUES (114, '运维工具', 1, 0, 200, NULL, NULL, NULL, NULL, NULL, 'NodeCollapseOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-20 10:09:16', 1, '2026-03-12 12:36:58');
INSERT INTO t_menu VALUES (117, 'Reload', 2, 50, 12, '/hook', '/support/reload/reload-list.vue', NULL, NULL, NULL, 'ReloadOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-20 10:16:49', 1, '2023-12-01 19:39:17');
INSERT INTO t_menu VALUES (122, '数据库监控', 2, 111, 4, '/support/druid/index', NULL, NULL, NULL, NULL, 'ConsoleSqlOutlined', NULL, 1, 'http://localhost:1024/druid', 1, 1, 0, 0, 1, '2022-06-20 14:49:33', 1, '2023-02-16 19:15:58');
INSERT INTO t_menu VALUES (130, '单号管理', 2, 50, 6, '/support/serial-number/serial-number-list', '/support/serial-number/serial-number-list.vue', NULL, NULL, NULL, 'NumberOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-24 14:45:22', 1, '2022-06-28 16:23:41');
INSERT INTO t_menu VALUES (132, '公告管理', 2, 138, 1, '/oa/notice/notice-list', '/business/oa/notice/notice-list.vue', NULL, NULL, NULL, 'SoundOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2022-06-24 18:23:09', 1, '2025-06-01 07:43:03');
INSERT INTO t_menu VALUES (133, '缓存管理', 2, 50, 11, '/support/cache/cache-list', '/support/cache/cache-list.vue', NULL, NULL, NULL, 'BorderInnerOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-24 18:52:25', 1, '2023-12-01 19:39:13');
INSERT INTO t_menu VALUES (138, '功能Demo', 1, 0, 1, NULL, NULL, NULL, NULL, NULL, 'BankOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-24 20:09:18', 1, '2026-03-12 12:36:59');
INSERT INTO t_menu VALUES (142, '公告详情', 2, 132, NULL, '/oa/notice/notice-detail', '/business/oa/notice/notice-detail.vue', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 1, '2022-06-25 16:38:47', 1, '2022-09-14 19:46:17');
INSERT INTO t_menu VALUES (143, '登录登出记录', 2, 213, 5, '/support/login-log/login-log-list', '/support/login-log/login-log-list.vue', NULL, NULL, NULL, 'LoginOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-06-28 15:01:38', 44, '2024-08-13 14:33:49');
INSERT INTO t_menu VALUES (144, '企业管理', 2, 138, 2, '/oa/enterprise/enterprise-list', '/business/oa/enterprise/enterprise-list.vue', NULL, NULL, NULL, 'ShopOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-09-14 17:00:07', 1, '2025-06-01 07:43:10');
INSERT INTO t_menu VALUES (145, '企业详情', 2, 138, 2, '/oa/enterprise/enterprise-detail', '/business/oa/enterprise/enterprise-detail.vue', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 1, '2022-09-14 18:52:52', 1, '2025-06-01 07:43:31');
INSERT INTO t_menu VALUES (147, '帮助文档', 2, 218, 1, '/help-doc/help-doc-manage-list', '/support/help-doc/management/help-doc-manage-list.vue', NULL, NULL, NULL, 'FolderViewOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-09-14 19:59:01', 1, '2023-12-01 19:38:23');
INSERT INTO t_menu VALUES (148, '意见反馈', 2, 218, 2, '/feedback/feedback-list', '/support/feedback/feedback-list.vue', NULL, NULL, NULL, 'CoffeeOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-09-14 19:59:52', 1, '2023-12-01 19:38:40');
INSERT INTO t_menu VALUES (149, '我的通知', 2, 132, NULL, '/oa/notice/notice-employee-list', '/business/oa/notice/notice-employee-list.vue', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 1, '2022-09-14 20:29:41', 1, '2022-09-14 20:31:23');
INSERT INTO t_menu VALUES (150, '我的通知公告详情', 2, 132, NULL, '/oa/notice/notice-employee-detail', '/business/oa/notice/notice-employee-detail.vue', NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, 0, 1, '2022-09-14 20:30:25', 1, '2022-09-14 20:31:38');
INSERT INTO t_menu VALUES (152, '更新日志', 2, 218, 3, '/support/change-log/change-log-list', '/support/change-log/change-log-list.vue', NULL, NULL, NULL, 'HeartOutlined', NULL, 0, NULL, 0, 1, 0, 0, 44, '2022-10-10 10:31:20', 1, '2023-12-01 19:38:51');
INSERT INTO t_menu VALUES (153, '清除缓存', 3, 133, NULL, NULL, NULL, 1, 'support:cache:delete', 'support:cache:delete', NULL, 133, 0, NULL, 0, 1, 1, 0, 1, '2022-10-15 22:45:13', 1, '2023-10-07 16:22:29');
INSERT INTO t_menu VALUES (154, '获取缓存key', 3, 133, NULL, NULL, NULL, 1, 'support:cache:keys', 'support:cache:keys', NULL, 133, 0, NULL, 0, 1, 1, 0, 1, '2022-10-15 22:45:48', 1, '2023-10-07 16:22:35');
INSERT INTO t_menu VALUES (156, '查看结果', 3, 117, NULL, NULL, NULL, 1, 'support:reload:result', 'support:reload:result', NULL, 117, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:17:23', 1, '2023-10-07 14:31:47');
INSERT INTO t_menu VALUES (157, '单号生成', 3, 130, NULL, NULL, NULL, 1, 'support:serialNumber:generate', 'support:serialNumber:generate', NULL, 130, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:21:06', 1, '2023-10-07 18:22:46');
INSERT INTO t_menu VALUES (158, '生成记录', 3, 130, NULL, NULL, NULL, 1, 'support:serialNumber:record', 'support:serialNumber:record', NULL, 130, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:21:34', 1, '2023-10-07 18:22:55');
INSERT INTO t_menu VALUES (159, '新建', 3, 110, NULL, NULL, NULL, 1, 'support:dict:add', 'support:dict:add', NULL, 110, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:23:51', 1, '2023-10-07 18:18:24');
INSERT INTO t_menu VALUES (160, '编辑', 3, 110, NULL, NULL, NULL, 1, 'support:dict:edit', 'support:dict:edit', NULL, 110, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:24:05', 1, '2023-10-07 18:19:17');
INSERT INTO t_menu VALUES (161, '批量删除', 3, 110, NULL, NULL, NULL, 1, 'support:dict:delete', 'support:dict:delete', NULL, 110, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:24:34', 1, '2023-10-07 18:19:39');
INSERT INTO t_menu VALUES (162, '刷新缓存', 3, 110, NULL, NULL, NULL, 1, 'support:dict:refresh', 'support:dict:refresh', NULL, 110, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:24:55', 1, '2023-10-07 18:18:37');
INSERT INTO t_menu VALUES (163, '新建', 3, 109, NULL, NULL, NULL, 1, 'support:config:add', 'support:config:add', NULL, 109, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:26:56', 1, '2023-10-07 18:16:17');
INSERT INTO t_menu VALUES (164, '编辑', 3, 109, NULL, NULL, NULL, 1, 'support:config:update', 'support:config:update', NULL, 109, 0, NULL, 0, 1, 0, 0, 1, '2022-10-15 23:27:07', 1, '2023-10-07 18:16:24');
INSERT INTO t_menu VALUES (165, '查询', 3, 47, NULL, NULL, NULL, 1, 'goods:query', 'goods:query', NULL, 47, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 19:55:39', 1, '2023-10-07 13:58:28');
INSERT INTO t_menu VALUES (166, '新建', 3, 47, NULL, NULL, NULL, 1, 'goods:add', 'goods:add', NULL, 47, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 19:56:00', 1, '2023-10-07 13:58:32');
INSERT INTO t_menu VALUES (167, '批量删除', 3, 47, NULL, NULL, NULL, 1, 'goods:batchDelete', 'goods:batchDelete', NULL, 47, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 19:56:15', 1, '2023-10-07 13:58:35');
INSERT INTO t_menu VALUES (168, '查询', 3, 147, 11, NULL, NULL, 1, 'support:helpDoc:query', 'support:helpDoc:query', NULL, 147, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:12:13', 1, '2023-10-07 14:05:49');
INSERT INTO t_menu VALUES (169, '新建', 3, 147, 12, NULL, NULL, 1, 'support:helpDoc:add', 'support:helpDoc:add', NULL, 147, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:12:37', 1, '2023-10-07 14:05:56');
INSERT INTO t_menu VALUES (170, '新建目录', 3, 147, 1, NULL, NULL, 1, 'support:helpDocCatalog:addCategory', 'support:helpDocCatalog:addCategory', NULL, 147, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:12:57', 1, '2023-10-07 14:06:38');
INSERT INTO t_menu VALUES (171, '修改目录', 3, 147, 2, NULL, NULL, 1, 'support:helpDocCatalog:update', 'support:helpDocCatalog:update', NULL, 147, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:13:46', 1, '2023-10-07 14:06:49');
INSERT INTO t_menu VALUES (173, '新建', 3, 78, NULL, NULL, NULL, 1, 'category:add', 'category:add', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:02', 1, '2023-10-07 13:54:01');
INSERT INTO t_menu VALUES (174, '查询', 3, 78, NULL, NULL, NULL, 1, 'category:tree', 'category:tree', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:22', 1, '2023-10-07 13:54:33');
INSERT INTO t_menu VALUES (175, '编辑', 3, 78, NULL, NULL, NULL, 1, 'category:update', 'category:update', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:38', 1, '2023-10-07 13:54:18');
INSERT INTO t_menu VALUES (176, '删除', 3, 78, NULL, NULL, NULL, 1, 'category:delete', 'category:delete', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:50', 1, '2023-10-07 13:54:27');
INSERT INTO t_menu VALUES (177, '新建', 3, 79, NULL, NULL, NULL, 1, 'category:add', 'custom:category:add', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:02', 1, '2023-10-07 13:57:32');
INSERT INTO t_menu VALUES (178, '查询', 3, 79, NULL, NULL, NULL, 1, 'category:tree', 'custom:category:tree', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:22', 1, '2023-10-07 13:57:50');
INSERT INTO t_menu VALUES (179, '编辑', 3, 79, NULL, NULL, NULL, 1, 'category:update', 'custom:category:update', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:38', 1, '2023-10-07 13:58:02');
INSERT INTO t_menu VALUES (180, '删除', 3, 79, NULL, NULL, NULL, 1, 'category:delete', 'custom:category:delete', NULL, 78, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:17:50', 1, '2023-10-07 13:58:12');
INSERT INTO t_menu VALUES (181, '查询', 3, 144, NULL, NULL, NULL, 1, 'oa:enterprise:query', 'oa:enterprise:query', NULL, 144, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:25:14', 1, '2023-10-07 12:00:09');
INSERT INTO t_menu VALUES (182, '新建', 3, 144, NULL, NULL, NULL, 1, 'oa:enterprise:add', 'oa:enterprise:add', NULL, 144, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:25:25', 1, '2023-10-07 12:00:17');
INSERT INTO t_menu VALUES (183, '编辑', 3, 144, NULL, NULL, NULL, 1, 'oa:enterprise:update', 'oa:enterprise:update', NULL, 144, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:25:36', 1, '2023-10-07 12:00:38');
INSERT INTO t_menu VALUES (184, '删除', 3, 144, NULL, NULL, NULL, 1, 'oa:enterprise:delete', 'oa:enterprise:delete', NULL, 144, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:25:53', 1, '2023-10-07 12:00:46');
INSERT INTO t_menu VALUES (185, '查询', 3, 132, NULL, NULL, NULL, 1, 'oa:notice:query', 'oa:notice:query', NULL, 132, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:26:38', 1, '2023-10-07 11:43:01');
INSERT INTO t_menu VALUES (186, '新建', 3, 132, NULL, NULL, NULL, 1, 'oa:notice:add', 'oa:notice:add', NULL, 132, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:27:04', 1, '2023-10-07 11:43:07');
INSERT INTO t_menu VALUES (187, '编辑', 3, 132, NULL, NULL, NULL, 1, 'oa:notice:update', 'oa:notice:update', NULL, 132, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:27:15', 1, '2023-10-07 11:43:12');
INSERT INTO t_menu VALUES (188, '删除', 3, 132, NULL, NULL, NULL, 1, 'oa:notice:delete', 'oa:notice:delete', NULL, 132, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:27:23', 1, '2023-10-07 11:43:18');
INSERT INTO t_menu VALUES (190, '查询', 3, 152, NULL, NULL, NULL, 1, '', 'support:changeLog:query', NULL, 152, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:28:33', 1, '2023-10-07 14:25:05');
INSERT INTO t_menu VALUES (191, '新建', 3, 152, NULL, NULL, NULL, 1, 'support:changeLog:add', 'support:changeLog:add', NULL, 152, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:28:46', 1, '2023-10-07 14:24:15');
INSERT INTO t_menu VALUES (192, '批量删除', 3, 152, NULL, NULL, NULL, 1, 'support:changeLog:batchDelete', 'support:changeLog:batchDelete', NULL, 152, 0, NULL, 0, 1, 0, 0, 1, '2022-10-16 20:29:10', 1, '2023-10-07 14:24:22');
INSERT INTO t_menu VALUES (193, '文件管理', 2, 50, 20, '/support/file/file-list', '/support/file/file-list.vue', NULL, NULL, NULL, 'FolderOpenOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 11:26:11', 1, '2022-10-22 11:29:22');
INSERT INTO t_menu VALUES (194, '删除', 3, 47, NULL, NULL, NULL, 1, 'goods:delete', 'goods:delete', NULL, 47, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 20:00:12', 1, '2023-10-07 13:58:39');
INSERT INTO t_menu VALUES (195, '修改', 3, 47, NULL, NULL, NULL, 1, 'goods:update', 'goods:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 20:05:23', 1, '2023-10-07 13:58:42');
INSERT INTO t_menu VALUES (196, '查看详情', 3, 145, NULL, NULL, NULL, 1, 'oa:enterprise:detail', 'oa:enterprise:detail', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 20:16:47', 1, '2023-10-07 11:48:59');
INSERT INTO t_menu VALUES (198, '删除', 3, 152, NULL, NULL, NULL, 1, 'support:changeLog:delete', 'support:changeLog:delete', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 20:42:34', 1, '2023-10-07 14:24:32');
INSERT INTO t_menu VALUES (199, '查询', 3, 109, NULL, NULL, NULL, 1, 'support:config:query', 'support:config:query', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 20:45:14', 1, '2023-10-07 18:16:27');
INSERT INTO t_menu VALUES (200, '查询', 3, 193, NULL, NULL, NULL, 1, 'support:file:query', 'support:file:query', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 20:47:23', 1, '2023-10-07 18:24:43');
INSERT INTO t_menu VALUES (201, '删除', 3, 147, 14, NULL, NULL, 1, 'support:helpDoc:delete', 'support:helpDoc:delete', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 21:03:20', 1, '2023-10-07 14:07:02');
INSERT INTO t_menu VALUES (202, '更新', 3, 147, 13, NULL, NULL, 1, 'support:helpDoc:update', 'support:helpDoc:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 21:03:32', 1, '2023-10-07 14:06:56');
INSERT INTO t_menu VALUES (203, '查询', 3, 143, NULL, NULL, NULL, 1, 'support:loginLog:query', 'support:loginLog:query', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-21 21:05:11', 1, '2023-10-07 14:27:23');
INSERT INTO t_menu VALUES (204, '查询', 3, 81, NULL, NULL, NULL, 1, 'support:operateLog:query', 'support:operateLog:query', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-22 10:33:31', 1, '2023-10-07 14:27:56');
INSERT INTO t_menu VALUES (205, '详情', 3, 81, NULL, NULL, NULL, 1, 'support:operateLog:detail', 'support:operateLog:detail', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-22 10:33:49', 1, '2023-10-07 14:28:04');
INSERT INTO t_menu VALUES (206, '心跳监控', 2, 111, 1, '/support/heart-beat/heart-beat-list', '/support/heart-beat/heart-beat-list.vue', 1, NULL, NULL, 'FallOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-22 10:47:03', 1, '2022-10-22 18:32:52');
INSERT INTO t_menu VALUES (207, '更新', 3, 152, NULL, NULL, NULL, 1, 'support:changeLog:update', 'support:changeLog:update', NULL, NULL, 0, NULL, 0, 1, 0, 0, 1, '2022-10-22 11:51:32', 1, '2023-10-07 14:24:39');
INSERT INTO t_menu VALUES (212, '查询', 3, 117, NULL, NULL, NULL, 1, 'support:reload:query', 'support:reload:query', NULL, NULL, 0, NULL, 1, 1, 1, 0, 1, '2023-10-07 14:31:36', NULL, '2023-10-07 14:31:36');
INSERT INTO t_menu VALUES (213, '网络安全', 1, 0, 5, NULL, NULL, 1, NULL, NULL, 'SafetyCertificateOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2023-10-17 19:03:08', 1, '2023-12-01 19:38:00');
INSERT INTO t_menu VALUES (214, '登录失败锁定', 2, 213, 4, '/support/login-fail', '/support/login-fail/login-fail-list.vue', 1, NULL, NULL, 'LockOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2023-10-17 19:04:24', 44, '2024-08-13 14:16:26');
INSERT INTO t_menu VALUES (215, '接口加解密', 2, 213, 2, '/support/api-encrypt', '/support/api-encrypt/api-encrypt-index.vue', 1, NULL, NULL, 'CodepenCircleOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2023-10-24 11:49:28', 44, '2024-08-13 12:00:14');
INSERT INTO t_menu VALUES (216, '导出', 3, 47, NULL, NULL, NULL, 1, 'goods:exportGoods', 'goods:exportGoods', NULL, NULL, 0, NULL, 1, 1, 0, 0, 1, '2023-12-01 19:34:03', NULL, '2023-12-01 19:34:03');
INSERT INTO t_menu VALUES (217, '导入', 3, 47, 3, NULL, NULL, 1, 'goods:importGoods', 'goods:importGoods', NULL, NULL, 0, NULL, 1, 1, 0, 0, 1, '2023-12-01 19:34:22', NULL, '2023-12-01 19:34:22');
INSERT INTO t_menu VALUES (218, '文档中心', 1, 0, 4, NULL, NULL, 1, NULL, NULL, 'FileSearchOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2023-12-01 19:37:28', 1, '2026-03-12 12:36:59');
INSERT INTO t_menu VALUES (219, '部门管理', 2, 45, 1, '/organization/department', '/system/department/department-list.vue', 1, NULL, NULL, 'ApartmentOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2024-06-22 16:40:21', 1, '2024-07-02 20:15:17');
INSERT INTO t_menu VALUES (221, '定时任务', 2, 50, 25, '/job/list', '/support/job/job-list.vue', 1, NULL, NULL, 'AppstoreOutlined', NULL, 0, NULL, 1, 1, 0, 0, 2, '2024-06-25 17:57:40', 2, '2024-06-25 19:49:21');
INSERT INTO t_menu VALUES (228, '职务管理', 2, 45, 2, '/organization/position', '/system/position/position-list.vue', 1, NULL, NULL, 'ApartmentOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2024-06-29 11:11:09', 1, '2024-07-02 20:15:11');
INSERT INTO t_menu VALUES (229, '查询任务', 3, 221, NULL, NULL, NULL, 1, 'support:job:query', 'support:job:query', NULL, 221, 0, NULL, 1, 1, 0, 0, 2, '2024-06-29 11:14:15', 2, '2024-06-29 11:15:00');
INSERT INTO t_menu VALUES (230, '更新任务', 3, 221, NULL, NULL, NULL, 1, 'support:job:update', 'support:job:update', NULL, 221, 0, NULL, 1, 1, 0, 0, 2, '2024-06-29 11:15:40', NULL, '2024-06-29 11:15:40');
INSERT INTO t_menu VALUES (231, '执行任务', 3, 221, NULL, NULL, NULL, 1, 'support:job:execute', 'support:job:execute', NULL, 221, 0, NULL, 1, 1, 0, 0, 2, '2024-06-29 11:16:03', NULL, '2024-06-29 11:16:03');
INSERT INTO t_menu VALUES (232, '查询记录', 3, 221, NULL, NULL, NULL, 1, 'support:job:log:query', 'support:job:log:query', NULL, 221, 0, NULL, 1, 1, 0, 0, 2, '2024-06-29 11:16:37', NULL, '2024-06-29 11:16:37');
INSERT INTO t_menu VALUES (233, 'knife4j文档', 2, 218, 4, '/knife4j', NULL, 1, NULL, NULL, 'FileWordOutlined', NULL, 1, 'http://localhost:1024/doc.html', 1, 1, 0, 0, 1, '2024-07-02 20:23:50', 1, '2024-07-08 13:49:15');
INSERT INTO t_menu VALUES (234, 'swagger文档', 2, 218, 5, '/swagger', 'http://localhost:1024/swagger-ui/index.html', 1, NULL, NULL, 'ApiOutlined', NULL, 1, 'http://localhost:1024/swagger-ui/index.html', 1, 1, 0, 0, 1, '2024-07-02 20:35:43', 1, '2024-07-08 13:49:26');
INSERT INTO t_menu VALUES (250, '三级等保设置', 2, 213, 1, '/support/level3protect/level3-protect-config-index', '/support/level3protect/level3-protect-config-index.vue', 1, NULL, NULL, 'SafetyOutlined', NULL, 0, NULL, 1, 1, 0, 0, 44, '2024-08-13 11:41:02', 44, '2024-08-13 11:58:12');
INSERT INTO t_menu VALUES (251, '敏感数据脱敏', 2, 213, 3, '/support/level3protect/data-masking-list', '/support/level3protect/data-masking-list.vue', 1, NULL, NULL, 'FileProtectOutlined', NULL, 0, NULL, 1, 1, 0, 0, 44, '2024-08-13 11:58:00', 44, '2024-08-13 11:59:49');
INSERT INTO t_menu VALUES (252, '流程管理', 1, 0, 2, NULL, NULL, 1, NULL, NULL, 'ApartmentOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2025-04-01 22:06:39', NULL, '2025-04-01 22:06:39');
INSERT INTO t_menu VALUES (253, '流程定义', 2, 252, NULL, '/flow/definition', '/flow/definition/definition-list.vue', 1, NULL, NULL, 'BranchesOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2025-04-01 22:12:25', 1, '2025-04-10 17:12:38');
INSERT INTO t_menu VALUES (254, '待办任务', 2, 252, NULL, '/flow/task/todo', '/flow/task/todo/index.vue', 1, NULL, NULL, 'AuditOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2025-04-07 21:10:39', 1, '2025-04-10 17:12:43');
INSERT INTO t_menu VALUES (255, '已办任务', 2, 252, NULL, '/flow/task/done', '/flow/task/done/index.vue', 1, NULL, NULL, 'CrownOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2025-04-11 19:00:01', 1, '2025-04-11 19:46:10');
INSERT INTO t_menu VALUES (256, '抄送任务', 2, 252, NULL, '/flow/task/notice', '/flow/task/notice/index.vue', 1, NULL, NULL, 'BlockOutlined', NULL, 0, NULL, 0, 1, 0, 0, 1, '2025-04-11 19:46:03', NULL, '2025-04-11 19:46:03');
INSERT INTO t_menu VALUES (257, '请假申请', 2, 138, NULL, '/oa/leave/list', '/business/oa/leave/leave-list.vue', 1, NULL, NULL, 'GoldOutlined', NULL, 0, NULL, 1, 1, 0, 0, 1, '2025-05-31 20:39:26', 1, '2025-06-01 18:20:53');
INSERT INTO t_menu VALUES (258, '发起', 3, 254, NULL, NULL, NULL, 1, 'flow:execute:startTask', NULL, NULL, 254, 0, NULL, 0, 1, 0, 0, 1, '2025-06-01 08:21:46', 1, '2025-06-01 08:25:31');
INSERT INTO t_menu VALUES (259, '审批', 3, 254, NULL, NULL, NULL, 1, 'flow:execute:approve', NULL, NULL, 254, 0, NULL, 0, 1, 0, 0, 1, '2025-06-01 08:24:07', NULL, '2025-06-01 08:24:07');
INSERT INTO t_menu VALUES (260, '跳转', 3, 254, NULL, NULL, NULL, 1, 'flow:execute:goAnyNode', NULL, NULL, 254, 0, NULL, 0, 1, 0, 0, 1, '2025-06-01 08:25:21', NULL, '2025-06-01 08:25:21');
INSERT INTO t_menu VALUES (261, '查询', 3, 257, NULL, NULL, NULL, 1, 'leave:query', 'leave:query', NULL, 257, 0, NULL, 0, 1, 0, 0, 1, '2025-06-01 08:27:54', NULL, '2025-06-01 08:27:54');
INSERT INTO t_menu VALUES (262, '新建', 3, 257, NULL, NULL, NULL, 1, 'leave:add', 'leave:add', NULL, 257, 0, NULL, 0, 1, 0, 0, 1, '2025-06-01 08:28:16', NULL, '2025-06-01 08:28:16');
INSERT INTO t_menu VALUES (263, '编辑', 3, 257, NULL, NULL, NULL, 1, 'leave:update', 'leave:update', NULL, 257, 0, NULL, 0, 1, 0, 0, 1, '2025-06-01 08:28:40', NULL, '2025-06-01 08:28:40');
INSERT INTO t_menu VALUES (264, '删除', 3, 257, NULL, NULL, NULL, 1, 'leave:delete', 'leave:delete', NULL, 257, 0, NULL, 0, 1, 0, 0, 1, '2025-06-01 08:28:59', NULL, '2025-06-01 08:28:59');

-- ----------------------------
-- Table structure for t_message
-- ----------------------------
DROP TABLE IF EXISTS t_message;
CREATE TABLE t_message (
  message_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  message_type SMALLINT NOT NULL,
  receiver_user_type INT NOT NULL,
  receiver_user_id BIGINT NOT NULL,
  data_id VARCHAR(500) DEFAULT '',
  title VARCHAR(1000) NOT NULL,
  content TEXT NOT NULL,
  read_flag SMALLINT NOT NULL DEFAULT 0,
  read_time TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_message IS '通知消息';
COMMENT ON COLUMN t_message.message_id IS '消息id';
COMMENT ON COLUMN t_message.message_type IS '消息类型';
COMMENT ON COLUMN t_message.receiver_user_type IS '接收者用户类型';
COMMENT ON COLUMN t_message.receiver_user_id IS '接收者用户id';
COMMENT ON COLUMN t_message.data_id IS '相关数据id';
COMMENT ON COLUMN t_message.title IS '标题';
COMMENT ON COLUMN t_message.content IS '内容';
COMMENT ON COLUMN t_message.read_flag IS '是否已读';
COMMENT ON COLUMN t_message.read_time IS '已读时间';
COMMENT ON COLUMN t_message.create_time IS '创建时间';
COMMENT ON COLUMN t_message.update_time IS '更新时间';

CREATE INDEX idx_msg ON t_message(message_type, receiver_user_type, receiver_user_id);

-- ----------------------------
-- Table structure for t_notice
-- ----------------------------
DROP TABLE IF EXISTS t_notice;
CREATE TABLE t_notice (
  notice_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  notice_type_id BIGINT NOT NULL,
  title VARCHAR(200) NOT NULL,
  all_visible_flag SMALLINT NOT NULL,
  scheduled_publish_flag SMALLINT NOT NULL,
  publish_time TIMESTAMP NOT NULL,
  content_text TEXT NOT NULL,
  content_html TEXT NOT NULL,
  attachment VARCHAR(1000),
  page_view_count INT NOT NULL DEFAULT 0,
  user_view_count INT NOT NULL DEFAULT 0,
  source VARCHAR(1000),
  author VARCHAR(1000),
  document_number VARCHAR(1000),
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  instance_id BIGINT,
  node_name VARCHAR(100),
  flow_status VARCHAR(20)
);

COMMENT ON TABLE t_notice IS '通知公告表';
COMMENT ON COLUMN t_notice.notice_id IS '自增id';
COMMENT ON COLUMN t_notice.notice_type_id IS '类型';
COMMENT ON COLUMN t_notice.title IS '标题';
COMMENT ON COLUMN t_notice.all_visible_flag IS '全部可见';
COMMENT ON COLUMN t_notice.scheduled_publish_flag IS '定时发布';
COMMENT ON COLUMN t_notice.publish_time IS '发布时间';
COMMENT ON COLUMN t_notice.content_text IS '文本内容';
COMMENT ON COLUMN t_notice.content_html IS 'html内容';
COMMENT ON COLUMN t_notice.attachment IS '附件';
COMMENT ON COLUMN t_notice.page_view_count IS '页面浏览量';
COMMENT ON COLUMN t_notice.user_view_count IS '用户浏览量';
COMMENT ON COLUMN t_notice.source IS '来源';
COMMENT ON COLUMN t_notice.author IS '作者';
COMMENT ON COLUMN t_notice.document_number IS '文号';
COMMENT ON COLUMN t_notice.deleted_flag IS '删除标志';
COMMENT ON COLUMN t_notice.create_user_id IS '创建人';
COMMENT ON COLUMN t_notice.update_time IS '更新时间';
COMMENT ON COLUMN t_notice.create_time IS '创建时间';
COMMENT ON COLUMN t_notice.instance_id IS '流程实例的id';
COMMENT ON COLUMN t_notice.node_name IS '流程节点名称';
COMMENT ON COLUMN t_notice.flow_status IS '流程状态';

-- ----------------------------
-- Table structure for t_notice_type
-- ----------------------------
DROP TABLE IF EXISTS t_notice_type;
CREATE TABLE t_notice_type (
  notice_type_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  notice_type_name VARCHAR(100) NOT NULL,
  notice_type_code VARCHAR(100) NOT NULL,
  sort INT NOT NULL DEFAULT 0,
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_notice_type IS '通知公告类型表';
COMMENT ON COLUMN t_notice_type.notice_type_id IS '公告类型id';
COMMENT ON COLUMN t_notice_type.notice_type_name IS '公告类型名称';
COMMENT ON COLUMN t_notice_type.notice_type_code IS '公告类型编码';
COMMENT ON COLUMN t_notice_type.sort IS '排序';
COMMENT ON COLUMN t_notice_type.deleted_flag IS '删除标志';
COMMENT ON COLUMN t_notice_type.create_time IS '创建时间';
COMMENT ON COLUMN t_notice_type.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_notice_view_record
-- ----------------------------
DROP TABLE IF EXISTS t_notice_view_record;
CREATE TABLE t_notice_view_record (
                                      notice_id bigint NOT NULL,
                                      employee_id bigint NOT NULL,
                                      page_view_count int DEFAULT 0,
                                      first_ip varchar(255) DEFAULT NULL,
                                      first_user_agent varchar(1000) DEFAULT NULL,
                                      last_ip varchar(255) DEFAULT NULL,
                                      last_user_agent varchar(1000) DEFAULT NULL,
                                      create_time timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
                                      update_time timestamp DEFAULT CURRENT_TIMESTAMP,
                                      PRIMARY KEY (notice_id, employee_id)
);

COMMENT ON TABLE t_notice_view_record IS '通知查看记录';
COMMENT ON COLUMN t_notice_view_record.notice_id IS '通知公告id';
COMMENT ON COLUMN t_notice_view_record.employee_id IS '员工id';
COMMENT ON COLUMN t_notice_view_record.page_view_count IS '查看次数';
COMMENT ON COLUMN t_notice_view_record.first_ip IS '首次ip';
COMMENT ON COLUMN t_notice_view_record.first_user_agent IS '首次用户设备等标识';
COMMENT ON COLUMN t_notice_view_record.last_ip IS '最后一次ip';
COMMENT ON COLUMN t_notice_view_record.last_user_agent IS '最后一次用户设备等标识';
COMMENT ON COLUMN t_notice_view_record.create_time IS '创建时间';
COMMENT ON COLUMN t_notice_view_record.update_time IS '更新时间';


-- ----------------------------
-- Table structure for t_notice_visible_range
-- ----------------------------
DROP TABLE IF EXISTS t_notice_visible_range;
CREATE TABLE t_notice_visible_range (
  notice_id BIGINT NOT NULL,
  data_type INT NOT NULL,
  data_id BIGINT,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON COLUMN t_notice_visible_range.notice_id IS '公告id';
COMMENT ON COLUMN t_notice_visible_range.data_type IS '可见范围类型';
COMMENT ON COLUMN t_notice_visible_range.data_id IS '可见范围id';
COMMENT ON COLUMN t_notice_visible_range.create_time IS '创建时间';

-- ----------------------------
-- Table structure for t_oa_bank
-- ----------------------------
DROP TABLE IF EXISTS t_oa_bank;
CREATE TABLE t_oa_bank (
  bank_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  bank_name VARCHAR(255) NOT NULL,
  account_name VARCHAR(255) NOT NULL,
  account_number VARCHAR(255) NOT NULL,
  remark VARCHAR(255),
  business_flag SMALLINT NOT NULL,
  enterprise_id BIGINT NOT NULL,
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_user_name VARCHAR(50) NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_oa_bank IS 'OA银行信息';
COMMENT ON COLUMN t_oa_bank.bank_id IS '银行信息ID';
COMMENT ON COLUMN t_oa_bank.bank_name IS '开户银行';
COMMENT ON COLUMN t_oa_bank.account_name IS '账户名称';
COMMENT ON COLUMN t_oa_bank.account_number IS '账号';
COMMENT ON COLUMN t_oa_bank.remark IS '备注';
COMMENT ON COLUMN t_oa_bank.business_flag IS '是否对公';
COMMENT ON COLUMN t_oa_bank.enterprise_id IS '企业ID';
COMMENT ON COLUMN t_oa_bank.disabled_flag IS '禁用状态';
COMMENT ON COLUMN t_oa_bank.deleted_flag IS '删除状态';
COMMENT ON COLUMN t_oa_bank.create_user_id IS '创建人ID';
COMMENT ON COLUMN t_oa_bank.create_user_name IS '创建人';
COMMENT ON COLUMN t_oa_bank.create_time IS '创建时间';
COMMENT ON COLUMN t_oa_bank.update_time IS '更新时间';

CREATE INDEX idx_oa_bank_enterprise_id ON t_oa_bank(enterprise_id);

-- ----------------------------
-- Table structure for t_oa_enterprise
-- ----------------------------
DROP TABLE IF EXISTS t_oa_enterprise;
CREATE TABLE t_oa_enterprise (
  enterprise_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  enterprise_name VARCHAR(255) NOT NULL,
  enterprise_short_name VARCHAR(255),
  logo VARCHAR(500),
  phone VARCHAR(50),
  fax VARCHAR(50),
  email VARCHAR(100),
  address VARCHAR(500),
  business_scope VARCHAR(500),
  remark VARCHAR(500),
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_oa_enterprise IS 'OA企业信息';
COMMENT ON COLUMN t_oa_enterprise.enterprise_id IS '企业ID';
COMMENT ON COLUMN t_oa_enterprise.enterprise_name IS '企业名称';
COMMENT ON COLUMN t_oa_enterprise.enterprise_short_name IS '企业简称';
COMMENT ON COLUMN t_oa_enterprise.logo IS 'logo';
COMMENT ON COLUMN t_oa_enterprise.phone IS '企业电话';
COMMENT ON COLUMN t_oa_enterprise.fax IS '企业传真';
COMMENT ON COLUMN t_oa_enterprise.email IS '企业邮箱';
COMMENT ON COLUMN t_oa_enterprise.address IS '企业地址';
COMMENT ON COLUMN t_oa_enterprise.business_scope IS '经营范围';
COMMENT ON COLUMN t_oa_enterprise.remark IS '备注';
COMMENT ON COLUMN t_oa_enterprise.disabled_flag IS '禁用状态';
COMMENT ON COLUMN t_oa_enterprise.deleted_flag IS '删除状态';
COMMENT ON COLUMN t_oa_enterprise.create_user_id IS '创建人';
COMMENT ON COLUMN t_oa_enterprise.create_time IS '创建时间';
COMMENT ON COLUMN t_oa_enterprise.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_oa_enterprise_employee
-- ----------------------------
DROP TABLE IF EXISTS t_oa_enterprise_employee;
CREATE TABLE t_oa_enterprise_employee (
  enterprise_employee_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  enterprise_id BIGINT NOT NULL,
  employee_id BIGINT NOT NULL,
  disabled_flag SMALLINT NOT NULL DEFAULT 0,
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_oa_enterprise_employee IS 'OA企业员工关联';
COMMENT ON COLUMN t_oa_enterprise_employee.enterprise_employee_id IS '自增id';
COMMENT ON COLUMN t_oa_enterprise_employee.enterprise_id IS '企业id';
COMMENT ON COLUMN t_oa_enterprise_employee.employee_id IS '员工id';
COMMENT ON COLUMN t_oa_enterprise_employee.disabled_flag IS '禁用状态';
COMMENT ON COLUMN t_oa_enterprise_employee.deleted_flag IS '删除状态';
COMMENT ON COLUMN t_oa_enterprise_employee.create_user_id IS '创建人';
COMMENT ON COLUMN t_oa_enterprise_employee.create_time IS '创建时间';
COMMENT ON COLUMN t_oa_enterprise_employee.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_oa_invoice
-- ----------------------------
DROP TABLE IF EXISTS t_oa_invoice;
CREATE TABLE t_oa_invoice (
  invoice_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  invoice_type SMALLINT NOT NULL,
  enterprise_id BIGINT NOT NULL,
  bank_id BIGINT,
  invoice_amount NUMERIC(20, 2) NOT NULL,
  invoice_no VARCHAR(100),
  invoice_date DATE,
  remark VARCHAR(500),
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  create_user_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_oa_invoice IS 'OA发票信息';
COMMENT ON COLUMN t_oa_invoice.invoice_id IS '发票ID';
COMMENT ON COLUMN t_oa_invoice.invoice_type IS '发票类型';
COMMENT ON COLUMN t_oa_invoice.enterprise_id IS '企业ID';
COMMENT ON COLUMN t_oa_invoice.bank_id IS '银行ID';
COMMENT ON COLUMN t_oa_invoice.invoice_amount IS '发票金额';
COMMENT ON COLUMN t_oa_invoice.invoice_no IS '发票号';
COMMENT ON COLUMN t_oa_invoice.invoice_date IS '发票日期';
COMMENT ON COLUMN t_oa_invoice.remark IS '备注';
COMMENT ON COLUMN t_oa_invoice.deleted_flag IS '删除状态';
COMMENT ON COLUMN t_oa_invoice.create_user_id IS '创建人';
COMMENT ON COLUMN t_oa_invoice.create_time IS '创建时间';
COMMENT ON COLUMN t_oa_invoice.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_password_log
-- ----------------------------
DROP TABLE IF EXISTS t_password_log;
CREATE TABLE t_password_log (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  user_id BIGINT NOT NULL,
  user_type SMALLINT NOT NULL,
  old_password VARCHAR(255) NOT NULL,
  new_password VARCHAR(255),
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_password_log IS '密码修改记录';
COMMENT ON COLUMN t_password_log.id IS '主键';
COMMENT ON COLUMN t_password_log.user_id IS '用户id';
COMMENT ON COLUMN t_password_log.user_type IS '用户类型';
COMMENT ON COLUMN t_password_log.old_password IS '旧密码';
COMMENT ON COLUMN t_password_log.new_password IS '新密码';
COMMENT ON COLUMN t_password_log.update_time IS '更新时间';
COMMENT ON COLUMN t_password_log.create_time IS '创建时间';

CREATE INDEX user_and_type_index ON t_password_log(user_id, user_type);

-- ----------------------------
-- Table structure for t_position
-- ----------------------------
DROP TABLE IF EXISTS t_position;
CREATE TABLE t_position (
  position_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  position_name VARCHAR(200) NOT NULL,
  level_id VARCHAR(200),
  sort INT DEFAULT 0,
  remark VARCHAR(200),
  deleted_flag SMALLINT DEFAULT 0,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_position IS '职务表';
COMMENT ON COLUMN t_position.position_id IS '职务ID';
COMMENT ON COLUMN t_position.position_name IS '职务名称';
COMMENT ON COLUMN t_position.level_id IS '职级';
COMMENT ON COLUMN t_position.sort IS '排序';
COMMENT ON COLUMN t_position.remark IS '备注';
COMMENT ON COLUMN t_position.deleted_flag IS '删除标志';
COMMENT ON COLUMN t_position.create_time IS '创建时间';
COMMENT ON COLUMN t_position.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_reload_item
-- ----------------------------
DROP TABLE IF EXISTS t_reload_item;
CREATE TABLE t_reload_item (
                               tag VARCHAR(255) NOT NULL,
                               args VARCHAR(255),
                               identification VARCHAR(255) NOT NULL,
                               update_time TIMESTAMP DEFAULT NULL,
                               create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
                               PRIMARY KEY (tag)
);
COMMENT ON TABLE t_reload_item IS 'reload项目';
COMMENT ON COLUMN t_reload_item.tag IS '项名称';
COMMENT ON COLUMN t_reload_item.args IS '参数 可选';
COMMENT ON COLUMN t_reload_item.identification IS '运行标识';

-- ----------------------------
-- Table structure for t_reload_result
-- ----------------------------
DROP TABLE IF EXISTS t_reload_result;
CREATE TABLE t_reload_result (
  reload_result_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  reload_item_id BIGINT NOT NULL,
  ip VARCHAR(200) NOT NULL,
  result TEXT,
  status SMALLINT NOT NULL,
  remark VARCHAR(500),
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_reload_result IS '动态加载结果';
COMMENT ON COLUMN t_reload_result.reload_result_id IS '结果id';
COMMENT ON COLUMN t_reload_result.reload_item_id IS '动态加载id';
COMMENT ON COLUMN t_reload_result.ip IS '服务器ip';
COMMENT ON COLUMN t_reload_result.result IS '执行结果';
COMMENT ON COLUMN t_reload_result.status IS '执行状态';
COMMENT ON COLUMN t_reload_result.remark IS '描述';
COMMENT ON COLUMN t_reload_result.create_time IS '创建时间';

-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS t_role;
CREATE TABLE t_role (
  role_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  role_name VARCHAR(20) NOT NULL,
  role_code VARCHAR(500),
  remark VARCHAR(255),
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_role IS '角色表';
COMMENT ON COLUMN t_role.role_id IS '主键';
COMMENT ON COLUMN t_role.role_name IS '角色名称';
COMMENT ON COLUMN t_role.role_code IS '角色编码';
COMMENT ON COLUMN t_role.remark IS '角色描述';
COMMENT ON COLUMN t_role.update_time IS '更新时间';
COMMENT ON COLUMN t_role.create_time IS '创建时间';

CREATE UNIQUE INDEX role_code_uni ON t_role(role_code);

-- ----------------------------
-- Table structure for t_role_data_scope
-- ----------------------------
DROP TABLE IF EXISTS t_role_data_scope;
CREATE TABLE t_role_data_scope (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  data_scope_type INT NOT NULL,
  view_type INT NOT NULL,
  role_id BIGINT NOT NULL,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_role_data_scope IS '角色的数据范围';
COMMENT ON COLUMN t_role_data_scope.id IS '自增id';
COMMENT ON COLUMN t_role_data_scope.data_scope_type IS '数据范围类型';
COMMENT ON COLUMN t_role_data_scope.view_type IS '数据可见范围类型';
COMMENT ON COLUMN t_role_data_scope.role_id IS '角色id';
COMMENT ON COLUMN t_role_data_scope.update_time IS '更新时间';
COMMENT ON COLUMN t_role_data_scope.create_time IS '创建时间';

-- ----------------------------
-- Table structure for t_role_employee
-- ----------------------------
DROP TABLE IF EXISTS t_role_employee;
CREATE TABLE t_role_employee (
  id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  role_id BIGINT NOT NULL,
  employee_id BIGINT NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_role_employee IS '角色员工关联';
COMMENT ON COLUMN t_role_employee.id IS '主键id';
COMMENT ON COLUMN t_role_employee.role_id IS '角色id';
COMMENT ON COLUMN t_role_employee.employee_id IS '员工id';
COMMENT ON COLUMN t_role_employee.create_time IS '创建时间';

-- ----------------------------
-- Table structure for t_role_menu
-- ----------------------------
DROP TABLE IF EXISTS t_role_menu;
CREATE TABLE t_role_menu (
  role_menu_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  role_id BIGINT NOT NULL,
  menu_id BIGINT NOT NULL,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_role_menu IS '角色-菜单';
COMMENT ON COLUMN t_role_menu.role_menu_id IS '主键id';
COMMENT ON COLUMN t_role_menu.role_id IS '角色id';
COMMENT ON COLUMN t_role_menu.menu_id IS '菜单id';
COMMENT ON COLUMN t_role_menu.update_time IS '更新时间';
COMMENT ON COLUMN t_role_menu.create_time IS '创建时间';

CREATE INDEX idx_role_menu_role_id ON t_role_menu(role_id);
CREATE INDEX idx_role_menu_menu_id ON t_role_menu(menu_id);

-- ----------------------------
-- Table structure for t_serial_number
-- ----------------------------
DROP TABLE IF EXISTS t_serial_number;

-- 创建单号生成器定义表
CREATE TABLE t_serial_number (
                                 serial_number_id INTEGER NOT NULL,
                                 business_name VARCHAR(50) NOT NULL,
                                 format VARCHAR(50) DEFAULT NULL,
                                 rule_type VARCHAR(20) NOT NULL,
                                 init_number INTEGER NOT NULL,
                                 step_random_range INTEGER NOT NULL,
                                 remark VARCHAR(255) DEFAULT NULL,
                                 last_number BIGINT DEFAULT NULL,
                                 last_time TIMESTAMP DEFAULT NULL,
                                 update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                                 create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    -- 主键约束
                                 CONSTRAINT t_serial_number_pkey PRIMARY KEY (serial_number_id)
);

-- 为表添加注释
COMMENT ON TABLE t_serial_number IS '单号生成器定义表';
COMMENT ON COLUMN t_serial_number.business_name IS '业务名称';
COMMENT ON COLUMN t_serial_number.format IS '格式[yyyy]表示年,[mm]标识月,[dd]表示日,[nnn]表示三位数字';
COMMENT ON COLUMN t_serial_number.rule_type IS '规则格式。none没有周期, year 年周期, month月周期, day日周期';
COMMENT ON COLUMN t_serial_number.init_number IS '初始值';
COMMENT ON COLUMN t_serial_number.step_random_range IS '步长随机数';
COMMENT ON COLUMN t_serial_number.remark IS '备注';
COMMENT ON COLUMN t_serial_number.last_number IS '上次产生的单号, 默认为空';
COMMENT ON COLUMN t_serial_number.last_time IS '上次产生的单号时间';
COMMENT ON COLUMN t_serial_number.update_time IS '';
COMMENT ON COLUMN t_serial_number.create_time IS '';

-- 创建唯一索引（替代MySQL的UNIQUE INDEX）
CREATE UNIQUE INDEX key_name ON t_serial_number (business_name ASC);

INSERT INTO t_serial_number VALUES (1, '维权编号', '维权[yyyy]第[nnnnn]号', 'day', 1000, 10, 'DK20201101NO321', 1, '2023-12-04 09:16:42', '2024-01-08 19:24:46', '2021-02-19 14:37:50');

-- ----------------------------
-- Table structure for t_serial_number_record
-- ----------------------------
DROP TABLE IF EXISTS t_serial_number_record;
CREATE TABLE t_serial_number_record (
  serial_number_id BIGINT NOT NULL ,
  record_date TIMESTAMP NOT NULL,
  last_number BIGINT NOT NULL,
  last_time TIMESTAMP NOT NULL,
  count BIGINT NOT NULL,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX "t_serial_number_record_pk" ON "public"."t_serial_number_record" ( "serial_number_id", "record_date");
-- ----------------------------
-- Table structure for t_smart_job
-- ----------------------------
DROP TABLE IF EXISTS t_smart_job;
CREATE TABLE t_smart_job (
  job_id INT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  job_name VARCHAR(50) NOT NULL,
  job_class VARCHAR(200) NOT NULL,
  trigger_type VARCHAR(30) NOT NULL,
  trigger_value VARCHAR(200) NOT NULL,
  enabled_flag SMALLINT NOT NULL DEFAULT 0,
  param VARCHAR(1000),
  last_execute_time TIMESTAMP,
  last_execute_log_id INT,
  sort INT NOT NULL DEFAULT 0,
  remark VARCHAR(255),
  deleted_flag SMALLINT NOT NULL DEFAULT 0,
  update_name VARCHAR(50) NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_smart_job IS '定时任务配置';
COMMENT ON COLUMN t_smart_job.job_id IS '任务id';
COMMENT ON COLUMN t_smart_job.job_name IS '任务名称';
COMMENT ON COLUMN t_smart_job.job_class IS '任务执行类';
COMMENT ON COLUMN t_smart_job.trigger_type IS '触发类型';
COMMENT ON COLUMN t_smart_job.trigger_value IS '触发配置';
COMMENT ON COLUMN t_smart_job.enabled_flag IS '是否开启';
COMMENT ON COLUMN t_smart_job.param IS '参数';
COMMENT ON COLUMN t_smart_job.last_execute_time IS '最后一次执行时间';
COMMENT ON COLUMN t_smart_job.last_execute_log_id IS '最后一次执行记录id';
COMMENT ON COLUMN t_smart_job.sort IS '排序';
COMMENT ON COLUMN t_smart_job.remark IS '描述';
COMMENT ON COLUMN t_smart_job.deleted_flag IS '删除状态';
COMMENT ON COLUMN t_smart_job.update_name IS '更新人';
COMMENT ON COLUMN t_smart_job.create_time IS '创建时间';
COMMENT ON COLUMN t_smart_job.update_time IS '更新时间';

-- ----------------------------
-- Table structure for t_smart_job_log
-- ----------------------------
DROP TABLE IF EXISTS t_smart_job_log;
CREATE TABLE t_smart_job_log (
  log_id INT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  job_id INT NOT NULL,
  job_name VARCHAR(100) NOT NULL,
  param VARCHAR(2000),
  success_flag SMALLINT NOT NULL,
  execute_start_time TIMESTAMP NOT NULL,
  execute_time_millis INT,
  execute_end_time TIMESTAMP,
  execute_result VARCHAR(2000),
  ip VARCHAR(50) NOT NULL,
  process_id VARCHAR(50) NOT NULL,
  program_path VARCHAR(255) NOT NULL,
  create_name VARCHAR(100) NOT NULL,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_smart_job_log IS '定时任务-执行记录';
COMMENT ON COLUMN t_smart_job_log.log_id IS '日志id';
COMMENT ON COLUMN t_smart_job_log.job_id IS '任务id';
COMMENT ON COLUMN t_smart_job_log.job_name IS '任务名称';
COMMENT ON COLUMN t_smart_job_log.param IS '执行参数';
COMMENT ON COLUMN t_smart_job_log.success_flag IS '是否成功';
COMMENT ON COLUMN t_smart_job_log.execute_start_time IS '执行开始时间';
COMMENT ON COLUMN t_smart_job_log.execute_time_millis IS '执行时长';
COMMENT ON COLUMN t_smart_job_log.execute_end_time IS '执行结束时间';
COMMENT ON COLUMN t_smart_job_log.execute_result IS '执行结果';
COMMENT ON COLUMN t_smart_job_log.ip IS 'ip';
COMMENT ON COLUMN t_smart_job_log.process_id IS '进程id';
COMMENT ON COLUMN t_smart_job_log.program_path IS '程序目录';
COMMENT ON COLUMN t_smart_job_log.create_name IS '创建人';
COMMENT ON COLUMN t_smart_job_log.create_time IS '创建时间';

CREATE INDEX idx_smart_job_log_job_id ON t_smart_job_log(job_id);

-- ----------------------------
-- Table structure for t_table_column
-- ----------------------------
DROP TABLE IF EXISTS t_table_column;
CREATE TABLE t_table_column (
  table_column_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
  user_id BIGINT NOT NULL,
  user_type INT NOT NULL,
  table_id INT NOT NULL,
  columns TEXT,
  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

COMMENT ON TABLE t_table_column IS '表格的自定义列存储';
COMMENT ON COLUMN t_table_column.table_column_id IS '自增id';
COMMENT ON COLUMN t_table_column.user_id IS '用户id';
COMMENT ON COLUMN t_table_column.user_type IS '用户类型';
COMMENT ON COLUMN t_table_column.table_id IS '表格id';
COMMENT ON COLUMN t_table_column.columns IS '具体的表格列，存入的json';
COMMENT ON COLUMN t_table_column.create_time IS '创建时间';
COMMENT ON COLUMN t_table_column.update_time IS '更新时间';

CREATE UNIQUE INDEX uni_employee_table ON t_table_column(user_id, table_id);
ALTER TABLE "public"."t_department"
    ADD COLUMN "area_code" varchar(255);

COMMENT ON COLUMN "public"."t_department"."area_code" IS '区域编码';

-- 添加 birthday 字段
ALTER TABLE t_employee ADD COLUMN birthday TIMESTAMP;

-- 添加注释
COMMENT ON COLUMN t_employee.birthday IS '出生时间';

DROP TABLE IF EXISTS "public"."t_region";
CREATE TABLE "public"."t_region" (
                                     "id" varchar COLLATE "pg_catalog"."default" NOT NULL,
                                     "del" tinyint NOT NULL DEFAULT 0,
                                     "state" tinyint NOT NULL DEFAULT 1,
                                     "version" integer NOT NULL DEFAULT 1,
                                     "sort" float4 NOT NULL DEFAULT 1,
                                     "regid" varchar COLLATE "pg_catalog"."default" NOT NULL,
                                     "regt" TIMESTAMP NOT NULL,
                                     "modid" varchar COLLATE "pg_catalog"."default",
                                     "modt" TIMESTAMP,
                                     "doctypeid" varchar COLLATE "pg_catalog"."default",
                                     "pid" varchar COLLATE "pg_catalog"."default" NOT NULL,
                                     "levelid" varchar COLLATE "pg_catalog"."default" NOT NULL,
                                     "levelnm" varchar COLLATE "pg_catalog"."default" NOT NULL,
                                     "level" tinyint NOT NULL DEFAULT 1,
                                     "leaf" tinyint NOT NULL DEFAULT 1,
                                     "code" varchar COLLATE "pg_catalog"."default" DEFAULT ''::varchar,
                                     "name" varchar COLLATE "pg_catalog"."default" NOT NULL,
                                     "nameen" varchar COLLATE "pg_catalog"."default",
                                     "namepinyin" varchar COLLATE "pg_catalog"."default",
                                     "namepinyin1" varchar COLLATE "pg_catalog"."default",
                                     "type" integer,
                                     "provcd" varchar COLLATE "pg_catalog"."default",
                                     "citycd" varchar COLLATE "pg_catalog"."default",
                                     "contact" varchar COLLATE "pg_catalog"."default",
                                     "phone" varchar COLLATE "pg_catalog"."default",
                                     "descr" varchar COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."t_region"."id" IS '主键';
COMMENT ON COLUMN "public"."t_region"."del" IS '删除（0未删/1已删）';
COMMENT ON COLUMN "public"."t_region"."state" IS '目录状态';
COMMENT ON COLUMN "public"."t_region"."version" IS '版本号';
COMMENT ON COLUMN "public"."t_region"."sort" IS '排序';
COMMENT ON COLUMN "public"."t_region"."regid" IS '创建人id';
COMMENT ON COLUMN "public"."t_region"."regt" IS '创建时间';
COMMENT ON COLUMN "public"."t_region"."modid" IS '修改人id';
COMMENT ON COLUMN "public"."t_region"."modt" IS '修改人';
COMMENT ON COLUMN "public"."t_region"."doctypeid" IS '业务号';
COMMENT ON COLUMN "public"."t_region"."pid" IS '上级id';
COMMENT ON COLUMN "public"."t_region"."levelid" IS '层级id';
COMMENT ON COLUMN "public"."t_region"."levelnm" IS '层级nm';
COMMENT ON COLUMN "public"."t_region"."level" IS '层级';
COMMENT ON COLUMN "public"."t_region"."leaf" IS '是否叶子节点（0否/1是）';
COMMENT ON COLUMN "public"."t_region"."code" IS '区域编码';
COMMENT ON COLUMN "public"."t_region"."name" IS '区域名称（中文）';
COMMENT ON COLUMN "public"."t_region"."nameen" IS '区域名称（英文）';
COMMENT ON COLUMN "public"."t_region"."namepinyin" IS '分类名称简拼';
COMMENT ON COLUMN "public"."t_region"."namepinyin1" IS '分类名称全拼';
COMMENT ON COLUMN "public"."t_region"."type" IS '区域类型';
COMMENT ON COLUMN "public"."t_region"."provcd" IS '省级代码';
COMMENT ON COLUMN "public"."t_region"."citycd" IS '城市代码';
COMMENT ON COLUMN "public"."t_region"."contact" IS '联系人';
COMMENT ON COLUMN "public"."t_region"."phone" IS '电话';
COMMENT ON COLUMN "public"."t_region"."descr" IS '区域描述';
COMMENT ON TABLE "public"."t_region" IS '区域管理';

-- ----------------------------
-- Indexes structure for table t_region
-- ----------------------------
CREATE INDEX "CXcvvds" ON "public"."t_region" USING btree (
    "id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS FIRST,
    "del" "pg_catalog"."tinyint_ops" ASC NULLS FIRST
    );
CREATE INDEX "idx_t_region_id_C61F6CB8" ON "public"."t_region" USING btree (
    "id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS FIRST
    );
CREATE INDEX "idx_t_region_id_cover_mysql" ON "public"."t_region" USING btree (
    "id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS FIRST,
    "name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS FIRST
    );
CREATE INDEX "idx_t_region_pid_70F1897A" ON "public"."t_region" USING btree (
    "pid" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS FIRST
    );

-- ----------------------------
-- Primary Key structure for table t_region
-- ----------------------------
ALTER TABLE "public"."t_region" ADD CONSTRAINT "PRIMARY_BD6A0CA1" PRIMARY KEY ("id");