DROP TABLE TBL_OBJECTID;
CREATE TABLE TBL_OBJECTID(
	UUID VARCHAR2(20) NOT NULL PRIMARY KEY);

DROP TABLE TBL_FORMS;
CREATE TABLE TBL_FORMS(
	UUID                VARCHAR2(60) NOT NULL PRIMARY KEY,
	TBLID               VARCHAR2(100),
	TBLNAME             VARCHAR2(100),
	DESCRIPTION         VARCHAR2(500),
	STATUS              NUMBER,
	TABLE_ACL           NUMBER,
	ROW_ACL             NUMBER,
	TYPE                NUMBER,
	SQLSELECTCOLUMN     VARCHAR2(4000),
	SQLFROMCOLUMN       VARCHAR2(4000),
	SQLWHERECOLUMN      VARCHAR2(4000),
	BASESQL             VARCHAR2(4000));
DROP TABLE TBL_FORMSDETAIL;
CREATE TABLE TBL_FORMSDETAIL(
    UUID                VARCHAR2(20) NOT NULL PRIMARY KEY,
    OTHERDOCTYPE        NUMBER,
    OPERINDEX           NUMBER,
    NOTNULL             NUMBER,
    LISTVIEW            NUMBER,
    ISOTHERDOC          NUMBER,
    ISAUDIT             NUMBER,
    FORMUUID            VARCHAR2(60),
    FIELDTYPE           NUMBER,
    FIELDNAME           VARCHAR2(100),
    FIELDLENGTH         NUMBER,
    FIELDID             VARCHAR2(100),
    DEFAULTVALUE        VARCHAR2(100),
    COL_ACL             NUMBER,
    TABLEID             VARCHAR2(100),
    LOGIC               VARCHAR2(20));
DROP TABLE TBL_FORMSDETAILUI;
CREATE TABLE TBL_FORMSDETAILUI(
    DETAILUUID          VARCHAR2(20),
    FORMUUID            VARCHAR2(60),
    UITYPE              NUMBER,
    SYSFUNCTION         VARCHAR2(100));
DROP TABLE TBL_FORMSUI;
CREATE TABLE TBL_FORMSUI(
	UUID                VARCHAR2(20) NOT NULL PRIMARY KEY,
    FORMUUID            VARCHAR2(60),
    UINAME              VARCHAR2(255),
    PATH                VARCHAR2(255),
    TYPE                NUMBER);
DROP TABLE TBL_FORMPARENTCHILD;
CREATE TABLE TBL_FORMPARENTCHILD(
	UUID VARCHAR2(20) NOT NULL PRIMARY KEY,
    PARENTFORMUUID VARCHAR2(20),
	CHILDFORMUUID  VARCHAR2(20));

DROP TABLE TBL_ORDERNUM;
CREATE TABLE TBL_ORDERNUM(
	UUID VARCHAR2(20) NOT NULL PRIMARY KEY,
	HEADSTR VARCHAR2(200),
	NUM NUMBER);

DROP TABLE TBL_SYSMENU;
CREATE TABLE TBL_SYSMENU(
	UUID VARCHAR2(20) NOT NULL PRIMARY KEY,
	SYSTEMID NUMBER,
	MENULEVEL NUMBER,
	INDEXNUM NUMBER,
    NAME VARCHAR2(100),
	DESCRIPTION VARCHAR2(500),
	ICON VARCHAR2(400),
	TARGETPAGE VARCHAR2(400),
	PARENTUUID VARCHAR2(20),
	PARENTTARGET VARCHAR2(400),
	PARENTCATPATH VARCHAR2(500));

DROP TABLE TBL_TREESDEFINE;
CREATE TABLE TBL_TREESDEFINE(
	UUID VARCHAR2(20) NOT NULL PRIMARY KEY,
	TREEID VARCHAR2(50),
	viewDbColumnDesc VARCHAR2(100),
	trueDbColumn VARCHAR2(30),
	baseSql VARCHAR2(400),
	isFolder NUMBER,
	needNesting Number,
	isRoot number,
	nodeType number,
	PARENTUUID VARCHAR2(20),
	PCDbColumn VARCHAR2(30),
  VIEWNAME  VARCHAR2(30)
);

DROP TABLE TBL_ACCESSORY;
CREATE TABLE TBL_ACCESSORY(
	UUID VARCHAR2(20) NOT NULL PRIMARY KEY,
	ENTITYUUID VARCHAR2(50),
	FILENAME VARCHAR2(100),
	SAVEPATH VARCHAR2(200),
	SAVETYPE NUMBER,
	CONTENT LONG RAW
);
DROP TABLE TBL_SHENQING;
CREATE TABLE TBL_SHENQING (
	UUID VARCHAR2(20)  ,
	SHENQINGREN VARCHAR2(20) ,
	TITLE VARCHAR2(200) ,
	DESCRIPTION VARCHAR2(2000) ,
	SHIJIAN NUMBER 
); 

CREATE TABLE TBL_SHENQING_C (
	UUID VARCHAR2(20),
	TBL_SHENQING_FK VARCHAR2(20) ,
	FILES VARCHAR2(20) ,
	DESCRIPTION VARCHAR2(2000) 
);

COMMIT;
