﻿CREATE TABLE "CXAICORG"."AICCODE"
(
"AICID" VARCHAR(40) NOT NULL,
"ORGUNITNAME" VARCHAR(200),
"SHORTNAME" VARCHAR(20),
"AREA_CODE" VARCHAR(40),
NOT CLUSTER PRIMARY KEY("AICID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."GDSZTK_G1010_1V6"
(
"ID" INT NOT NULL,
"G101000" VARCHAR(100),
"G101001" VARCHAR(14),
"G101002" VARCHAR(1000),
"G101003" VARCHAR(510),
"G101004" VARCHAR(16),
"G101005" CLOB,
"G101006" VARCHAR(4),
"G101007" VARCHAR(510),
"G101008" DATE,
"G101009" DATE,
"G101010" INT,
"G101011" VARCHAR(1000),
"G101012" TIMESTAMP(0),
"G101013" VARCHAR(400),
"G101014" VARCHAR(40),
"G101015" VARCHAR(18),
"ADD_TIME" TIMESTAMP(0),
"CD_TIME" TIMESTAMP(0),
"CD_OPERATION" VARCHAR(2),
"CD_BATCH" VARCHAR(100),
"DMP_SHARE_CD_TIME_IDATAT" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."ADD_TIME" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."CD_BATCH" IS '批次号';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."CD_OPERATION" IS '增量标识';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."CD_TIME" IS '变更时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."DMP_SHARE_CD_TIME_IDATAT" IS '运营方技术字段,非业务字段,请忽略并勿使用';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101000" IS '主键ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101001" IS '法律法规文件编码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101002" IS '法律法规文件名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101003" IS '法律法规文件发文文号';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101004" IS '版本号';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101005" IS '题注,制定机构、审议通过机构、通过日期等';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101006" IS '效力级别';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101007" IS '发布机关';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101008" IS '颁布日期';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101009" IS '实施日期';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101010" IS '时效性';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101011" IS '数据来源,法律法规文本获取渠道';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101012" IS '入库时间,是指录入“两平台”法律法规库的时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101013" IS '数据编目挂接单位名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101014" IS '数据编目挂接单位统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."G101015" IS '数据编目挂接单位行政区划,符合GB/T 2260的要求；镇街可以使用民政部的镇街行政区划代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1010_1V6"."ID" IS '标识ID,标识ID，为了满足共享平台编码标准，无实际业务意义';


CREATE TABLE "CXAICORG"."GDSZTK_G1020_UHN"
(
"ID" INT NOT NULL,
"G102000" VARCHAR(100),
"G101000" VARCHAR(100),
"G101001" VARCHAR(14),
"G102001" VARCHAR(50),
"G102002" CLOB,
"G102003" VARCHAR(400),
"G102004" VARCHAR(40),
"G102005" VARCHAR(18),
"ADD_TIME" TIMESTAMP(0),
"CD_TIME" TIMESTAMP(0),
"CD_OPERATION" VARCHAR(2),
"CD_BATCH" VARCHAR(100),
"DMP_SHARE_CD_TIME_IDATAT" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."ADD_TIME" IS '创建时间,业务表的数据首次创建的时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."CD_BATCH" IS '批次号,由8位日期+7位阿拉伯数据序列号组成，当天数据序号递增。如数据日期20200101，数据序号0000001，则批次号为202001010000001';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."CD_OPERATION" IS '增量标识,I：新增，U：修改，D：删除';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."CD_TIME" IS '变更时间,业务表的数据发生修 改的时 间，如果是第一次新增，则与新增时间一致。';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."DMP_SHARE_CD_TIME_IDATAT" IS '运营方技术字段,非业务字段,请忽略并勿使用';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G101000" IS '法律法规文件基本信息主键ID,关联法律法规基础信息表G101000字段';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G101001" IS '法律法规文件编码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G102000" IS '主键ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G102001" IS '法律法规文件条款内容编码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G102002" IS '法律法规文件条款内容';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G102003" IS '数据编目挂接单位名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G102004" IS '数据编目挂接单位统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."G102005" IS '数据编目挂接单位行政区划,符合GB/T 2260的要求；镇街可以使用民政部的镇街行政区划代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_G1020_UHN"."ID" IS '标识ID,标识ID，为了满足共享平台编码标准，无实际业务意义';


CREATE TABLE "CXAICORG"."GDSZTK_Z2010"
(
"ID" INT NOT NULL,
"Z201000" VARCHAR(100),
"Z301000" VARCHAR(100),
"Z201001" VARCHAR(400),
"Z201002" VARCHAR(36),
"Z201003" VARCHAR(100),
"Z201004" VARCHAR(200),
"Z201005" VARCHAR(12),
"Z201006" VARCHAR(100),
"Z201007" VARCHAR(100),
"Z201008" VARCHAR(200),
"Z201009" VARCHAR(400),
"Z201010" VARCHAR(4),
"Z201011" VARCHAR(4),
"Z201012" VARCHAR(1000),
"Z201013" VARCHAR(18),
"Z201014" DATE,
"Z201015" VARCHAR(4),
"Z201016" VARCHAR(4),
"Z201017" VARCHAR(400),
"Z201018" INT,
"Z201019" VARCHAR(400),
"Z201020" VARCHAR(40),
"Z201021" VARCHAR(18),
"ADD_TIME" TIMESTAMP(0),
"CD_TIME" TIMESTAMP(0),
"CD_OPERATION" VARCHAR(2),
"CD_BATCH" VARCHAR(100),
"OPT_AREA_CODE" VARCHAR(40),
"OPT_FIELD_CODE" VARCHAR(40),
"OPT_SUBJECT_ID" VARCHAR(72),
"OPT_SUBJECT_NAME" VARCHAR(100),
"OPT_DEPT_ID" VARCHAR(72),
"OPT_DEPT_NAME" VARCHAR(100),
"DMP_SHARE_CD_TIME_IDATAT" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."ADD_TIME" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."CD_BATCH" IS '批次号';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."CD_OPERATION" IS '增量标识';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."CD_TIME" IS '变更时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."DMP_SHARE_CD_TIME_IDATAT" IS '运营方技术字段,非业务字段,请忽略并勿使用';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."ID" IS '标识ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."OPT_AREA_CODE" IS '数据所属单位区划';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."OPT_DEPT_ID" IS '数据所属单位部门ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."OPT_DEPT_NAME" IS '数据所属单位部门名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."OPT_FIELD_CODE" IS '数据所属单位领域';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."OPT_SUBJECT_ID" IS '数据所属单位主体ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."OPT_SUBJECT_NAME" IS '数据所属单位主体名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201000" IS '主键ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201001" IS '执法部门名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201002" IS '统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201003" IS '执法部门简称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201004" IS '法定代表人名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201005" IS '邮政编码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201006" IS '传真';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201007" IS '联系电话';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201008" IS '电子邮箱';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201009" IS '地址';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201010" IS '执法部门性质';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201011" IS '层级';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201012" IS '所属领域';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201013" IS '执法部门行政区划';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201014" IS '成立日期';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201015" IS '垂管情况';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201016" IS '垂管层级';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201017" IS '垂管部门';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201018" IS '是否公开';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201019" IS '数据编目挂接单位名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201020" IS '数据编目挂接单位统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z201021" IS '数据编目挂接单位行政区划';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2010"."Z301000" IS '监督部门ID';


CREATE TABLE "CXAICORG"."GDSZTK_Z2020"
(
"ID" INT NOT NULL,
"Z202000" VARCHAR(100),
"Z201000" VARCHAR(100),
"Z202001" VARCHAR(400),
"Z202002" VARCHAR(36),
"Z202003" VARCHAR(100),
"Z202004" VARCHAR(4),
"Z202005" VARCHAR(200),
"Z202006" VARCHAR(12),
"Z202007" VARCHAR(100),
"Z202008" VARCHAR(100),
"Z202009" VARCHAR(200),
"Z202010" VARCHAR(400),
"Z202011" VARCHAR(4),
"Z202012" VARCHAR(1000),
"Z202013" VARCHAR(18),
"Z202014" INT,
"Z202015" CLOB,
"Z202016" INT,
"Z202017" VARCHAR(400),
"Z202018" VARCHAR(40),
"Z202019" VARCHAR(18),
"ADD_TIME" TIMESTAMP(0),
"CD_TIME" TIMESTAMP(0),
"CD_OPERATION" VARCHAR(2),
"CD_BATCH" VARCHAR(100),
"OPT_AREA_CODE" VARCHAR(40),
"OPT_FIELD_CODE" VARCHAR(40),
"OPT_SUBJECT_ID" VARCHAR(72),
"OPT_SUBJECT_NAME" VARCHAR(100),
"OPT_DEPT_ID" VARCHAR(72),
"OPT_DEPT_NAME" VARCHAR(100),
"DMP_SHARE_CD_TIME_IDATAT" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."ADD_TIME" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."CD_BATCH" IS '批次号';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."CD_OPERATION" IS '增量标识';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."CD_TIME" IS '变更时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."DMP_SHARE_CD_TIME_IDATAT" IS '运营方技术字段,非业务字段,请忽略并勿使用';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."ID" IS '标识ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."OPT_AREA_CODE" IS '数据所属单位区划';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."OPT_DEPT_ID" IS '数据所属单位部门ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."OPT_DEPT_NAME" IS '数据所属单位部门名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."OPT_FIELD_CODE" IS '数据所属单位领域';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."OPT_SUBJECT_ID" IS '数据所属单位主体ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."OPT_SUBJECT_NAME" IS '数据所属单位主体名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z201000" IS '执法部门基本信息主键ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202000" IS '主键ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202001" IS '执法主体名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202002" IS '统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202003" IS '执法主体简称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202004" IS '主体类别';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202005" IS '法定代表人名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202006" IS '邮政编码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202007" IS '传真';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202008" IS '联系电话';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202009" IS '电子邮箱';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202010" IS '地址';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202011" IS '层级';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202012" IS '所属领域';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202013" IS '执法主体行政区划';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202014" IS '编制人数';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202015" IS '设定依据';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202016" IS '是否公开';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202017" IS '数据编目挂接单位名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202018" IS '数据编目挂接单位统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2020"."Z202019" IS '数据编目挂接单位行政区划';


CREATE TABLE "CXAICORG"."GDSZTK_Z2030"
(
"ID" INT NOT NULL,
"Z203000" VARCHAR(100),
"Z202000" VARCHAR(100),
"Z203001" VARCHAR(4),
"Z203002" DATE,
"Z203003" DATE,
"Z203004" VARCHAR(400),
"Z203005" VARCHAR(4),
"Z203006" VARCHAR(36),
"Z203007" VARCHAR(200),
"Z203008" VARCHAR(12),
"Z203009" VARCHAR(100),
"Z203010" VARCHAR(100),
"Z203011" VARCHAR(200),
"Z203012" VARCHAR(400),
"Z203013" INT,
"Z203014" VARCHAR(400),
"Z203015" VARCHAR(40),
"Z203016" VARCHAR(18),
"ADD_TIME" TIMESTAMP(0),
"CD_TIME" TIMESTAMP(0),
"CD_OPERATION" VARCHAR(2),
"CD_BATCH" VARCHAR(100),
"OPT_AREA_CODE" VARCHAR(40),
"OPT_FIELD_CODE" VARCHAR(40),
"OPT_SUBJECT_ID" VARCHAR(72),
"OPT_SUBJECT_NAME" VARCHAR(100),
"OPT_DEPT_ID" VARCHAR(72),
"OPT_DEPT_NAME" VARCHAR(100),
"DMP_SHARE_CD_TIME_IDATAT" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."ADD_TIME" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."CD_BATCH" IS '批次号';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."CD_OPERATION" IS '增量标识';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."CD_TIME" IS '变更时间';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."DMP_SHARE_CD_TIME_IDATAT" IS '运营方技术字段,非业务字段,请忽略并勿使用';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."ID" IS '标识ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."OPT_AREA_CODE" IS '数据所属单位区划';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."OPT_DEPT_ID" IS '数据所属单位部门ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."OPT_DEPT_NAME" IS '数据所属单位部门名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."OPT_FIELD_CODE" IS '数据所属单位领域';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."OPT_SUBJECT_ID" IS '数据所属单位主体ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."OPT_SUBJECT_NAME" IS '数据所属单位主体名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z202000" IS '执法主体基本信息主键ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203000" IS '主键ID';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203001" IS '委托方式';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203002" IS '受托起始日期';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203003" IS '受托截止日期';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203004" IS '受委托组织名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203005" IS '受委托组织性质';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203006" IS '统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203007" IS '法定代表人';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203008" IS '邮政编码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203009" IS '传真';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203010" IS '联系电话';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203011" IS '电子邮箱';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203012" IS '地址';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203013" IS '编制数';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203014" IS '数据编目挂接单位名称';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203015" IS '数据编目挂接单位统一社会信用代码';
COMMENT ON COLUMN "CXAICORG"."GDSZTK_Z2030"."Z203016" IS '数据编目挂接单位行政区划';


CREATE TABLE "CXAICORG"."GZ_ORG_NEW"
(
"SREGORGCODE" VARCHAR(30) NOT NULL,
"SREGORGNAME" VARCHAR(100),
"SPARENTCODE" VARCHAR(30),
"BEND" VARCHAR(1),
"SLEVEL" VARCHAR(1),
"SCOUNTRYCODE" VARCHAR(20),
"SCOUNTRYEXTCODE" VARCHAR(20),
"NINDEX" DECIMAL(5,0),
"BSTOP" VARCHAR(1) NOT NULL,
"SHORTNAME" VARCHAR(20),
"ORGUNITID" VARCHAR(72)) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "CXAICORG"."GZ_ORG_NEW"."ORGUNITID" IS '本地组织架构单位ID';


CREATE TABLE "CXAICORG"."oauth_access_token"
(
"token_id" VARCHAR(64) NOT NULL,
"access_token" VARCHAR(500),
"refresh_token" VARCHAR(500),
"client_id" VARCHAR(64),
"user_id" VARCHAR(64),
"user_name" VARCHAR(100),
"scope" VARCHAR(255),
"grant_type" VARCHAR(50),
"expires_in" DATETIME(6),
"refresh_expires_in" DATETIME(6),
"is_active" VARCHAR(1) DEFAULT '1',
"create_time" DATETIME(6),
"update_time" DATETIME(6),
NOT CLUSTER PRIMARY KEY("token_id")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "CXAICORG"."oauth_access_token" IS 'OAuth访问令牌表';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."access_token" IS '访问令牌';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."client_id" IS '客户端ID';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."create_time" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."expires_in" IS '令牌过期时间';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."grant_type" IS '授权类型';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."is_active" IS '是否有效（0否1是）';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."refresh_expires_in" IS '刷新令牌过期时间';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."refresh_token" IS '刷新令牌';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."scope" IS '授权范围';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."token_id" IS '访问令牌ID';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."update_time" IS '更新时间';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."user_id" IS '用户ID';
COMMENT ON COLUMN "CXAICORG"."oauth_access_token"."user_name" IS '用户名';

CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_access_token_refresh_token" ON "CXAICORG"."oauth_access_token"("refresh_token" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_access_token_user_id" ON "CXAICORG"."oauth_access_token"("user_id" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_access_token_client_id" ON "CXAICORG"."oauth_access_token"("client_id" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_access_token_expires_in" ON "CXAICORG"."oauth_access_token"("expires_in" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_access_token_is_active" ON "CXAICORG"."oauth_access_token"("is_active" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_access_token_access_token" ON "CXAICORG"."oauth_access_token"("access_token" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."oauth_authorization_code"
(
"code_id" VARCHAR(64) NOT NULL,
"authorization_code" VARCHAR(255),
"client_id" VARCHAR(64),
"user_id" VARCHAR(64),
"user_name" VARCHAR(100),
"scope" VARCHAR(255),
"redirect_uri" VARCHAR(500),
"state" VARCHAR(100),
"grant_type" VARCHAR(50),
"expires_at" DATETIME(6),
"is_used" VARCHAR(1) DEFAULT '0',
"is_active" VARCHAR(1) DEFAULT '1',
"create_time" DATETIME(6),
"update_time" DATETIME(6),
NOT CLUSTER PRIMARY KEY("code_id")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "CXAICORG"."oauth_authorization_code" IS 'OAuth授权码表';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."authorization_code" IS '授权码';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."client_id" IS '客户端ID';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."code_id" IS '授权码ID';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."create_time" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."expires_at" IS '过期时间';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."grant_type" IS '授权类型';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."is_active" IS '是否有效（0否1是）';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."is_used" IS '是否已使用（0否1是）';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."redirect_uri" IS '重定向URI';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."scope" IS '授权范围';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."state" IS '状态参数';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."update_time" IS '更新时间';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."user_id" IS '用户ID';
COMMENT ON COLUMN "CXAICORG"."oauth_authorization_code"."user_name" IS '用户名';

CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_auth_code_expires_at" ON "CXAICORG"."oauth_authorization_code"("expires_at" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_auth_code_is_active" ON "CXAICORG"."oauth_authorization_code"("is_active" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_auth_code_is_used" ON "CXAICORG"."oauth_authorization_code"("is_used" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_auth_code_client_id" ON "CXAICORG"."oauth_authorization_code"("client_id" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_auth_code_user_id" ON "CXAICORG"."oauth_authorization_code"("user_id" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_auth_code_auth_code" ON "CXAICORG"."oauth_authorization_code"("authorization_code" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."oauth_client"
(
"client_id" VARCHAR(64) NOT NULL,
"client_secret" VARCHAR(255),
"client_name" VARCHAR(100),
"is_active" VARCHAR(1) DEFAULT '1',
"create_by" VARCHAR(64),
"create_time" DATETIME(6),
"update_by" VARCHAR(64),
"update_time" DATETIME(6),
NOT CLUSTER PRIMARY KEY("client_id")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "CXAICORG"."oauth_client" IS 'OAuth客户端表';
COMMENT ON COLUMN "CXAICORG"."oauth_client"."client_id" IS '客户端id';
COMMENT ON COLUMN "CXAICORG"."oauth_client"."client_name" IS '客户端名称';
COMMENT ON COLUMN "CXAICORG"."oauth_client"."client_secret" IS '客户端秘钥';
COMMENT ON COLUMN "CXAICORG"."oauth_client"."create_time" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."oauth_client"."is_active" IS '是否激活有效（0否1是）';
COMMENT ON COLUMN "CXAICORG"."oauth_client"."update_by" IS '更新人';
COMMENT ON COLUMN "CXAICORG"."oauth_client"."update_time" IS '更新时间';

CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_client_is_active" ON "CXAICORG"."oauth_client"("is_active" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."idx_oauth_client_create_time" ON "CXAICORG"."oauth_client"("create_time" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."ORG_AREAS"
(
"ORG_NUMBER" VARCHAR(100) NOT NULL,
"ORG_UNITNAME" VARCHAR(150),
"PARENT_ID" VARCHAR(100),
"ORG_LEVEL" VARCHAR(100),
"SSSSXQ" VARCHAR(100),
"SSXZJD" VARCHAR(100),
"SSSQCJ_DM" VARCHAR(2000),
"SSXZJD_CN" VARCHAR(200),
"SSSSXQ_CN" VARCHAR(200),
CONSTRAINT "ORG_AREAS_PK" CLUSTER PRIMARY KEY("ORG_NUMBER")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "CXAICORG"."ORG_AREAS" IS '属地机构所与镇街、社区关联表';
COMMENT ON COLUMN "CXAICORG"."ORG_AREAS"."ORG_NUMBER" IS '机构所的代码主键';


CREATE TABLE "CXAICORG"."SYS_MENU"
(
"SYSMENUID" VARCHAR(36) NOT NULL,
"SYSMENUTYPEID" VARCHAR(20),
"MENUTYPEID" VARCHAR(20),
"SYSMENUNAME" VARCHAR(200),
"SYSMENUFILED" VARCHAR(200),
"RESOURCEURL" VARCHAR(400),
"PARENTID" VARCHAR(36),
"REMARK" VARCHAR(1000),
"ORGLEVEL" INT,
"RESOURCETYPE" VARCHAR(1),
"SYSINDEX" INT,
NOT CLUSTER PRIMARY KEY("SYSMENUID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."SYS_MENUTYPE"
(
"MENUTYPEID" VARCHAR(36) NOT NULL,
"MENUTYPENAME" VARCHAR(200) NOT NULL,
"MENUSTATUS" INT NOT NULL,
NOT CLUSTER PRIMARY KEY("MENUTYPEID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_BASECODE"
(
"BASECODEID" VARCHAR(36) NOT NULL,
"CODEID" VARCHAR(20),
"CODE" VARCHAR(200),
"NAME" VARCHAR(1000),
"COMM" VARCHAR(510),
"ISGB" VARCHAR(1),
NOT CLUSTER PRIMARY KEY("BASECODEID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_BASESTATUS"
(
"BASESTATUSID" VARCHAR(20) NOT NULL,
"BASEENAME" VARCHAR(40) NOT NULL,
"BASENAME" VARCHAR(100),
"STATUSNUMBER" INT,
"PARENTNAME" VARCHAR(40),
NOT CLUSTER PRIMARY KEY("BASESTATUSID", "BASEENAME")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_LOGLIST"
(
"LOGID" VARCHAR(36) NOT NULL,
"OPERATIONID" VARCHAR(36),
"OPERATIONTYPE" VARCHAR(1),
"OPERATIONINFO" VARCHAR(1000),
"PROCESSTYPE" VARCHAR(1),
"PROCESSID" VARCHAR(36),
"OPERATIONTIME" TIMESTAMP(0)) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_MANAGERMENU"
(
"MANAGERMENUID" VARCHAR(36) NOT NULL,
"MANAGERID" VARCHAR(20),
"SYSMENUID" VARCHAR(36),
NOT CLUSTER PRIMARY KEY("MANAGERMENUID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_OPERATION_LOG"
(
"LOG_ID" VARCHAR(72) NOT NULL,
"POSITION_CODE" VARCHAR(20) NOT NULL,
"POSITION_NAME" VARCHAR(200) NOT NULL,
"OPERATE_TYPE" VARCHAR(1) DEFAULT '0' NOT NULL,
"PARAMS_JSON" TEXT NOT NULL,
"CREATE_TIME" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,
"OPERATOR" VARCHAR(72) NOT NULL,
"OPERATOR_IP" VARCHAR(30),
"INCOME_LETTER_ID" VARCHAR(72),
NOT CLUSTER PRIMARY KEY("LOG_ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "CXAICORG"."T_OPERATION_LOG" IS '操作日志表';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."CREATE_TIME" IS '搜索时间';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."INCOME_LETTER_ID" IS '来函id';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."LOG_ID" IS '日志id';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."OPERATE_TYPE" IS '操作类型（0，查询，1，插入/修改，2，删除）';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."OPERATOR" IS '操作人id';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."OPERATOR_IP" IS '操作人ip';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."PARAMS_JSON" IS '操作参数json';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."POSITION_CODE" IS '操作位置编码';
COMMENT ON COLUMN "CXAICORG"."T_OPERATION_LOG"."POSITION_NAME" IS '操作位置名称';

CREATE OR REPLACE  INDEX "CXAICORG"."T_OPERATION_LOG_INCOME_LETTER_ID_IDX" ON "CXAICORG"."T_OPERATION_LOG"("INCOME_LETTER_ID" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."T_OPERATION_LOG_OPERATOR_ID_IDX" ON "CXAICORG"."T_OPERATION_LOG"("OPERATOR" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."T_OPERATION_LOG_POSITION_CODE_IDX" ON "CXAICORG"."T_OPERATION_LOG"("POSITION_CODE" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."T_OPERATION_LOG_OPERATE_TYPE_IDX" ON "CXAICORG"."T_OPERATION_LOG"("OPERATE_TYPE" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ORGGROUP"
(
"ORGGROUPID" VARCHAR(36) NOT NULL,
"ORGGROUPNAME" VARCHAR(200),
"ORGNUMBER" VARCHAR(40),
"ORGGROUPTYPEID" VARCHAR(36),
"ORGUNITID" VARCHAR(36),
"REMARK" VARCHAR(1000),
NOT CLUSTER PRIMARY KEY("ORGGROUPID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ORGGROUPTYPE"
(
"ORGGROUPTYPEID" VARCHAR(36) NOT NULL,
"ORGGROUPNAME" VARCHAR(200),
NOT CLUSTER PRIMARY KEY("ORGGROUPTYPEID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ORGGROUPUSER"
(
"ORGGROUPUSERID" VARCHAR(36) NOT NULL,
"USERID" VARCHAR(36),
"ORGGROUPID" VARCHAR(36),
NOT CLUSTER PRIMARY KEY("ORGGROUPUSERID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ORGJOBS"
(
"ORGJOBSID" VARCHAR(36) NOT NULL,
"JOBNAME" VARCHAR(200) NOT NULL,
"REMARK" VARCHAR(1000) NOT NULL,
NOT CLUSTER PRIMARY KEY("ORGJOBSID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ORGNODESAPP"
(
"ORGUNITID" VARCHAR(36) NOT NULL,
"PHONENUMBER" VARCHAR(160),
"FAXNUMBER" VARCHAR(160),
"COUNTRY" VARCHAR(100),
"REGION" VARCHAR(100),
"PROVINCE" VARCHAR(100),
"CITY" VARCHAR(100),
"ADDRESS" VARCHAR(510),
"SHORTNAME" VARCHAR(40),
"SHORTOA" VARCHAR(40),
"ORGUNITNO" VARCHAR(100),
"POSTCODE" VARCHAR(6),
"REMARK" VARCHAR(1000),
"ORGUNITTYPE" VARCHAR(400),
"LOCDISTRICT" VARCHAR(40),
NOT CLUSTER PRIMARY KEY("ORGUNITID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ORGUNITPOS"
(
"ORGUNITPOSID" VARCHAR(36) NOT NULL,
"ORGUNITNAME" VARCHAR(200),
"ORGDEPTID" VARCHAR(36),
"ORGUNITID" VARCHAR(36),
"ORGUNITPOSNO" VARCHAR(40),
NOT CLUSTER PRIMARY KEY("ORGUNITPOSID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ORGUNITS"
(
"ORGUNITID" VARCHAR(36) NOT NULL,
"ORGUNITNAME" VARCHAR(200),
"DELETED" VARCHAR(1),
"ORGNUMBER" VARCHAR(40),
"PARENTID" VARCHAR(36),
"UNITTYPE" VARCHAR(1),
"ORGLEVEL" INT,
NOT CLUSTER PRIMARY KEY("ORGUNITID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_PARENTORGAPP"
(
"ORGAPPID" VARCHAR(36) NOT NULL,
"ORGUNITID" VARCHAR(36) NOT NULL,
"PARENTORGAPPID" VARCHAR(36) NOT NULL,
"ORGNUMBER" VARCHAR(40),
"ORGUNITNAME" VARCHAR(200),
NOT CLUSTER PRIMARY KEY("ORGAPPID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_PMACCOUNTUSERS"
(
"USERID" VARCHAR(36) NOT NULL,
"ACCOUNTID" VARCHAR(36),
"ACCREDITTARGET" INT,
NOT CLUSTER PRIMARY KEY("USERID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_POSMENU"
(
"POSMENUID" VARCHAR(36) NOT NULL,
"ORGUNITPOSID" VARCHAR(36),
"SYSMENUID" VARCHAR(36),
NOT CLUSTER PRIMARY KEY("POSMENUID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_POSUSERRELATE"
(
"POSUSERRELATEID" VARCHAR(36) NOT NULL,
"ORGUNITPOSID" VARCHAR(36),
"USERID" VARCHAR(36),
"POSTYPE" VARCHAR(1),
NOT CLUSTER PRIMARY KEY("POSUSERRELATEID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ROLE"
(
"ROLEID" VARCHAR(36) NOT NULL,
"ROLENAME" VARCHAR(200),
"PARENTID" VARCHAR(36),
"REMARK" VARCHAR(1000),
NOT CLUSTER PRIMARY KEY("ROLEID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_ROLEMENU"
(
"ROLEMENUID" VARCHAR(36) NOT NULL,
"ROLEID" VARCHAR(36),
"SYSMENUID" VARCHAR(36),
NOT CLUSTER PRIMARY KEY("ROLEMENUID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_USERMANAGER"
(
"USERMANAGERID" VARCHAR(36) NOT NULL,
"MANAGERID" VARCHAR(20),
"USERID" VARCHAR(36),
NOT CLUSTER PRIMARY KEY("USERMANAGERID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_USERMENU"
(
"USERMENUID" VARCHAR(36) NOT NULL,
"USERID" VARCHAR(36),
"SYSMENUID" VARCHAR(36),
"MENUSTATUS" VARCHAR(20),
"ALLOTSTATUS" VARCHAR(1),
NOT CLUSTER PRIMARY KEY("USERMENUID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

CREATE OR REPLACE  INDEX "CXAICORG"."T_USERMENU_SYSMENUID_IDX" ON "CXAICORG"."T_USERMENU"("SYSMENUID" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."T_USERMENU_IDX" ON "CXAICORG"."T_USERMENU"("USERID" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_USERPORTAL"
(
"ID" VARCHAR(96) NOT NULL,
"ORGID" VARCHAR(96),
"USERNAME" VARCHAR(765),
"REALNAME" VARCHAR(765),
"AVATAR" VARCHAR(765),
"BIRTHDAY" TIMESTAMP(0),
"GENDER" VARCHAR(765),
"EMAIL" VARCHAR(765),
"IDCARD" VARCHAR(765),
"PHONE" VARCHAR(765),
"STATUS" VARCHAR(765),
"DELFLAG" VARCHAR(765),
"CREATEBY" VARCHAR(765),
"CREATETIME" TIMESTAMP(0),
"UPDATEBY" VARCHAR(765),
"UPDATETIME" TIMESTAMP(0),
"LOCALUSERID" VARCHAR(765),
CONSTRAINT "T_USERPORTAL_PK" NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."AVATAR" IS '头像';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."BIRTHDAY" IS '生日';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."CREATEBY" IS '创建人';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."CREATETIME" IS '创建时间';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."DELFLAG" IS '删除状态（0：正常，1：已删除）';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."EMAIL" IS '电子邮件';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."GENDER" IS '性别（1：男 2：女）';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."IDCARD" IS '身份证号码';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."LOCALUSERID" IS '对应信用监管本地组织架构userId';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."ORGID" IS '组织机构ID';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."PHONE" IS '电话';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."REALNAME" IS '真实姓名';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."STATUS" IS '状态(1：启用  0：停用 )';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."UPDATEBY" IS '修改人';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."UPDATETIME" IS '修改时间';
COMMENT ON COLUMN "CXAICORG"."T_USERPORTAL"."USERNAME" IS '用户账号';


CREATE TABLE "CXAICORG"."T_USERROLE"
(
"USERROLEID" VARCHAR(36) NOT NULL,
"ROLEID" VARCHAR(36),
"USERID" VARCHAR(36),
NOT CLUSTER PRIMARY KEY("USERROLEID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_USERS"
(
"USERID" VARCHAR(36) NOT NULL,
"USERNAME" VARCHAR(200),
"PASSWORD" VARCHAR(200),
"REALNAME" VARCHAR(200),
"LOCKED" VARCHAR(1),
"DELETED" VARCHAR(1),
"ORGDEPTID" VARCHAR(36),
"ORGUNITID" VARCHAR(36),
"ORGJOBID" VARCHAR(20),
"USERPROP" INT,
"USERSTATUS" VARCHAR(1),
"GRADENUM" INT,
"CUSTOMINDEX" INT,
"LIMITTNUM" INT DEFAULT 0,
"LASTERRORTIME" TIMESTAMP(0),
NOT CLUSTER PRIMARY KEY("USERID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

CREATE OR REPLACE  INDEX "CXAICORG"."T_USERS_ORGDEPTID_IDX" ON "CXAICORG"."T_USERS"("ORGDEPTID" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;
CREATE OR REPLACE  INDEX "CXAICORG"."T_USERS_ORGUNITID_IDX" ON "CXAICORG"."T_USERS"("ORGUNITID" ASC) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_USERSAPP"
(
"USERID" VARCHAR(36) NOT NULL,
"GENDER" VARCHAR(1),
"PHONENUMBER" VARCHAR(160),
"MOBILE" VARCHAR(160),
"EMAIL" VARCHAR(200),
"ADDRESS" VARCHAR(160),
"WORKNO" VARCHAR(40),
"WORKTYPE" VARCHAR(1),
"BIRTHDAY" DATE,
"HIREDATE" DATE,
"LEAVEDATE" DATE,
"IDENTITYNO" VARCHAR(72),
"REMARK" VARCHAR(1000),
NOT CLUSTER PRIMARY KEY("USERID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


CREATE TABLE "CXAICORG"."T_USERSUPERROLE"
(
"SUPERROLEID" VARCHAR(36) NOT NULL,
"USERID" VARCHAR(36) NOT NULL,
"ROLEID" VARCHAR(36) NOT NULL,
NOT CLUSTER PRIMARY KEY("SUPERROLEID")) STORAGE(ON "MAIN", CLUSTERBTR) ;


