CREATE TABLE "zkqy-call"."DRAG_FORM"
(
    "F_ID" BIGINT IDENTITY(189, 1) NOT NULL,
    "SQL_KEY" VARCHAR(255),
    "DF_NAME" VARCHAR(100),
    "DF_NICKNAME" VARCHAR(100),
    "DF_VUE_TEMPLATE" TEXT,
    "DF_HTML_TEMPLATE" TEXT,
    "DF_FORM_SQL" VARCHAR(255),
    "DF_NODE_ID" BIGINT,
    "DF_DATABASE" VARCHAR(50),
    "DF_TABLE_NAME" VARCHAR(50),
    "DF_FLIE_PATH" VARCHAR(255),
    "DF_NOTES" VARCHAR(200),
    "DEL_FLAG" CHAR(1) DEFAULT '0',
    "CREATE_TIME" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP(),
    "CREATE_BY" VARCHAR(255),
    "UPDATE_BY" VARCHAR(50),
    "UPDATE_TIME" TIMESTAMP(0),
    "SPARE" VARCHAR(255),
    "SPARE1" VARCHAR(255),
    NOT CLUSTER PRIMARY KEY("F_ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."DRAG_FORM" IS '动态表单';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."CREATE_BY" IS '创建人ID';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DEL_FLAG" IS '逻辑删除';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_DATABASE" IS '数据源名称';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_FLIE_PATH" IS '源文件存放地址';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_FORM_SQL" IS '表单sql';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_HTML_TEMPLATE" IS '表单html模版';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_NAME" IS '表单名称';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_NICKNAME" IS '表单别名';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_NODE_ID" IS '节点ID';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_NOTES" IS '表单描述';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_TABLE_NAME" IS '绑定表名称';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."DF_VUE_TEMPLATE" IS '表单vue模版';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."F_ID" IS '表单主键';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."SPARE" IS '备用列';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."SPARE1" IS '备用列';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."SQL_KEY" IS 'sql编号';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."UPDATE_BY" IS '更新者ID';
COMMENT ON COLUMN "zkqy-call"."DRAG_FORM"."UPDATE_TIME" IS '更新时间';


CREATE TABLE "zkqy-call"."DRAG_TABLE"
(
    "T_ID" BIGINT IDENTITY(144, 1) NOT NULL,
    "DT_NAME" VARCHAR(255),
    "DT_NICKNAME" VARCHAR(255),
    "TABLE_KEY" VARCHAR(255),
    "SQL_KEY" VARCHAR(255),
    "DT_TABLE_NAME" VARCHAR(255),
    "DT_NOTES" VARCHAR(255),
    "DT_COLUMN_NAME" TEXT,
    "TIME_FORMAT" VARCHAR(500),
    "SPARE" VARCHAR(255),
    "SPARE1" VARCHAR(255),
    "DEL_FLAG" CHAR(1),
    "CREATE_BY" VARCHAR(64),
    "CREATE_TIME" TIMESTAMP(0),
    "UPDATE_BY" VARCHAR(64),
    "UPDATE_TIME" TIMESTAMP(0),
    "IS_SELECTION" CHAR(1),
    "ECHO_DATA" TEXT,
    "MENU_ID" BIGINT,
    "PRIMARY_KEY" VARCHAR(50),
    NOT CLUSTER PRIMARY KEY("T_ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."DRAG_TABLE" IS '动态表格';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."CREATE_BY" IS '创建人';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."DEL_FLAG" IS '逻辑删除';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."DT_COLUMN_NAME" IS '列字段以及标题名称';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."DT_NAME" IS '表格名称(中文)';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."DT_NICKNAME" IS '表格别名';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."DT_NOTES" IS '表格描述';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."DT_TABLE_NAME" IS '绑定表名称';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."ECHO_DATA" IS '回显数据（前端回显数据使用）';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."IS_SELECTION" IS '是否显示列表复选框(0:显示；1;不显示)';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."MENU_ID" IS '菜单编号';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."PRIMARY_KEY" IS '当前表单的唯一标识，用来修改删除使用';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."SPARE" IS '备用列';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."SPARE1" IS '备用列';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."SQL_KEY" IS 'sql编号';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."T_ID" IS '表格主键';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."TABLE_KEY" IS 'table编号(路由)';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."TIME_FORMAT" IS '时间格式';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."UPDATE_BY" IS '修改人';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE"."UPDATE_TIME" IS '修改时间';


CREATE TABLE "zkqy-call"."DRAG_TABLE_CONDITION"
(
    "TC_ID" BIGINT IDENTITY(157, 1) NOT NULL,
    "T_ID" BIGINT,
    "CONDITION_NAME" VARCHAR(255),
    "CONDITION_FIELD" VARCHAR(255),
    "CONDITION_NOTES" VARCHAR(255),
    "CONDITION_TYPE" VARCHAR(255),
    "CONDITION_DEFAULT_VALUE" VARCHAR(255),
    "SORT" INT,
    "CONDITION_TABLE_NAME" VARCHAR(255),
    "CONDITION_TABLE_FIELD_NAME" VARCHAR(255),
    "CONDITION_TABLE_FIELD_KEY" VARCHAR(255),
    "CONDITION_DATASOURCE" CHAR(1),
    "COMPONENT_TYPE" VARCHAR(50),
    "COMPONENT_SIZE" VARCHAR(50),
    "COMPONENT_ICON" VARCHAR(255),
    "IS_HIDDEN" CHAR(1),
    "DEL_FLAG" CHAR(1),
    "CREATE_BY" VARCHAR(64),
    "CREATE_TIME" TIMESTAMP(0),
    "UPDATE_BY" VARCHAR(64),
    "UPDATE_TIME" TIMESTAMP(0),
    NOT CLUSTER PRIMARY KEY("TC_ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."DRAG_TABLE_CONDITION" IS '动态表格条件';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."COMPONENT_ICON" IS '组件图标';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."COMPONENT_SIZE" IS '组件大小';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."COMPONENT_TYPE" IS '组件类型（时间组件、btn等type类型参照element官方api中的类型 ）';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_DATASOURCE" IS '数据来源（0：字典；1：表字段）';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_DEFAULT_VALUE" IS '默认值';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_FIELD" IS '条件字段';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_NAME" IS '条件名称';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_NOTES" IS '条件描述';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_TABLE_FIELD_KEY" IS '表字段key（下拉框关联）唯一标识';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_TABLE_FIELD_NAME" IS '表字段名称（下拉框关联）';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_TABLE_NAME" IS '表名称（下拉框关联）/ 字典类型';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CONDITION_TYPE" IS '条件类型';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CREATE_BY" IS '创建人';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."DEL_FLAG" IS '逻辑删除(0 否; 1 是)';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."IS_HIDDEN" IS '是否隐藏(0 显示; 1 隐藏)';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."SORT" IS '排序';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."T_ID" IS '动态表格编号';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."TC_ID" IS '编号';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."UPDATE_BY" IS '修改人';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_CONDITION"."UPDATE_TIME" IS '修改时间';


CREATE TABLE "zkqy-call"."DRAG_TABLE_FORM"
(
    "ID" BIGINT IDENTITY(71, 1) NOT NULL,
    "DT_ID" BIGINT,
    "DF_ID" BIGINT,
    NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."DRAG_TABLE_FORM" IS '动态表格表单关联表';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_FORM"."DF_ID" IS '动态表单id';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_FORM"."DT_ID" IS '动态表格id';
COMMENT ON COLUMN "zkqy-call"."DRAG_TABLE_FORM"."ID" IS '编号';


CREATE TABLE "zkqy-call"."M_F"
(
    "M_F_ID" INT,
    "F_ID" BIGINT,
    "M_ID" BIGINT,
    "DEL_FLAG" CHAR(1)) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."M_F" IS '动态表单以及流程 关系表';
COMMENT ON COLUMN "zkqy-call"."M_F"."DEL_FLAG" IS '逻辑删除';
COMMENT ON COLUMN "zkqy-call"."M_F"."F_ID" IS '动态表单主键';
COMMENT ON COLUMN "zkqy-call"."M_F"."M_F_ID" IS '主键';
COMMENT ON COLUMN "zkqy-call"."M_F"."M_ID" IS '流程节点id';


CREATE TABLE "zkqy-call"."RELEVANCE_FROM"
(
    "ID" INT IDENTITY(3, 1) NOT NULL,
    "NAME" VARCHAR(255),
    "MAIN_ID" INT,
    NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."RELEVANCE_FROM" IS '从表';
COMMENT ON COLUMN "zkqy-call"."RELEVANCE_FROM"."ID" IS '编号';
COMMENT ON COLUMN "zkqy-call"."RELEVANCE_FROM"."MAIN_ID" IS '主表id';
COMMENT ON COLUMN "zkqy-call"."RELEVANCE_FROM"."NAME" IS '从名称';


CREATE TABLE "zkqy-call"."RELEVANCE_MAIN"
(
    "ID" INT IDENTITY(5, 1) NOT NULL,
    "NAME" VARCHAR(255),
    "ADDRESS" VARCHAR(255),
    NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."RELEVANCE_MAIN" IS '主表';
COMMENT ON COLUMN "zkqy-call"."RELEVANCE_MAIN"."ADDRESS" IS '地址';
COMMENT ON COLUMN "zkqy-call"."RELEVANCE_MAIN"."ID" IS '编号';
COMMENT ON COLUMN "zkqy-call"."RELEVANCE_MAIN"."NAME" IS '姓名';


CREATE TABLE "zkqy-call"."SYS_DICT_DATA"
(
    "DICT_CODE" BIGINT IDENTITY(229, 1) NOT NULL,
    "DICT_SORT" INT DEFAULT 0,
    "DICT_LABEL" VARCHAR(100) DEFAULT '',
    "DICT_VALUE" VARCHAR(100) DEFAULT '',
    "DICT_TYPE" VARCHAR(100) DEFAULT '',
    "CSS_CLASS" VARCHAR(100),
    "LIST_CLASS" VARCHAR(100),
    "IS_DEFAULT" CHAR(1) DEFAULT 'N',
    "STATUS" CHAR(1) DEFAULT '0',
    "CREATE_BY" VARCHAR(64) DEFAULT '',
    "CREATE_TIME" TIMESTAMP(0),
    "UPDATE_BY" VARCHAR(64) DEFAULT '',
    "UPDATE_TIME" TIMESTAMP(0),
    "REMARK" VARCHAR(500),
    NOT CLUSTER PRIMARY KEY("DICT_CODE")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."SYS_DICT_DATA" IS '字典数据表';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."CREATE_BY" IS '创建者';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."CSS_CLASS" IS '样式属性（其他样式扩展）';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."DICT_CODE" IS '字典编码';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."DICT_LABEL" IS '字典标签';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."DICT_SORT" IS '字典排序';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."DICT_TYPE" IS '字典类型';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."DICT_VALUE" IS '字典键值';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."IS_DEFAULT" IS '是否默认（Y是 N否）';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."LIST_CLASS" IS '表格回显样式';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."REMARK" IS '备注';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."STATUS" IS '状态（0正常 1停用）';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."UPDATE_BY" IS '更新者';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_DATA"."UPDATE_TIME" IS '更新时间';


CREATE TABLE "zkqy-call"."SYS_DICT_TYPE"
(
    "DICT_ID" BIGINT IDENTITY(18, 1) NOT NULL,
    "DICT_NAME" VARCHAR(100) DEFAULT '',
    "DICT_TYPE" VARCHAR(100) DEFAULT '',
    "STATUS" CHAR(1) DEFAULT '0',
    "CREATE_BY" VARCHAR(64) DEFAULT '',
    "CREATE_TIME" TIMESTAMP(0),
    "UPDATE_BY" VARCHAR(64) DEFAULT '',
    "UPDATE_TIME" TIMESTAMP(0),
    "REMARK" VARCHAR(500),
    NOT CLUSTER PRIMARY KEY("DICT_ID"),
    CONSTRAINT "DICT_TYPE" UNIQUE("DICT_TYPE")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."SYS_DICT_TYPE" IS '字典类型表';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."CREATE_BY" IS '创建者';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."DICT_ID" IS '字典主键';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."DICT_NAME" IS '字典名称';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."DICT_TYPE" IS '字典类型';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."REMARK" IS '备注';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."STATUS" IS '状态（0正常 1停用）';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."UPDATE_BY" IS '更新者';
COMMENT ON COLUMN "zkqy-call"."SYS_DICT_TYPE"."UPDATE_TIME" IS '更新时间';


CREATE TABLE "zkqy-call"."TABLE_SQL"
(
    "T_ID" BIGINT IDENTITY(132, 1) NOT NULL,
    "TABLE_SQL" TEXT,
    "TABLE_CONDITION" TEXT,
    "TABLE_ALIAS" VARCHAR(50),
    "SQL_KEY" VARCHAR(100),
    "TABLE_EXPORT_FIELD" TEXT,
    "CREATE_BY" VARCHAR(50),
    "CREATE_TIME" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP(),
    "UPDATE_BY" VARCHAR(50),
    "UPDATE_TIME" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP(),
    "DEL_FLAG" CHAR(1) DEFAULT '0',
    "IS_ASC" VARCHAR(10),
    "ORDER_BY_COLUMN" VARCHAR(255),
    NOT CLUSTER PRIMARY KEY("T_ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON TABLE "zkqy-call"."TABLE_SQL" IS 'table 联合查询sql存储表';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."CREATE_BY" IS '创建人';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."CREATE_TIME" IS '创建时间';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."DEL_FLAG" IS '逻辑删除';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."IS_ASC" IS '排序规则（0：true 1:false）';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."ORDER_BY_COLUMN" IS '排序字段';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."SQL_KEY" IS 'sql编号，绑定tableList';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."TABLE_ALIAS" IS '表别名';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."TABLE_CONDITION" IS '表查询字段';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."TABLE_EXPORT_FIELD" IS '导出字段名称以及列名';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."TABLE_SQL" IS '表查询语句';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."UPDATE_BY" IS '更新人';
COMMENT ON COLUMN "zkqy-call"."TABLE_SQL"."UPDATE_TIME" IS '更新时间';


CREATE TABLE "zkqy-call"."TEST"
(
    "ID" BIGINT IDENTITY(1234170, 1) NOT NULL,
    "NAME" VARCHAR(255),
    "AGE" INT,
    "SEX" VARCHAR(255),
    "REM" VARCHAR(255),
    "TIME" TIMESTAMP(0),
    "NAME1" VARCHAR(255),
    NOT CLUSTER PRIMARY KEY("ID")) STORAGE(ON "MAIN", CLUSTERBTR) ;

COMMENT ON COLUMN "zkqy-call"."TEST"."AGE" IS '年龄';
COMMENT ON COLUMN "zkqy-call"."TEST"."ID" IS '编号';
COMMENT ON COLUMN "zkqy-call"."TEST"."NAME" IS '名称';
COMMENT ON COLUMN "zkqy-call"."TEST"."NAME1" IS '名称1';
COMMENT ON COLUMN "zkqy-call"."TEST"."REM" IS '备注';
COMMENT ON COLUMN "zkqy-call"."TEST"."SEX" IS '性别';
COMMENT ON COLUMN "zkqy-call"."TEST"."TIME" IS '时间';


