IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_STANDARDTASK')
 CREATE TABLE T_FMM_STANDARDTASK (
	FID						BIGINT              DEFAULT 0       NOT NULL,       
	FNUMBER					NVARCHAR(50)        DEFAULT ' '     NOT NULL, 
	FNAME					NVARCHAR(50)	    DEFAULT ' '     NOT NULL, 
	FSTATUS					NVARCHAR(50)	    DEFAULT ' '     NOT NULL, 	
	FCREATORID				BIGINT              DEFAULT 0       NOT NULL,   
	FMODIFIERID				BIGINT              DEFAULT 0       NOT NULL,   
	FENABLE					NVARCHAR(50)	    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,
	FCTRLSTRATEGY			NVARCHAR(50)        DEFAULT ' '     NOT NULL, 
	FSOURCEDATAID			BIGINT              DEFAULT 0       NOT NULL,  
	FBITINDEX				BIGINT              DEFAULT 0       NOT NULL,  
	FSOURCEBITINDEX			BIGINT              DEFAULT 0       NOT NULL,  
	FBIZTYPE				NVARCHAR(50)        DEFAULT ' '     NOT NULL, 
	FPLANTYPE				BIGINT              DEFAULT 0       NOT NULL,  
	FWBSTYPE				BIGINT              DEFAULT 0       NOT NULL,  
	FTASKTYPE				BIGINT              DEFAULT 0       NOT NULL,  
	FPLANAREA				BIGINT              DEFAULT 0       NOT NULL,  
	FPLANPERIOD				DECIMAL(23,10)      DEFAULT 0       NOT NULL,  
	FTIMEUNIT				BIGINT              DEFAULT 0       NOT NULL,  
	FISIMPORT				CHAR(1)             DEFAULT '0'     NOT NULL,
	FSOURCEPROJECT			BIGINT              DEFAULT 0       NOT NULL,
	FREMARK					NVARCHAR(255)       DEFAULT ' '     NOT NULL,
	FAUDITOR				BIGINT              DEFAULT 0       NOT NULL,
	FAUDITTIME				DATETIME
);

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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_STANDARDTASKENTRY')
 CREATE TABLE T_FMM_STANDARDTASKENTRY (
	FID						BIGINT               DEFAULT 0       NOT NULL,
	FENTRYID				BIGINT               DEFAULT 0       NOT NULL,
	FSEQ					INT                  DEFAULT 0       NOT NULL,
	FPROGROUP				BIGINT               DEFAULT 0       NOT NULL,
	FPROFESSION				BIGINT               DEFAULT 0       NOT NULL,
	FREMARK					NVARCHAR(255)        DEFAULT ' '     NOT NULL
);