/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_OPENAPPLY_SUP') 
 CREATE TABLE T_SRC_OPENAPPLY_SUP (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FLINKMAN NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFEEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISPAYFEE CHAR(1) DEFAULT '0' NOT NULL,
FISCONFIRM CHAR(1) DEFAULT '0' NOT NULL,
FISTENDER CHAR(1) DEFAULT '0' NOT NULL,
FISDISCARD CHAR(1) DEFAULT '0' NOT NULL,
FISINVITE CHAR(1) DEFAULT '0' NOT NULL,
FPARENTID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDUTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FISQUOTE CHAR(1) DEFAULT '0' NOT NULL,
FISNEGOTIATE CHAR(1) DEFAULT '0' NOT NULL,
FISABANDON CHAR(1) DEFAULT '0' NOT NULL,
FABANDONREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FSUPPLIERTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FISEXEMPT CHAR(1) DEFAULT '0' NOT NULL,
FISPAYDOCFEE CHAR(1) DEFAULT '0' NOT NULL,
FDOCAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISAPTITUDE CHAR(1) DEFAULT '0' NOT NULL,
FAPTITUDENOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISDOWNLOAD CHAR(1) DEFAULT '0' NOT NULL,
FISUPLOAD CHAR(1) DEFAULT '0' NOT NULL,
FISPURAGENT CHAR(1) DEFAULT '0' NOT NULL,
FSUPPLIERCODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FRANK INT DEFAULT 0 NOT NULL,
FISTECOPEN CHAR(1) DEFAULT '0' NOT NULL,
FTECOPENDATE DATETIME,
FTECOPENUSER BIGINT DEFAULT 0 NOT NULL,
FISBIZOPEN CHAR(1) DEFAULT '0' NOT NULL,
FBIZOPENDATE DATETIME,
FBIZOPENUSER BIGINT DEFAULT 0 NOT NULL,
FISAPTOPEN CHAR(1) DEFAULT '0' NOT NULL,
FAPTOPENDATE DATETIME,
FAPTOPENUSER BIGINT DEFAULT 0 NOT NULL,
FISAPTPUSH CHAR(1) DEFAULT '0' NOT NULL,
FISAPTPUSH2 CHAR(1) DEFAULT '0' NOT NULL,
FISBIDPUSH CHAR(1) DEFAULT '0' NOT NULL,
FSUPPLIERIP NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCURRENTRANK INT DEFAULT 0 NOT NULL,
FSUMSCORE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FISBIDPUBLISH CHAR(1) DEFAULT '0' NOT NULL,
FISVIEPUBLISH CHAR(1) DEFAULT '0' NOT NULL,
FBIZAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOUNT INT DEFAULT 0 NOT NULL,
FCOUNT2 INT DEFAULT 0 NOT NULL,
FBIDDERID BIGINT DEFAULT 0 NOT NULL,
FENTRYSUPPLIERIP NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSOURCE CHAR(1) DEFAULT ' ' NOT NULL,
FRISKNUM INT DEFAULT 0 NOT NULL,
FRISKREMARK NVARCHAR(510) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_BIDOPENAPPLY') 
 CREATE TABLE T_SRC_BIDOPENAPPLY (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLDATE DATETIME,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FOPENTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTOPBIDDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FISCONFIRM CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_OPENAPPLY_OPEN') 
 CREATE TABLE T_SRC_OPENAPPLY_OPEN (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPACKAGE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FISTECOPEN CHAR(1) DEFAULT '0' NOT NULL,
FISTECASSESS CHAR(1) DEFAULT '0' NOT NULL,
FISBIZOPEN CHAR(1) DEFAULT '0' NOT NULL,
FTECOPENDATE DATETIME,
FTECASSESSDATE DATETIME,
FBIZOPENDATE DATETIME,
FTECOPENUSER BIGINT DEFAULT 0 NOT NULL,
FBIZOPENUSER BIGINT DEFAULT 0 NOT NULL,
FISNEGOPEN CHAR(1) DEFAULT '0' NOT NULL,
FNEGOPENDATE DATETIME,
FNEGOPENUSER BIGINT DEFAULT 0 NOT NULL,
FISNEGOTIATE CHAR(1) DEFAULT '0' NOT NULL,
FTURNS VARCHAR(2) DEFAULT ' ' NOT NULL,
FPACKFEEITEMID BIGINT DEFAULT 0 NOT NULL,
FFEEAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPACKDOCAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISAPTOPEN CHAR(1) DEFAULT '0' NOT NULL,
FAPTOPENDATE DATETIME,
FAPTOPENUSER BIGINT DEFAULT 0 NOT NULL,
FISBIZASSESS CHAR(1) DEFAULT '0' NOT NULL,
FBIZASSESSDATE DATETIME,
FISAPTASSESS CHAR(1) DEFAULT '0' NOT NULL,
FAPTASSESSDATE DATETIME,
FISAPTASSESS2 CHAR(1) DEFAULT '0' NOT NULL,
FAPTASSESSDATE2 DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_OPENAPPLY_MAN') 
 CREATE TABLE T_SRC_OPENAPPLY_MAN (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FBIZROLEID BIGINT DEFAULT 0 NOT NULL,
FBIDDERID BIGINT DEFAULT 0 NOT NULL,
FDUTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEPTID BIGINT DEFAULT 0 NOT NULL,
FPHONE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FEMAIL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARENTID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISBENIFIT CHAR(1) DEFAULT '0' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISCLARIFY CHAR(1) DEFAULT '0' NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISNOTIFY CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FISSIGNIN CHAR(1) DEFAULT '0' NOT NULL,
FSIGNINTIME DATETIME,
FSRCENTRYID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCLARIFYTIME DATETIME,
FFINISHDATE DATETIME,
FBIDDER1 BIGINT DEFAULT 0 NOT NULL,
FBIDDER2 BIGINT DEFAULT 0 NOT NULL,
FBIDDER3 BIGINT DEFAULT 0 NOT NULL,
FBIDDER4 BIGINT DEFAULT 0 NOT NULL,
FBIDDER5 BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FNEEDMESSAGE CHAR(1) DEFAULT '0' NOT NULL,
FNEEDSIGNIN CHAR(1) DEFAULT '0' NOT NULL
);



/**End C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
