/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ANALYSEREPORT_USER') 
 CREATE TABLE T_EB_ANALYSEREPORT_USER (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FREPORTID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FISREAD CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ANALYSEREPORT') 
 CREATE TABLE T_EB_ANALYSEREPORT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FDIMSJSON NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FRPTTEMPID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ANALYSERPTTEMPLATE') 
 CREATE TABLE T_EB_ANALYSERPTTEMPLATE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FBIZMODELID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT '1' NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ANALYSERPTTEMPLATE_L') 
 CREATE TABLE T_EB_ANALYSERPTTEMPLATE_L (
FPKID NVARCHAR(20) DEFAULT '0' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ANALYSEVARSEL') 
 CREATE TABLE T_EB_ANALYSEVARSEL (
FRPTTEMPID BIGINT DEFAULT 0 NOT NULL,
FVARTYPE BIGINT DEFAULT 0 NOT NULL,
FVARID BIGINT DEFAULT 0 NOT NULL,
FVARKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DIMCOMBINATION') 
 CREATE TABLE T_EB_DIMCOMBINATION (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FBIZSCOPEID BIGINT DEFAULT 0 NOT NULL,
FBIZMODELID BIGINT DEFAULT 0 NOT NULL,
FAMOUNTUNIT CHAR(1) DEFAULT '1' NOT NULL,
FISADD CHAR(1) DEFAULT '0' NOT NULL,
FCOMBINATIONJSON NVARCHAR(2000) DEFAULT '0' NOT NULL,
FMETRICTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DIMPARAMETER') 
 CREATE TABLE T_EB_DIMPARAMETER (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FBIZMODELID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_JUDGECONDITION') 
 CREATE TABLE T_EB_JUDGECONDITION (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FBIZMODELID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_JUDGECONDITIONENTRY') 
 CREATE TABLE T_EB_JUDGECONDITIONENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FCONNECTOR CHAR(1) DEFAULT ' ' NOT NULL,
FSOURCEID BIGINT DEFAULT 0 NOT NULL,
FCOMPAREID BIGINT DEFAULT 0 NOT NULL,
FOFFSETTYPE CHAR(1) DEFAULT '1' NOT NULL,
FCOMPARESYMBOL CHAR(1) DEFAULT '1' NOT NULL,
FCOMPARERESULT DECIMAL(23,2) DEFAULT 0 NOT NULL,
FISEND CHAR(1) DEFAULT ' ' NOT NULL,
FWORDDISPLAY NVARCHAR(4) DEFAULT ' ' NOT NULL,
FWARNGRAPH CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_REPORTVARIABLETYPE') 
 CREATE TABLE T_EB_REPORTVARIABLETYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME,
FBIZMODELID BIGINT DEFAULT 0 NOT NULL,
FVARMETADATAKEY NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_RPTSHARESCHEME') 
 CREATE TABLE T_EB_RPTSHARESCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_RPTSHARESCHEME_USER') 
 CREATE TABLE T_EB_RPTSHARESCHEME_USER (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_RPTTEMPLATE_USER') 
 CREATE TABLE T_EB_RPTTEMPLATE_USER (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


 --- drop TABLE --------- 不允许删除表T_EB_DADASSDF，请恢复pdm ------------------- 

/**End D:\PDM_UPGRADE\PDM1\EB_table.sql **/
