/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RATIOCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_RATIOCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_TIMECHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_TIMECHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_WINNUMCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_WINNUMCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURLIST' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_PURLIST ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_CATEGORYCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_CATEGORYCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DECISIONCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_DECISIONCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_F' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_PROJECT_F ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MONEYCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_MONEYCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_OPENAPPLY' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_OPENAPPLY ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_ORDERCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_ORDERCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PRICECHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_PRICECHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECTEND' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_PROJECTEND ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEME' AND KSQL_COL_NAME IN ('FGRADEID')) 
 ALTER TABLE T_SRC_SCHEME ADD (FGRADEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PURORGCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_PURORGCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FPERIODID')) 
 ALTER TABLE T_SRC_EXPORT ADD (FPERIODID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FMATCHFIELD')) 
 ALTER TABLE T_SRC_EXPORT ADD (FMATCHFIELD INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FPRIORITY')) 
 ALTER TABLE T_SRC_EXPORT ADD (FPRIORITY INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_EXPORT' AND KSQL_COL_NAME IN ('FEVALUATEID')) 
 ALTER TABLE T_SRC_EXPORT ADD (FEVALUATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RESDETAILS' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_RESDETAILS ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMANDCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_DEMANDCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SUPPLIERINVALID' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_SUPPLIERINVALID ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_MATERIALCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_SCHEMECHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_SCHEMECHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_DEMANDQTYCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_DEMANDQTYCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALEND' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_MATERIALEND ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RETENDER' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_RETENDER ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDSCHEMECHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_BIDSCHEMECHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_BIDDOC_CHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_BIDDOC_CHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECTMANCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_PROJECTMANCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECTINFOCHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_PROJECTINFOCHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_RATIOTYPECHG' AND KSQL_COL_NAME IN ('FCOMPBILLNO')) 
 ALTER TABLE T_SRC_RATIOTYPECHG ADD (FCOMPBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_SCHEMEBIZTYPE') 
 CREATE TABLE T_SRC_SCHEMEBIZTYPE (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_SCHEMEPERIOD') 
 CREATE TABLE T_SRC_SCHEMEPERIOD (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATE') 
 CREATE TABLE T_SRC_EVALUATE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIDNAME NVARCHAR(300) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISEVALUATEPUSH CHAR(1) DEFAULT '0' 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,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FMANAGETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FSOURCETYPEID BIGINT DEFAULT 0 NOT NULL,
FSRCTYPEID BIGINT DEFAULT 0 NOT NULL,
FOPENTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FISHIDESUPPLIER CHAR(1) DEFAULT '0' NOT NULL,
FBIZSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPEID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FSCORETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FISCHANGED CHAR(1) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATETPL') 
 CREATE TABLE T_SRC_EVALUATETPL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FCOMPONENTID BIGINT DEFAULT 0 NOT NULL,
FBIZOBJECT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCTPLID NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_GRADE') 
 CREATE TABLE T_SRC_GRADE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(300) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FISV_ID VARCHAR(50) DEFAULT ' ' NOT NULL,
FMATCHFIELD INT DEFAULT 0 NOT NULL,
FPRIORITY INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_GRADEENTRY') 
 CREATE TABLE T_SRC_GRADEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSCOREFROM DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSCORETO DECIMAL(19,6) DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FNOTE VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATECONFIGHEAD') 
 CREATE TABLE T_SRC_EVALUATECONFIGHEAD (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATECONFIG') 
 CREATE TABLE T_SRC_EVALUATECONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FINDEXTYPEID BIGINT DEFAULT 0 NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FGRADESCHEMEID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FTPLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEXPERTCOUNT INT DEFAULT 0 NOT NULL,
FQFILTER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FQFILTER_TAG NCLOB,
FENTRYPARENTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATECONFIG_FJ') 
 CREATE TABLE T_SRC_EVALUATECONFIG_FJ (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATESCORER') 
 CREATE TABLE T_SRC_EVALUATESCORER (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_GRADE_L') 
 CREATE TABLE T_SRC_GRADE_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(300) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATEEXPERTHEAD') 
 CREATE TABLE T_SRC_EVALUATEEXPERTHEAD (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATEEXPERT') 
 CREATE TABLE T_SRC_EVALUATEEXPERT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FNOTE VARCHAR(255) DEFAULT ' ' NOT NULL,
FISEVALUATEPUSH CHAR(1) DEFAULT '0' NOT NULL,
FENTRYPARENTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATEDETAILHEAD') 
 CREATE TABLE T_SRC_EVALUATEDETAILHEAD (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATEOPINIONHEAD') 
 CREATE TABLE T_SRC_EVALUATEOPINIONHEAD (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATEOPINION') 
 CREATE TABLE T_SRC_EVALUATEOPINION (
FID BIGINT DEFAULT 0 NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FSCORETASKID BIGINT DEFAULT 0 NOT NULL,
FSCORERSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISVALID CHAR(1) DEFAULT '0' NOT NULL,
FSUGGESTION NVARCHAR(510) DEFAULT ' ' NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_OPINION_FJ') 
 CREATE TABLE T_SRC_OPINION_FJ (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATERESULTHEAD') 
 CREATE TABLE T_SRC_EVALUATERESULTHEAD (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATERESULT') 
 CREATE TABLE T_SRC_EVALUATERESULT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FENTRYPARENTID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSCORETASKID BIGINT DEFAULT 0 NOT NULL,
FINPUTSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISAPTITUDE CHAR(1) DEFAULT '1' NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATETASK') 
 CREATE TABLE T_SRC_EVALUATETASK (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) 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,
FBILLDATE DATETIME,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FBIZSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FSUMSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINDEXTYPEID BIGINT DEFAULT 0 NOT NULL,
FFINISHDATE DATETIME,
FINPUTSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCORETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FBILLINDEXSCORE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEXPERTTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FISVALID CHAR(1) DEFAULT '0' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMINVALUE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISAPTITUDE CHAR(1) DEFAULT '0' NOT NULL,
FISAPTITUDE2 CHAR(1) DEFAULT '0' NOT NULL,
FBASETYPE CHAR(1) DEFAULT '1' NOT NULL,
FSUPPLIERCODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCENTRYID BIGINT DEFAULT 0 NOT NULL,
FBIZSTATUS2 CHAR(1) DEFAULT ' ' NOT NULL,
FPURLISTID BIGINT DEFAULT 0 NOT NULL,
FGRADESCHEMEID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATEENTRY') 
 CREATE TABLE T_SRC_EVALUATEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINDEXID BIGINT DEFAULT 0 NOT NULL,
FSYSSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMANSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FFINALSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSCORED CHAR(1) DEFAULT ' ' NOT NULL,
FINDEXDIMENSION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEXRULE NVARCHAR(1020) DEFAULT ' ' NOT NULL,
FISTHRESHOLD CHAR(1) DEFAULT '0' NOT NULL,
FTHRESHOLD DECIMAL(19,6) DEFAULT 0 NOT NULL,
FISVETO CHAR(1) DEFAULT '0' NOT NULL,
FINDEXLIBID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_EVALUATEDETAIL') 
 CREATE TABLE T_SRC_EVALUATEDETAIL (
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 VARCHAR(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 NVARCHAR(30) 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(100) DEFAULT ' ' NOT NULL,
FPURLISTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_DEMANDSUPPLIER') 
 CREATE TABLE T_SRC_DEMANDSUPPLIER (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FSUPNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLINKMAN NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDUTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISPURAGENT CHAR(1) DEFAULT '0' NOT NULL,
FSOCIETYCREDITCODE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPPLIERTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);



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