/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER' AND KSQL_COL_NAME IN ('FISFEEAGENT')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FISFEEAGENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER_TEMP' AND KSQL_COL_NAME IN ('FISFEEAGENT')) 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FISFEEAGENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PAYMENTENTRY' AND KSQL_COL_NAME IN ('FISFEEAGENT')) 
 ALTER TABLE T_SRC_PAYMENTENTRY ADD (FISFEEAGENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_FEECONFIGCHG') 
 CREATE TABLE T_SRC_FEECONFIGCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FCHGSRCBILLID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FBIDCHANGEID BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(510) DEFAULT ' ' NOT NULL,
FFEEWAYID BIGINT DEFAULT 0 NOT NULL,
FFEEITEMID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FFEEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDOCAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_FEECONFIGCHGENTRY') 
 CREATE TABLE T_SRC_FEECONFIGCHGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FPACKFEEITEMID BIGINT DEFAULT 0 NOT NULL,
FFEEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPACKDOCAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_SCORERETURN') 
 CREATE TABLE T_SRC_SCORERETURN (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FVALUE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORERWEIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORERSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORED CHAR(1) DEFAULT '0' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAVERAGE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVALID CHAR(1) DEFAULT '0' NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FINDEXSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISVETO CHAR(1) DEFAULT '0' NOT NULL,
FVETO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FORIGNCREATOR BIGINT DEFAULT 0 NOT NULL,
FISOVERTHRESHOLD CHAR(1) DEFAULT '0' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FISAUTOSCORE CHAR(1) DEFAULT '0' NOT NULL,
FINDEXID BIGINT DEFAULT 0 NOT NULL,
FSRCENTRYID BIGINT DEFAULT 0 NOT NULL,
FISFITTED CHAR(1) DEFAULT '0' NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPPLIERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPURLISTID BIGINT DEFAULT 0 NOT NULL,
FAGENTID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATERETURN') 
 CREATE TABLE T_SRC_EVALUATERETURN (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FVALUE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORERWEIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORERSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORED CHAR(1) DEFAULT '0' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAVERAGE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVALID CHAR(1) DEFAULT '0' NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FINDEXSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISVETO CHAR(1) DEFAULT '0' NOT NULL,
FVETO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FISOVERTHRESHOLD CHAR(1) DEFAULT '0' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FISAUTOSCORE CHAR(1) DEFAULT '0' NOT NULL,
FINDEXID BIGINT DEFAULT 0 NOT NULL,
FSRCENTRYID BIGINT DEFAULT 0 NOT NULL,
FISFITTED CHAR(1) DEFAULT '0' NOT NULL,
FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPPLIERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPURLISTID BIGINT DEFAULT 0 NOT NULL,
FAGENTID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME
);



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