/*==============================================================*/
/* Table:  T_MSPLAN_VWSCHEME   视图方案    创建人: 喻勇   创建时间: 20211210   */
/*==============================================================*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_VWSCHEME') 
CREATE TABLE T_MSPLAN_VWSCHEME
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL, 
  FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,   
  FSTATUS NVARCHAR(1) DEFAULT ' ' NOT NULL, 	
  FCREATORID BIGINT DEFAULT 0 NOT NULL,   	
  FMODIFIERID BIGINT DEFAULT 0 NOT NULL,  	
  FENABLE NVARCHAR(1) DEFAULT ' ' NOT NULL, 	
  FCREATETIME DATETIME ,                  	
  FMODIFYTIME DATETIME ,                  	
  FMASTERID BIGINT DEFAULT 0 NOT NULL,    	
  FCREATEORGID BIGINT DEFAULT 0 NOT NULL, 	
  FORGID BIGINT DEFAULT 0 NOT NULL,       	
  FUSEORGID BIGINT DEFAULT 0 NOT NULL,    	
  FCTRLSTRATEGY NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL, 	
  FBITINDEX INT DEFAULT 0 NOT NULL,       	
  FSOURCEBITINDEX INT DEFAULT 0 NOT NULL, 	
  FISSYS CHAR(1) DEFAULT '0' NOT NULL,    	
  FAREA NVARCHAR(255) DEFAULT ' ' NOT NULL, 	
  FAUDITORID BIGINT DEFAULT 0 NOT NULL,   	
  FAUDITTIME DATETIME ,                   	
  FFIRSTYEAR CHAR(1) DEFAULT '0' NOT NULL, 	
  FFIRSTYM CHAR(1) DEFAULT '0' NOT NULL,  
  FFIRSTYQ CHAR(1) DEFAULT '0' NOT NULL,  	
  FSECONDYEAR CHAR(1) DEFAULT '0' NOT NULL, 	
  FSECONDYQ CHAR(1) DEFAULT '0' NOT NULL, 	
  FSECONDYM CHAR(1) DEFAULT '0' NOT NULL, 
  FSECONDHOUR CHAR(1) DEFAULT '0' NOT NULL, 	
  FSHOWDATAL CHAR(1) DEFAULT '0' NOT NULL, 
  FLINETYPE NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FCOLORVALUE NVARCHAR(50) DEFAULT ' ' NOT NULL, 	
  FSHOWLVLLINE CHAR(1) DEFAULT '0' NOT NULL, 	
  FASSISLINETYPE NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FINTERNALROW INT DEFAULT 0 NOT NULL,    	
  FSHOWHLINE CHAR(1) DEFAULT '0' NOT NULL, 	
  FASSISHLINETYPE NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FINTERNALCOL INT DEFAULT 0 NOT NULL
);


/*==============================================================*/
/* Table:  T_MSPLAN_VWSCHEME_L   视图方案多语言表    创建人: 喻勇   创建时间: 20211210*/
/*==============================================================*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_VWSCHEME_L')
CREATE TABLE T_MSPLAN_VWSCHEME_L
(
  FPKID NVARCHAR(255) DEFAULT ' ' NOT NULL,          	
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FLOCALEID NVARCHAR(255) DEFAULT ' ' NOT NULL,          	
  FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_JVWSCHEMSET')
CREATE TABLE T_MSPLAN_JVWSCHEMSET
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     	
  FSEQ INT DEFAULT 0 NOT NULL,         
  FCOLUMNFLAG NVARCHAR(5) DEFAULT ' ' NOT NULL,   
  FALIGN NVARCHAR(10) DEFAULT ' ' NOT NULL, 	
  FFONTSIZE DECIMAL(23,10) DEFAULT 0 NOT NULL, 	
  FCOLWIDTH DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_JVWSCHEMSET' AND KSQL_COL_NAME ='FCOLUMNFLAG') 
 ALTER TABLE T_MSPLAN_JVWSCHEMSET ADD (FCOLUMNFLAG NVARCHAR(5) DEFAULT ' ' NOT NULL );

/*==============================================================*/
/* Table:  T_MSPLAN_JVWSCHGROUP   视图方案_分组字段    创建人: 喻勇   创建时间: 20211210*/
/*==============================================================*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_JVWSCHGROUP')
CREATE TABLE T_MSPLAN_JVWSCHGROUP
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     	
  FSEQ INT DEFAULT 0 NOT NULL,            	
  FGROUPFLAG NVARCHAR(50) DEFAULT ' ' NOT NULL, 	
  FGROUPLEVEL INT DEFAULT 0 NOT NULL,     	
  FBANDCOLORVAL NVARCHAR(50) DEFAULT ' ' NOT NULL, 	
  FBANDCOLOR NVARCHAR(50) DEFAULT ' ' NOT NULL, 	
  FENTITYFLAGID NVARCHAR(255) DEFAULT ' ' NOT NULL
);



/*==============================================================*/
/* Table:  T_MSPLAN_JVWSCHCROSS   视图方案_横道选项    创建人: 喻勇   创建时间: 20211210*/
/*==============================================================*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_JVWSCHCROSS')
CREATE TABLE T_MSPLAN_JVWSCHCROSS
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     	
  FSEQ INT DEFAULT 0 NOT NULL,            	
  FCROSSOBJ NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FCROSSTYPEID BIGINT DEFAULT 0 NOT NULL, 	
  FCROSSSHAP NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FHEIGHT NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FLABELISSHOW CHAR(1) DEFAULT '0' NOT NULL, 	
  FPOSITION NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FLIMITVALUE INT DEFAULT 0 NOT NULL,     	
  FISLINE CHAR(1) DEFAULT '0' NOT NULL,   	
  FCROSSCOLOR NVARCHAR(50) DEFAULT ' ' NOT NULL
);






