/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_TAX_MAIN' AND KSQL_COL_NAME ='FFINANCIALSTATEMENT') 
 ALTER TABLE T_TCTB_TAX_MAIN ADD (FFINANCIALSTATEMENT CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_ORG_GROUP_DETAIL' AND KSQL_COL_NAME ='FISSUESBB') 
 ALTER TABLE T_TCTB_ORG_GROUP_DETAIL ADD (FISSUESBB CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_DECLARE_MAIN' AND KSQL_COL_NAME ='FZERODECLARE') 
 ALTER TABLE T_TCTB_DECLARE_MAIN ADD (FZERODECLARE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TASK_DETAIL') 
 CREATE TABLE T_TCTB_TASK_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FTASKDEFINE VARCHAR(36) DEFAULT ' ' NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FPROGRESS BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKID VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXORG BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FEXECUTEDETAIL VARCHAR(500) DEFAULT ' ' NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKCLASSNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FBUSINESSPARAMS VARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_TASK_MONITOR') 
 CREATE TABLE T_TCTB_TASK_MONITOR (
FID BIGINT DEFAULT 0 NOT NULL,
FDISPATCHTIME DATETIME,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FEXECUTETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROGRESS BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FOPERATER BIGINT DEFAULT 0 NOT NULL,
FEXECUTEDETAIL VARCHAR(200) DEFAULT ' ' NOT NULL,
FTASKDEFINE VARCHAR(36) DEFAULT ' ' NOT NULL,
FTASKID VARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
