/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_EQTNEEDPLAN') 
 CREATE TABLE T_MSPLAN_EQTNEEDPLAN (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBILLTYPE BIGINT DEFAULT 0 NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FCHECKTYPE BIGINT DEFAULT 0 NOT NULL,
FPROJECT BIGINT DEFAULT 0 NOT NULL,
FCUSTOMER BIGINT DEFAULT 0 NOT NULL,
FWORKCENTER BIGINT DEFAULT 0 NOT NULL,
FWORKSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FCLOSEDATE DATETIME,
FCLOSEOR BIGINT DEFAULT 0 NOT NULL,
FDATASOURCE VARCHAR(5) DEFAULT ' ' NOT NULL,
FECNSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FSRCBILLID BIGINT DEFAULT 0 NOT NULL,
FECNBILLID BIGINT DEFAULT 0 NOT NULL,
FLOGID BIGINT DEFAULT 0 NOT NULL,
FISDEAL CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_EQTNEEDPLANENTRY') 
 CREATE TABLE T_MSPLAN_EQTNEEDPLANENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSTART NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEND NVARCHAR(100) DEFAULT ' ' NOT NULL,
FRESOURCE BIGINT DEFAULT 0 NOT NULL,
FSTIME DATETIME,
FFTIME DATETIME,
FQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNIT BIGINT DEFAULT 0 NOT NULL,
FKEY CHAR(1) DEFAULT '0' NOT NULL,
FCHOOSE CHAR(1) DEFAULT '0' NOT NULL,
FSTARTTASKID BIGINT DEFAULT 0 NOT NULL,
FENDTASKID BIGINT DEFAULT 0 NOT NULL,
FSOURCETYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FUSETIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPLANTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAREA VARCHAR(100) DEFAULT ' ' NOT NULL,
FPGRES VARCHAR(50) DEFAULT ' ' NOT NULL,
FDELIVETIME DATETIME,
FQUITTIME DATETIME,
FISQUIT CHAR(1) DEFAULT '0' NOT NULL,
FISDELIVE CHAR(1) DEFAULT '0' NOT NULL,
FADVTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FADVQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FADVSTIME DATETIME,
FADVFTIME DATETIME,
FSRCENTRYID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
