
create table ANALYSE_STATISTICS_WHERE
(
  ID         VARCHAR2(50) not null,
  FID        VARCHAR2(50),
  SLEFT       VARCHAR2(50),
  FIELD      VARCHAR2(50),
  SYMBOL     VARCHAR2(3000),
  WHEREVALUE VARCHAR2(3000),
  SRIGHT      VARCHAR2(50),
  LOGIC      CHAR(1)
)
;
alter table ANALYSE_STATISTICS_WHERE
  add constraint PK_ANALYSE_STATISTICS_WHERE primary key (ID);


  create table ANALYSE_STATISTICS_CWHERE
(
  ID         VARCHAR2(50) not null,
  FID        VARCHAR2(50),
  SLEFT       VARCHAR2(30),
  FIELD      VARCHAR2(50),
  SYMBOL     VARCHAR2(3000),
  WHEREVALUE VARCHAR2(3000),
  SRIGHT      VARCHAR2(50),
  LOGIC      CHAR(1)
)
;
alter table ANALYSE_STATISTICS_CWHERE
  add constraint PK_ANALYSE_STATISTICS_CWHERE primary key (ID);


  create table ANALYSE_STATISTICS_RESULT
(
  ID      VARCHAR2(50) not null,
  FID     VARCHAR2(50),
  FIELD1  VARCHAR2(300),
  FIELD2  VARCHAR2(300),
  FIELD3  VARCHAR2(300),
  FIELD4  VARCHAR2(300),
  FIELD5  VARCHAR2(300),
  FIELD6  VARCHAR2(300),
  FIELD7  VARCHAR2(300),
  FIELD8  VARCHAR2(300),
  FIELD9  VARCHAR2(300),
  FIELD10 VARCHAR2(300),
  FIELD11 VARCHAR2(300),
  FIELD12 VARCHAR2(300),
  FIELD13 VARCHAR2(300),
  FIELD14 VARCHAR2(300),
  FIELD15 VARCHAR2(300),
  FIELD16 VARCHAR2(300),
  FIELD17 VARCHAR2(300),
  FIELD18 VARCHAR2(300),
  FIELD19 VARCHAR2(300),
  FIELD20 VARCHAR2(300),
  FIELD21 VARCHAR2(300),
  FIELD22 VARCHAR2(300),
  FIELD23 VARCHAR2(300),
  FIELD24 VARCHAR2(300),
  FIELD25 VARCHAR2(300),
  FIELD26 VARCHAR2(300),
  FIELD27 VARCHAR2(300),
  FIELD28 VARCHAR2(300),
  FIELD29 VARCHAR2(300),
  FIELD30 VARCHAR2(300),
  FIELD31 VARCHAR2(300),
  FIELD32 VARCHAR2(300),
  FIELD33 VARCHAR2(300),
  FIELD34 VARCHAR2(300),
  FIELD35 VARCHAR2(300),
  FIELD36 VARCHAR2(300),
  FIELD37 VARCHAR2(300),
  FIELD38 VARCHAR2(300),
  FIELD39 VARCHAR2(300),
  FIELD40 VARCHAR2(300),
  FIELD41 VARCHAR2(300),
  FIELD42 VARCHAR2(300),
  FIELD43 VARCHAR2(300),
  FIELD44 VARCHAR2(300),
  FIELD45 VARCHAR2(300),
  FIELD46 VARCHAR2(300),
  FIELD47 VARCHAR2(300),
  FIELD48 VARCHAR2(300),
  FIELD49 VARCHAR2(300),
  FIELD50 VARCHAR2(300),
  SUSERNO VARCHAR2(200)
)
;
alter table ANALYSE_STATISTICS_RESULT
  add constraint PK_ANALYSE_STATISTICS_RESULT primary key (ID);
  

  create table ANALYSE_STATISTICS_MAIN
(
   
  ID              VARCHAR2(50) not null,       
  STATISTICSNAME  VARCHAR2(200),      
  SDESC           VARCHAR2(200),    
  TABLEID         VARCHAR2(50),     
  TIMESTYPE       VARCHAR2(50), 
  PLANARTABLE     VARCHAR2(50), 
  PLANARFIELD     VARCHAR2(50), 
  CPLANARFIELD    VARCHAR2(50),   
  WHEREVALUE      VARCHAR2(3000),  
  EXCELTEMPLATE   VARCHAR2(100),    
  PLANARFIELDNAME VARCHAR2(100),   
  WISMATCH        CHAR(1),   
  CJOIN           CHAR(1),   
  ISUNIT         CHAR(1),   
  SINPUTTYPE      CHAR(1),    
  SINPUTPAGE      VARCHAR2(300),    
  ISAGV           CHAR(1),    
  ISSUM           CHAR(1),   
  ISSHOWTYPE      CHAR(1),   
  SHOWLINK        VARCHAR2(300),  
  TIMETEMPLATE    VARCHAR2(200),   
  CODETABLE       VARCHAR2(100),           
  TBUTTON         VARCHAR2(100),     
  ISNUMBER        CHAR(1), 
  ADDFIELD         VARCHAR2(300),  
  DCODE           VARCHAR2(64),   
  ISZERO           VARCHAR2(1) 
 
)
;
alter table ANALYSE_STATISTICS_MAIN
  add constraint PK_ANALYSE_STATISTICS_MAIN primary key (ID);


--编号,统计配置表ID,自定义统计字段
  create table ANALYSE_STATISTICS_CUSTOM
(
  ID     VARCHAR2(50) not null,
  FID    VARCHAR2(50),
  GFIELD VARCHAR2(100)
)
;
alter table ANALYSE_STATISTICS_CUSTOM
  add constraint PK_ANALYSE_STATISTICS_CUSTOM primary key (ID);


create table ANALYSE_STATISTICS_CFIELD
(
  ID               VARCHAR2(50) not null,
  FID              VARCHAR2(50),
  SFIELDNAME       VARCHAR2(100),
  SFIELDSHOWNAME   VARCHAR2(100),
  EXPRESSIONS      VARCHAR2(3000),
  DISTINCTION      NUMBER default 1,
  ISSHOW           CHAR(1),
  SAVEFIELD        VARCHAR2(50),
  EXPRESSIONSWHERE VARCHAR2(4000),
  ADDSIGN          VARCHAR2(50),
  RADIXPOINT       NUMBER default 0,
  SHOWCODE         VARCHAR2(50),
  TABLEID          VARCHAR2(50),
  CPLANARFIELD     VARCHAR2(50),
  CJOIN            CHAR(1),
  CPLANARESPECIAL  VARCHAR2(100)
)
;
alter table ANALYSE_STATISTICS_CFIELD
  add constraint PK_ANALYSE_STATISTICS_CFIELD primary key (ID);


  create table ANALYSE_STATISTICS_CCONNECTION
(
  ID       VARCHAR2(50) not null,
  FID      VARCHAR2(50),
  MFIELD   VARCHAR2(50),
  CFIELD   VARCHAR2(50),
  JOINTYPE CHAR(1)
)
;
alter table ANALYSE_STATISTICS_CCONNECTION
  add constraint PK_ANALYSE_STATISTICS_CCONNECT primary key (ID);
