CREATE TABLE "SYS_CONFIG" (
  "CONFIG_ID" NUMBER(20,0) NOT NULL,
  "CONFIG_NAME" NVARCHAR2(100),
  "CONFIG_KEY" NVARCHAR2(100),
  "CONFIG_VALUE" NVARCHAR2(500),
  "CONFIG_TYPE" NCHAR(1),
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_CONFIG"."CONFIG_ID" IS '参数主键';
COMMENT ON COLUMN "SYS_CONFIG"."CONFIG_NAME" IS '参数名称';
COMMENT ON COLUMN "SYS_CONFIG"."CONFIG_KEY" IS '参数键名';
COMMENT ON COLUMN "SYS_CONFIG"."CONFIG_VALUE" IS '参数键值';
COMMENT ON COLUMN "SYS_CONFIG"."CONFIG_TYPE" IS '系统内置（Y是 N否）';
COMMENT ON COLUMN "SYS_CONFIG"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_CONFIG"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_CONFIG"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_CONFIG"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_CONFIG"."REMARK" IS '备注';
COMMENT ON TABLE "SYS_CONFIG" IS '参数配置表';

-- ----------------------------
-- Table structure for SYS_DEPT
-- ----------------------------

CREATE TABLE "SYS_DEPT" (
  "DEPT_ID" NUMBER(20,0) NOT NULL,
  "PARENT_ID" NUMBER(20,0),
  "ANCESTORS" NVARCHAR2(500),
  "DEPT_NAME" NVARCHAR2(30),
  "ORDER_NUM" NUMBER(11,0),
  "LEADER" NVARCHAR2(20),
  "PHONE" NVARCHAR2(30),
  "EMAIL" NVARCHAR2(30),
  "STATUS" NCHAR(1),
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(255),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_DEPT"."DEPT_ID" IS '部门id';
COMMENT ON COLUMN "SYS_DEPT"."PARENT_ID" IS '父部门id';
COMMENT ON COLUMN "SYS_DEPT"."ANCESTORS" IS '祖级列表';
COMMENT ON COLUMN "SYS_DEPT"."DEPT_NAME" IS '部门名称';
COMMENT ON COLUMN "SYS_DEPT"."ORDER_NUM" IS '显示顺序';
COMMENT ON COLUMN "SYS_DEPT"."LEADER" IS '负责人ID';
COMMENT ON COLUMN "SYS_DEPT"."PHONE" IS '手机号';
COMMENT ON COLUMN "SYS_DEPT"."EMAIL" IS '邮箱';
COMMENT ON COLUMN "SYS_DEPT"."STATUS" IS '部门状态（1正常 0停用）';
COMMENT ON COLUMN "SYS_DEPT"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_DEPT"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_DEPT"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_DEPT"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_DEPT"."REMARK" IS '备注';
COMMENT ON COLUMN "SYS_DEPT"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_DEPT" IS '部门表';

-- ----------------------------
-- Table structure for SYS_DICT_DATA
-- ----------------------------
CREATE TABLE "SYS_DICT_DATA" (
  "DICT_CODE" NUMBER(20,0) NOT NULL,
  "DICT_SORT" NUMBER(11,0),
  "DICT_LABEL" NVARCHAR2(100),
  "DICT_VALUE" NVARCHAR2(100),
  "DICT_TYPE" NVARCHAR2(100),
  "CSS_CLASS" NVARCHAR2(100),
  "LIST_CLASS" NVARCHAR2(100),
  "STATUS" NCHAR(1),
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_DICT_DATA"."DICT_CODE" IS '字典编码';
COMMENT ON COLUMN "SYS_DICT_DATA"."DICT_SORT" IS '字典排序';
COMMENT ON COLUMN "SYS_DICT_DATA"."DICT_LABEL" IS '字典标签';
COMMENT ON COLUMN "SYS_DICT_DATA"."DICT_VALUE" IS '字典键值';
COMMENT ON COLUMN "SYS_DICT_DATA"."DICT_TYPE" IS '字典类型';
COMMENT ON COLUMN "SYS_DICT_DATA"."CSS_CLASS" IS '样式属性（其他样式扩展）';
COMMENT ON COLUMN "SYS_DICT_DATA"."LIST_CLASS" IS '表格回显样式';
COMMENT ON COLUMN "SYS_DICT_DATA"."STATUS" IS '状态（0正常 1停用）';
COMMENT ON COLUMN "SYS_DICT_DATA"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_DICT_DATA"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_DICT_DATA"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_DICT_DATA"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_DICT_DATA"."REMARK" IS '备注';
COMMENT ON COLUMN "SYS_DICT_DATA"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_DICT_DATA" IS '字典数据表';

-- ----------------------------
-- Table structure for SYS_DICT_TYPE
-- ----------------------------
CREATE TABLE "SYS_DICT_TYPE" (
  "DICT_ID" NUMBER(20,0) NOT NULL,
  "DICT_NAME" NVARCHAR2(100),
  "DICT_TYPE" NVARCHAR2(100),
  "STATUS" NCHAR(1),
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_DICT_TYPE"."DICT_ID" IS '字典主键';
COMMENT ON COLUMN "SYS_DICT_TYPE"."DICT_NAME" IS '字典名称';
COMMENT ON COLUMN "SYS_DICT_TYPE"."DICT_TYPE" IS '字典类型';
COMMENT ON COLUMN "SYS_DICT_TYPE"."STATUS" IS '状态（0正常 1停用）';
COMMENT ON COLUMN "SYS_DICT_TYPE"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_DICT_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_DICT_TYPE"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_DICT_TYPE"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_DICT_TYPE"."REMARK" IS '备注';
COMMENT ON COLUMN "SYS_DICT_TYPE"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_DICT_TYPE" IS '字典类型表';

-- ----------------------------
-- Table structure for SYS_LOGIN_LOG
-- ----------------------------
CREATE TABLE "SYS_LOGIN_LOG" (
  "LOGIN_ID" NUMBER(20,0) NOT NULL,
  "DEVICE_SN" NVARCHAR2(50),
  "USERNAME" NVARCHAR2(50),
  "NICKNAME" NVARCHAR2(30),
  "IP" NVARCHAR2(30),
  "ADDRESS" NVARCHAR2(255),
  "BROWSER" NVARCHAR2(50),
  "OS" NVARCHAR2(50),
  "LOGIN_TIME" DATE,
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_LOGIN_LOG"."DEVICE_SN" IS '设备编码';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."USERNAME" IS '登录账号';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."NICKNAME" IS '用户名称';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."IP" IS '访问IP';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."ADDRESS" IS '登录地点';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."BROWSER" IS '浏览器';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."OS" IS '操作系统';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."LOGIN_TIME" IS '登录时间';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_LOGIN_LOG"."REMARK" IS '备注';
COMMENT ON TABLE "SYS_LOGIN_LOG" IS '登录日志';

-- ----------------------------
-- Table structure for SYS_MENU
-- ----------------------------
CREATE TABLE "SYS_MENU" (
  "MENU_ID" NUMBER(20,0) NOT NULL,
  "MENU_NAME" NVARCHAR2(50) NOT NULL,
  "PARENT_ID" NUMBER(20,0),
  "ORDER_NUM" NUMBER(11,0),
  "PATH" NVARCHAR2(200),
  "COMPONENT" NVARCHAR2(255),
  "QUERY" NVARCHAR2(255),
  "IS_FRAME" NUMBER(11,0),
  "IS_CACHE" NUMBER(11,0),
  "MENU_TYPE" NCHAR(1),
  "IS_VISIBLE" NCHAR(1),
  "PERMS" NVARCHAR2(100),
  "ICON" NVARCHAR2(100),
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_MENU"."MENU_ID" IS '菜单ID';
COMMENT ON COLUMN "SYS_MENU"."MENU_NAME" IS '菜单名称';
COMMENT ON COLUMN "SYS_MENU"."PARENT_ID" IS '父菜单ID';
COMMENT ON COLUMN "SYS_MENU"."ORDER_NUM" IS '显示顺序';
COMMENT ON COLUMN "SYS_MENU"."PATH" IS '路由地址';
COMMENT ON COLUMN "SYS_MENU"."COMPONENT" IS '组件路径';
COMMENT ON COLUMN "SYS_MENU"."QUERY" IS '路由参数';
COMMENT ON COLUMN "SYS_MENU"."IS_FRAME" IS '是否为外链（1是 0否）';
COMMENT ON COLUMN "SYS_MENU"."IS_CACHE" IS '是否缓存（1缓存 0不缓存）';
COMMENT ON COLUMN "SYS_MENU"."MENU_TYPE" IS '菜单类型（M目录 C菜单 F按钮）';
COMMENT ON COLUMN "SYS_MENU"."IS_VISIBLE" IS '菜单状态（1显示 0隐藏）';
COMMENT ON COLUMN "SYS_MENU"."PERMS" IS '权限标识';
COMMENT ON COLUMN "SYS_MENU"."ICON" IS '菜单图标';
COMMENT ON COLUMN "SYS_MENU"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_MENU"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_MENU"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_MENU"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_MENU"."REMARK" IS '备注';
COMMENT ON TABLE "SYS_MENU" IS '菜单权限表';

-- ----------------------------
-- Table structure for SYS_POST
-- ----------------------------
CREATE TABLE "SYS_POST" (
  "POST_ID" NUMBER(20,0) NOT NULL,
  "POST_CODE" NVARCHAR2(64) NOT NULL,
  "POST_NAME" NVARCHAR2(50) NOT NULL,
  "POST_SORT" NUMBER(11,0) NOT NULL,
  "STATUS" NCHAR(1) NOT NULL,
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_POST"."POST_ID" IS '岗位ID';
COMMENT ON COLUMN "SYS_POST"."POST_CODE" IS '岗位编码';
COMMENT ON COLUMN "SYS_POST"."POST_NAME" IS '岗位名称';
COMMENT ON COLUMN "SYS_POST"."POST_SORT" IS '显示顺序';
COMMENT ON COLUMN "SYS_POST"."STATUS" IS '状态（1正常 0停用）';
COMMENT ON COLUMN "SYS_POST"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_POST"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_POST"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_POST"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_POST"."REMARK" IS '备注';
COMMENT ON COLUMN "SYS_POST"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_POST" IS '岗位信息表';

-- ----------------------------
-- Table structure for SYS_ROLE
-- ----------------------------
CREATE TABLE "SYS_ROLE" (
  "ROLE_ID" NUMBER(20,0) NOT NULL,
  "ROLE_NAME" NVARCHAR2(30) NOT NULL,
  "ROLE_KEY" NVARCHAR2(100) NOT NULL,
  "ROLE_SORT" NUMBER(11,0) NOT NULL,
  "DATA_SCOPE" NCHAR(1),
  "STATUS" NCHAR(1) NOT NULL,
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_ROLE"."ROLE_ID" IS '角色ID';
COMMENT ON COLUMN "SYS_ROLE"."ROLE_NAME" IS '角色名称';
COMMENT ON COLUMN "SYS_ROLE"."ROLE_KEY" IS '角色权限字符串';
COMMENT ON COLUMN "SYS_ROLE"."ROLE_SORT" IS '显示顺序';
COMMENT ON COLUMN "SYS_ROLE"."DATA_SCOPE" IS '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）';
COMMENT ON COLUMN "SYS_ROLE"."STATUS" IS '角色状态（1正常 0停用）';
COMMENT ON COLUMN "SYS_ROLE"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_ROLE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_ROLE"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_ROLE"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_ROLE"."REMARK" IS '备注';
COMMENT ON COLUMN "SYS_ROLE"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_ROLE" IS '角色信息表';

-- ----------------------------
-- Table structure for SYS_ROLE_DEPT
-- ----------------------------
CREATE TABLE "SYS_ROLE_DEPT" (
  "ROLE_ID" NUMBER(20,0) NOT NULL,
  "DEPT_ID" NUMBER(20,0) NOT NULL,
  "TENANT_ID" NUMBER(20,0) NOT NULL
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_ROLE_DEPT"."ROLE_ID" IS '角色ID';
COMMENT ON COLUMN "SYS_ROLE_DEPT"."DEPT_ID" IS '部门ID';
COMMENT ON COLUMN "SYS_ROLE_DEPT"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_ROLE_DEPT" IS '角色和部门关联表';

-- ----------------------------
-- Table structure for SYS_ROLE_MENU
-- ----------------------------
CREATE TABLE "SYS_ROLE_MENU" (
  "ROLE_ID" NUMBER(20,0) NOT NULL,
  "MENU_ID" NUMBER(20,0) NOT NULL,
  "TENANT_ID" NUMBER(20,0) NOT NULL
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_ROLE_MENU"."ROLE_ID" IS '角色ID';
COMMENT ON COLUMN "SYS_ROLE_MENU"."MENU_ID" IS '菜单ID';
COMMENT ON COLUMN "SYS_ROLE_MENU"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_ROLE_MENU" IS '角色和菜单关联表';

-- ----------------------------
-- Table structure for SYS_USER
-- ----------------------------
CREATE TABLE "SYS_USER" (
  "USER_ID" NUMBER(20,0) NOT NULL,
  "DEPT_ID" NUMBER(20,0),
  "USERNAME" NVARCHAR2(30) NOT NULL,
  "NICKNAME" NVARCHAR2(30) NOT NULL,
  "EMAIL" NVARCHAR2(50),
  "PHONE" NVARCHAR2(11),
  "GENDER" NCHAR(1),
  "AVATAR" NVARCHAR2(100),
  "PASSWORD" NVARCHAR2(100),
  "STATUS" NCHAR(1),
  "CREATE_USER" NVARCHAR2(64),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NVARCHAR2(64),
  "UPDATE_TIME" DATE,
  "REMARK" NVARCHAR2(500),
  "TENANT_ID" NUMBER(20,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_USER"."USER_ID" IS '用户ID';
COMMENT ON COLUMN "SYS_USER"."DEPT_ID" IS '部门ID';
COMMENT ON COLUMN "SYS_USER"."USERNAME" IS '用户账号';
COMMENT ON COLUMN "SYS_USER"."NICKNAME" IS '用户昵称';
COMMENT ON COLUMN "SYS_USER"."EMAIL" IS '用户邮箱';
COMMENT ON COLUMN "SYS_USER"."PHONE" IS '手机号码';
COMMENT ON COLUMN "SYS_USER"."GENDER" IS '用户性别（0男 1女 2未知）';
COMMENT ON COLUMN "SYS_USER"."AVATAR" IS '头像地址';
COMMENT ON COLUMN "SYS_USER"."PASSWORD" IS '密码';
COMMENT ON COLUMN "SYS_USER"."STATUS" IS '帐号状态（1正常 0停用）';
COMMENT ON COLUMN "SYS_USER"."CREATE_USER" IS '创建者';
COMMENT ON COLUMN "SYS_USER"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "SYS_USER"."UPDATE_USER" IS '更新者';
COMMENT ON COLUMN "SYS_USER"."UPDATE_TIME" IS '更新时间';
COMMENT ON COLUMN "SYS_USER"."REMARK" IS '备注';
COMMENT ON COLUMN "SYS_USER"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_USER" IS '用户信息表';

-- ----------------------------
-- Table structure for SYS_USER_POST
-- ----------------------------
CREATE TABLE "SYS_USER_POST" (
  "USER_ID" NUMBER(20,0) NOT NULL,
  "POST_ID" NUMBER(20,0) NOT NULL,
  "TENANT_ID" NUMBER(20,0) NOT NULL
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_USER_POST"."USER_ID" IS '用户ID';
COMMENT ON COLUMN "SYS_USER_POST"."POST_ID" IS '岗位ID';
COMMENT ON COLUMN "SYS_USER_POST"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_USER_POST" IS '用户与岗位关联表';

-- ----------------------------
-- Table structure for SYS_USER_ROLE
-- ----------------------------
CREATE TABLE "SYS_USER_ROLE" (
  "USER_ID" NUMBER(20,0) NOT NULL,
  "ROLE_ID" NUMBER(20,0) NOT NULL,
  "TENANT_ID" NUMBER(20,0) NOT NULL
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN "SYS_USER_ROLE"."USER_ID" IS '用户ID';
COMMENT ON COLUMN "SYS_USER_ROLE"."ROLE_ID" IS '角色ID';
COMMENT ON COLUMN "SYS_USER_ROLE"."TENANT_ID" IS '租户ID';
COMMENT ON TABLE "SYS_USER_ROLE" IS '用户和角色关联表';

-- ----------------------------
-- Primary Key structure for table SYS_CONFIG
-- ----------------------------
ALTER TABLE "SYS_CONFIG" ADD CONSTRAINT "SYS_C0011164" PRIMARY KEY ("CONFIG_ID");

-- ----------------------------
-- Checks structure for table SYS_CONFIG
-- ----------------------------
ALTER TABLE "SYS_CONFIG" ADD CONSTRAINT "SYS_C0011119" CHECK ("CONFIG_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_DEPT
-- ----------------------------
ALTER TABLE "SYS_DEPT" ADD CONSTRAINT "SYS_C0011162" PRIMARY KEY ("DEPT_ID");

-- ----------------------------
-- Checks structure for table SYS_DEPT
-- ----------------------------
ALTER TABLE "SYS_DEPT" ADD CONSTRAINT "SYS_C0011117" CHECK ("DEPT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_DICT_DATA
-- ----------------------------
ALTER TABLE "SYS_DICT_DATA" ADD CONSTRAINT "SYS_C0011165" PRIMARY KEY ("DICT_CODE");

-- ----------------------------
-- Checks structure for table SYS_DICT_DATA
-- ----------------------------
ALTER TABLE "SYS_DICT_DATA" ADD CONSTRAINT "SYS_C0011121" CHECK ("DICT_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_DICT_TYPE
-- ----------------------------
ALTER TABLE "SYS_DICT_TYPE" ADD CONSTRAINT "SYS_C0011166" PRIMARY KEY ("DICT_ID");

-- ----------------------------
-- Checks structure for table SYS_DICT_TYPE
-- ----------------------------
ALTER TABLE "SYS_DICT_TYPE" ADD CONSTRAINT "SYS_C0011120" CHECK ("DICT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table SYS_DICT_TYPE
-- ----------------------------
CREATE UNIQUE INDEX "DICT_TYPE"
  ON "SYS_DICT_TYPE" ("DICT_TYPE" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  BUFFER_POOL DEFAULT
);

-- ----------------------------
-- Primary Key structure for table SYS_LOGIN_LOG
-- ----------------------------
ALTER TABLE "SYS_LOGIN_LOG" ADD CONSTRAINT "SYS_C0011167" PRIMARY KEY ("LOGIN_ID");

-- ----------------------------
-- Checks structure for table SYS_LOGIN_LOG
-- ----------------------------
ALTER TABLE "SYS_LOGIN_LOG" ADD CONSTRAINT "SYS_C0011122" CHECK ("LOGIN_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_MENU
-- ----------------------------
ALTER TABLE "SYS_MENU" ADD CONSTRAINT "SYS_C0011168" PRIMARY KEY ("MENU_ID");

-- ----------------------------
-- Checks structure for table SYS_MENU
-- ----------------------------
ALTER TABLE "SYS_MENU" ADD CONSTRAINT "SYS_C0011123" CHECK ("MENU_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_MENU" ADD CONSTRAINT "SYS_C0011124" CHECK ("MENU_NAME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_POST
-- ----------------------------
ALTER TABLE "SYS_POST" ADD CONSTRAINT "SYS_C0011169" PRIMARY KEY ("POST_ID");

-- ----------------------------
-- Checks structure for table SYS_POST
-- ----------------------------
ALTER TABLE "SYS_POST" ADD CONSTRAINT "SYS_C0011125" CHECK ("POST_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_POST" ADD CONSTRAINT "SYS_C0011126" CHECK ("POST_CODE" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_POST" ADD CONSTRAINT "SYS_C0011127" CHECK ("POST_NAME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_POST" ADD CONSTRAINT "SYS_C0011128" CHECK ("POST_SORT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_POST" ADD CONSTRAINT "SYS_C0011129" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_ROLE
-- ----------------------------
ALTER TABLE "SYS_ROLE" ADD CONSTRAINT "SYS_C0011170" PRIMARY KEY ("ROLE_ID");

-- ----------------------------
-- Checks structure for table SYS_ROLE
-- ----------------------------
ALTER TABLE "SYS_ROLE" ADD CONSTRAINT "SYS_C0011130" CHECK ("ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE" ADD CONSTRAINT "SYS_C0011131" CHECK ("ROLE_NAME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE" ADD CONSTRAINT "SYS_C0011132" CHECK ("ROLE_KEY" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE" ADD CONSTRAINT "SYS_C0011133" CHECK ("ROLE_SORT" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE" ADD CONSTRAINT "SYS_C0011134" CHECK ("STATUS" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_ROLE_DEPT
-- ----------------------------
ALTER TABLE "SYS_ROLE_DEPT" ADD CONSTRAINT "SYS_C0011171" PRIMARY KEY ("ROLE_ID", "DEPT_ID", "TENANT_ID");

-- ----------------------------
-- Checks structure for table SYS_ROLE_DEPT
-- ----------------------------
ALTER TABLE "SYS_ROLE_DEPT" ADD CONSTRAINT "SYS_C0011135" CHECK ("ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE_DEPT" ADD CONSTRAINT "SYS_C0011136" CHECK ("DEPT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE_DEPT" ADD CONSTRAINT "SYS_C0011137" CHECK ("TENANT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_ROLE_MENU
-- ----------------------------
ALTER TABLE "SYS_ROLE_MENU" ADD CONSTRAINT "SYS_C0011172" PRIMARY KEY ("ROLE_ID", "MENU_ID", "TENANT_ID");

-- ----------------------------
-- Checks structure for table SYS_ROLE_MENU
-- ----------------------------
ALTER TABLE "SYS_ROLE_MENU" ADD CONSTRAINT "SYS_C0011138" CHECK ("ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE_MENU" ADD CONSTRAINT "SYS_C0011139" CHECK ("MENU_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_ROLE_MENU" ADD CONSTRAINT "SYS_C0011140" CHECK ("TENANT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_USER
-- ----------------------------
ALTER TABLE "SYS_USER" ADD CONSTRAINT "SYS_C0011175" PRIMARY KEY ("USER_ID");

-- ----------------------------
-- Checks structure for table SYS_USER
-- ----------------------------
ALTER TABLE "SYS_USER" ADD CONSTRAINT "SYS_C0011152" CHECK ("USER_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_USER" ADD CONSTRAINT "SYS_C0011153" CHECK ("USERNAME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_USER" ADD CONSTRAINT "SYS_C0011154" CHECK ("NICKNAME" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_USER_POST
-- ----------------------------
ALTER TABLE "SYS_USER_POST" ADD CONSTRAINT "SYS_C0011176" PRIMARY KEY ("USER_ID", "POST_ID", "TENANT_ID");

-- ----------------------------
-- Checks structure for table SYS_USER_POST
-- ----------------------------
ALTER TABLE "SYS_USER_POST" ADD CONSTRAINT "SYS_C0011155" CHECK ("USER_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_USER_POST" ADD CONSTRAINT "SYS_C0011156" CHECK ("POST_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_USER_POST" ADD CONSTRAINT "SYS_C0011157" CHECK ("TENANT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_USER_ROLE
-- ----------------------------
ALTER TABLE "SYS_USER_ROLE" ADD CONSTRAINT "SYS_C0011177" PRIMARY KEY ("USER_ID", "ROLE_ID", "TENANT_ID");

-- ----------------------------
-- Checks structure for table SYS_USER_ROLE
-- ----------------------------
ALTER TABLE "SYS_USER_ROLE" ADD CONSTRAINT "SYS_C0011158" CHECK ("USER_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_USER_ROLE" ADD CONSTRAINT "SYS_C0011159" CHECK ("ROLE_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE "SYS_USER_ROLE" ADD CONSTRAINT "SYS_C0011160" CHECK ("TENANT_ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
