/**Begin C:\PDM_UPGRADE\PDM1\SRM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERCHGENTRY') 
 CREATE TABLE T_PUR_SUPPLIERCHGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINFOTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FCHGFIELD NVARCHAR(200) DEFAULT ' ' NOT NULL,
FOLDVALUE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FNEWVALUE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSRCBILLID VARCHAR(255) DEFAULT ' ' NOT NULL,
FSRCENTRYID VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYFIELDNAME VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLANSCORERSUB') 
 CREATE TABLE T_PUR_EVAPLANSCORERSUB (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_DECLARATIONREF') 
 CREATE TABLE T_PUR_DECLARATIONREF (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FCONTENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTENT_TAG NCLOB,
FCFMSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FISDISPLAY CHAR(1) DEFAULT '1' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INSPECTFIND') 
 CREATE TABLE T_PUR_INSPECTFIND (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINSPECTFINDPRO BIGINT DEFAULT 0 NOT NULL,
FINSPECTFINDTYPE BIGINT DEFAULT 0 NOT NULL,
FINSPECTFINDEXPL NVARCHAR(512) DEFAULT ' ' NOT NULL,
FINSPECTFINDGRADE BIGINT DEFAULT 0 NOT NULL,
FINSPECTFINDPEO BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_AUDITENTRYATT') 
 CREATE TABLE T_PUR_AUDITENTRYATT (
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_PUR_AUDITENTRY') 
 CREATE TABLE T_PUR_AUDITENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINSPECTPROJECT BIGINT DEFAULT 0 NOT NULL,
FINSPECTSCORE DECIMAL(23,2) DEFAULT 0 NOT NULL,
FJUDGERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INSPECT') 
 CREATE TABLE T_PUR_INSPECT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINSPECTSTAFF BIGINT DEFAULT 0 NOT NULL,
FISLEADER CHAR(1) DEFAULT ' ' NOT NULL,
FINSPECTREMARKS NVARCHAR(512) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_ASSESSENTRY') 
 CREATE TABLE T_PUR_ASSESSENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FEVAFACTORCONFIGID BIGINT DEFAULT 0 NOT NULL,
FASSESSCONTENT VARCHAR(255) DEFAULT ' ' NOT NULL,
FEXAMCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FTARGET VARCHAR(255) DEFAULT ' ' NOT NULL,
FISSATISFIED VARCHAR(50) DEFAULT ' ' NOT NULL,
FEXAMREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_RFICONENTRY') 
 CREATE TABLE T_PUR_RFICONENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FRFICONTENTID BIGINT DEFAULT 0 NOT NULL,
FREQUIRED CHAR(1) DEFAULT ' ' NOT NULL,
FRFIDESC NCLOB DEFAULT ' '
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_ISSUERFI') 
 CREATE TABLE T_PUR_ISSUERFI (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) 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,
FSUPPLIERNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLINKMAN NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEMAIL VARCHAR(100) DEFAULT ' ' NOT NULL,
FMAILVALIDITY DATETIME,
FPHONE VARCHAR(30) DEFAULT ' ' NOT NULL,
FBIZTYPEID BIGINT DEFAULT 0 NOT NULL,
FREGSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FCERTIFIAPPLYID BIGINT DEFAULT 0 NOT NULL,
FHAVEREGRFI CHAR(1) DEFAULT ' ' NOT NULL,
FHAVECONFIRM CHAR(1) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMENTRY_ATT') 
 CREATE TABLE T_PUR_SAMENTRY_ATT (
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_PUR_COMPENTRY_FJ') 
 CREATE TABLE T_PUR_COMPENTRY_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_PUR_CONFIGENTRY') 
 CREATE TABLE T_PUR_CONFIGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCOMPONENTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_COMPENTRY') 
 CREATE TABLE T_PUR_COMPENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FINFOMATION NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTITLE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FURL NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPICTURE NVARCHAR(512) DEFAULT ' ' NOT NULL,
PROTAL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPROTAL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FINFORMATION NVARCHAR(512) DEFAULT ' ' NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTHEME CHAR(1) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_COMPONENT') 
 CREATE TABLE T_PUR_COMPONENT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISAUTOPLAY CHAR(1) DEFAULT ' ' NOT NULL,
FDELAY BIGINT DEFAULT 0 NOT NULL,
FSPEED BIGINT DEFAULT 0 NOT NULL,
FORGFIELD BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FMATERIL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FITEMCLASS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FITEMBRANDS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSALEUNIT BIGINT DEFAULT 0 NOT NULL,
FCURRENCYFIELD BIGINT DEFAULT 0 NOT NULL,
FCURRENCYPRICE BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(200) DEFAULT ' ' NOT NULL,
FMULILANGTEXTFIELD NVARCHAR(100) DEFAULT ' ' NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_COMPGROUP') 
 CREATE TABLE T_PUR_COMPGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCOMPOBJECTID VARCHAR(80) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(510) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(510) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_COMPCONFIG') 
 CREATE TABLE T_PUR_COMPCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(80) 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,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(200) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLANSCORER') 
 CREATE TABLE T_PUR_EVAPLANSCORER (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINDEXCLASSID BIGINT DEFAULT 0 NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCHEMESCORER') 
 CREATE TABLE T_PUR_SCHEMESCORER (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINDEXCLASSID BIGINT DEFAULT 0 NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCHEME_CATEGORY') 
 CREATE TABLE T_PUR_SCHEME_CATEGORY (
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_PUR_CAMEMBER') 
 CREATE TABLE T_PUR_CAMEMBER (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FROLEID BIGINT DEFAULT 0 NOT NULL,
FISLEADER CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(512) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCHEME_ORG') 
 CREATE TABLE T_PUR_SCHEME_ORG (
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_PUR_SCOREDETAIL') 
 CREATE TABLE T_PUR_SCOREDETAIL (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FVALUE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FVETO CHAR(1) DEFAULT ' ' NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSCORERSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSCORED CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INDEX_CATEGORY') 
 CREATE TABLE T_PUR_INDEX_CATEGORY (
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_PUR_INDEX_ORG') 
 CREATE TABLE T_PUR_INDEX_ORG (
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_PUR_INDEX_EVATYPE') 
 CREATE TABLE T_PUR_INDEX_EVATYPE (
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_PUR_EXAMINE_L') 
 CREATE TABLE T_PUR_EXAMINE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FSRCBILLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EXAMINE_A') 
 CREATE TABLE T_PUR_EXAMINE_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FCFMOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FAPPROVERID BIGINT DEFAULT 0 NOT NULL,
FAPPROVEDATE DATETIME,
FSRCBILLTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCBILLID VARCHAR(50) DEFAULT ' ' NOT NULL,
FINVALIDID BIGINT DEFAULT 0 NOT NULL,
FINVALIDDATE DATETIME,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EXAMINE') 
 CREATE TABLE T_PUR_EXAMINE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FEXAMTYPEID BIGINT DEFAULT 0 NOT NULL,
FEXAMINERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(510) DEFAULT ' ',
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FCONFIRMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FSRCBILLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCHEMEENTRY') 
 CREATE TABLE T_PUR_SCHEMEENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINDEXID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCHEME_L') 
 CREATE TABLE T_PUR_SCHEME_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCHEME') 
 CREATE TABLE T_PUR_SCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FEVATYPEID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FISORG CHAR(1) DEFAULT ' ' NOT NULL,
FISCATEGORY CHAR(1) DEFAULT ' ' NOT NULL,
FISSCORER CHAR(1) DEFAULT ' ' NOT NULL,
FISTYPESCORER CHAR(1) DEFAULT ' ' NOT NULL,
FISHUNDRED CHAR(1) DEFAULT ' ' NOT NULL,
FPERIOD CHAR(1) DEFAULT ' ' NOT NULL,
FSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT 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,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FSYNSUPGRADE CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCENE_MEMBER') 
 CREATE TABLE T_PUR_SCENE_MEMBER (
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_PUR_SAMPLENOTIFY') 
 CREATE TABLE T_PUR_SAMPLENOTIFY (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENOID BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMPLENOTIFY_A') 
 CREATE TABLE T_PUR_SAMPLENOTIFY_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMPLENOTIFY_E') 
 CREATE TABLE T_PUR_SAMPLENOTIFY_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSENDDATE DATETIME,
FRECEIVER NVARCHAR(20) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSENDQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FARRIVALDATE DATETIME,
FCFMNOTE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMPLENOTIFY_L') 
 CREATE TABLE T_PUR_SAMPLENOTIFY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPCATEGORY') 
 CREATE TABLE T_PUR_SUPCATEGORY (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT '1' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL,
FISSOURCELIST CHAR(1) DEFAULT '0' NOT NULL,
FSYNCHROSOURCELIST CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APTITUDEBANK') 
 CREATE TABLE T_PUR_APTITUDEBANK (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FACCOUNTTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FACCOUNT NVARCHAR(80) DEFAULT ' ' NOT NULL,
FACCOUNTNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBANKID BIGINT DEFAULT 0 NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FISDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APPROVE_A') 
 CREATE TABLE T_PUR_APPROVE_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APPROVEENTRY') 
 CREATE TABLE T_PUR_APPROVEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FCATEGORYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FSAMPLENOID BIGINT DEFAULT 0 NOT NULL,
FTESTRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FTRYNOID BIGINT DEFAULT 0 NOT NULL,
FTRYRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FISSOURCELIST CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APPROVE_L') 
 CREATE TABLE T_PUR_APPROVE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APPROVE') 
 CREATE TABLE T_PUR_APPROVE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENOID BIGINT DEFAULT 0 NOT NULL,
FSCENENOID BIGINT DEFAULT 0 NOT NULL,
FORGSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FCERTIFIAPPLY BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNEXTAUDITOR NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_MATERIAL_A') 
 CREATE TABLE T_PUR_MATERIAL_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_MATERIALENTRY') 
 CREATE TABLE T_PUR_MATERIALENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCOUNT INT DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_MATERIAL_L') 
 CREATE TABLE T_PUR_MATERIAL_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_MATERIAL') 
 CREATE TABLE T_PUR_MATERIAL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENOID BIGINT DEFAULT 0 NOT NULL,
FTRYRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT '1' NOT NULL,
FCERTIFIAPPLYID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNEXTAUDITOR NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMPLE_A') 
 CREATE TABLE T_PUR_SAMPLE_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMPLEENTRY') 
 CREATE TABLE T_PUR_SAMPLEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSENDDATE DATETIME,
FRECEIVER NVARCHAR(20) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSENDQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FARRIVALDATE DATETIME,
FTESTDATE DATETIME,
FTESTER NVARCHAR(20) DEFAULT ' ' NOT NULL,
FTESTRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMPLE_L') 
 CREATE TABLE T_PUR_SAMPLE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SAMPLE') 
 CREATE TABLE T_PUR_SAMPLE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENOID BIGINT DEFAULT 0 NOT NULL,
FNOTIFYNOID BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT '1' NOT NULL,
FCERTIFIAPPLYID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNEXTAUDITOR NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCENE_A') 
 CREATE TABLE T_PUR_SCENE_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FIMPROVEBILLNOID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCENEENTRY') 
 CREATE TABLE T_PUR_SCENEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCENE_L') 
 CREATE TABLE T_PUR_SCENE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCENE') 
 CREATE TABLE T_PUR_SCENE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FEXAMTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDENOID BIGINT DEFAULT 0 NOT NULL,
FSCENENOID BIGINT DEFAULT 0 NOT NULL,
FCHARGEMANID BIGINT DEFAULT 0 NOT NULL,
FSCENESCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FSCENERESULT CHAR(1) DEFAULT ' ' NOT NULL,
FSCENENOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FCAAPPLYID BIGINT DEFAULT 0 NOT NULL,
FAPPLYTYPE CHAR(1) DEFAULT '1' NOT NULL,
FSUPPLIERLINKMAN NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPLINKEMAIL VARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPLINKMOBILE VARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNEXTAUDITOR NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERQUIT_A') 
 CREATE TABLE T_PUR_SUPPLIERQUIT_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERQUITENTRY') 
 CREATE TABLE T_PUR_SUPPLIERQUITENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FQUITORGID BIGINT DEFAULT 0 NOT NULL,
FORGSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FISQUIT CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERQUIT_L') 
 CREATE TABLE T_PUR_SUPPLIERQUIT_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERQUIT') 
 CREATE TABLE T_PUR_SUPPLIERQUIT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FQUITTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CATEGORYCHG_A') 
 CREATE TABLE T_PUR_CATEGORYCHG_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CATEGORYCHGENTRY') 
 CREATE TABLE T_PUR_CATEGORYCHGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FCATEGORYSTATUS_OLD CHAR(1) DEFAULT ' ' NOT NULL,
FCATEGORYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FISSOURCELIST CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CATEGORYCHG_L') 
 CREATE TABLE T_PUR_CATEGORYCHG_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CATEGORYCHG') 
 CREATE TABLE T_PUR_CATEGORYCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FORGSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINITIATOR CHAR(1) DEFAULT '0' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_PERSON_P') 
 CREATE TABLE T_PUR_BLACK_PERSON_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPNUMBER VARCHAR(20) DEFAULT ' ' NOT NULL,
FPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISBLACKLIST CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_PERSON_E') 
 CREATE TABLE T_PUR_BLACK_PERSON_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FENUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISBLACKLIST CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_PERSON_L') 
 CREATE TABLE T_PUR_BLACK_PERSON_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_PERSON') 
 CREATE TABLE T_PUR_BLACK_PERSON (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION VARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK VARCHAR(2000) DEFAULT ' ' NOT NULL,
FISBLACKLIST 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,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FSOURCEID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_COMPANY_P') 
 CREATE TABLE T_PUR_BLACK_COMPANY_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPNUMBER VARCHAR(20) DEFAULT ' ' NOT NULL,
FPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISBLACKLIST CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_COMPANY_E') 
 CREATE TABLE T_PUR_BLACK_COMPANY_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FENUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISBLACKLIST CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_COMPANY_L') 
 CREATE TABLE T_PUR_BLACK_COMPANY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSOURCENAME NVARCHAR(150) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BLACK_COMPANY') 
 CREATE TABLE T_PUR_BLACK_COMPANY (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION VARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK VARCHAR(2000) DEFAULT ' ' NOT NULL,
FISBLACKLIST 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,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FSOURCEID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSOURCENAME NVARCHAR(150) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APTITUDE_A') 
 CREATE TABLE T_PUR_APTITUDE_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APTITUDEENTRY') 
 CREATE TABLE T_PUR_APTITUDEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FORGSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCATEGORYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FORIGINSUPPLIER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISENTER CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FISSOURCELIST CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APTITUDE_L') 
 CREATE TABLE T_PUR_APTITUDE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APTITUDE') 
 CREATE TABLE T_PUR_APTITUDE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FENTERTYPEID BIGINT DEFAULT 0 NOT NULL,
FISSCENE CHAR(1) DEFAULT '0' NOT NULL,
FISSAMPLE CHAR(1) DEFAULT '0' NOT NULL,
FISMATERIAL CHAR(1) DEFAULT '0' NOT NULL,
FISAPPROVE CHAR(1) DEFAULT '0' NOT NULL,
FISCHGFLOW CHAR(1) DEFAULT ' ' NOT NULL,
FISSHOPMALL CHAR(1) DEFAULT ' ' NOT NULL,
FHASSCENE CHAR(1) DEFAULT ' ' NOT NULL,
FHASSAMPLE CHAR(1) DEFAULT ' ' NOT NULL,
FHASMATERIAL CHAR(1) DEFAULT ' ' NOT NULL,
FHASAPPROVE CHAR(1) DEFAULT ' ' NOT NULL,
FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FPAYCONDID BIGINT DEFAULT 0 NOT NULL,
FTAXRATE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FISPURORG CHAR(1) DEFAULT ' ' NOT NULL,
FISCATEGORY CHAR(1) DEFAULT ' ' NOT NULL,
FTAXRATEID BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT '1' NOT NULL,
FCERTIFIAPPLYID BIGINT DEFAULT 0 NOT NULL,
FEXAMRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FRESULTREMARK NCLOB DEFAULT ' ',
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSUPPCOLLA CHAR(1) DEFAULT '0' NOT NULL,
FNEXTAUDITOR NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_USER') 
 CREATE TABLE T_PUR_USER (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FIDCARD VARCHAR(20) DEFAULT ' ' NOT NULL,
FEMAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FDEPTDUTY VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREDITNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FREMARK VARCHAR(255) DEFAULT ' ' NOT NULL,
FPASSWORD VARCHAR(50) 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,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FPHONE VARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTERPRISE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_ENTERTYPE_L') 
 CREATE TABLE T_PUR_ENTERTYPE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_ENTERTYPE') 
 CREATE TABLE T_PUR_ENTERTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FISAPTITUDE CHAR(1) DEFAULT ' ' NOT NULL,
FISSCENE CHAR(1) DEFAULT ' ' NOT NULL,
FISSAMPLE CHAR(1) DEFAULT ' ' NOT NULL,
FISMATERIAL CHAR(1) DEFAULT ' ' NOT NULL,
FISAPPROVE CHAR(1) DEFAULT ' ' NOT NULL,
FISCHGFLOW CHAR(1) 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,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SRMHELP_L') 
 CREATE TABLE T_PUR_SRMHELP_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SRMHELP') 
 CREATE TABLE T_PUR_SRMHELP (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FCONTENT NCLOB,
FCONTENT_TAG NCLOB,
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,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNECESSARYREG CHAR(1) DEFAULT '0' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLANDETAIL') 
 CREATE TABLE T_PUR_EVAPLANDETAIL (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSCORERID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERCHG_A') 
 CREATE TABLE T_PUR_SUPPLIERCHG_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FCFMOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERCHG_L') 
 CREATE TABLE T_PUR_SUPPLIERCHG_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPPLIERCHG') 
 CREATE TABLE T_PUR_SUPPLIERCHG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FMUSTCFM CHAR(1) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLANINDEX') 
 CREATE TABLE T_PUR_EVAPLANINDEX (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FINDEXID BIGINT DEFAULT 0 NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLAN') 
 CREATE TABLE T_PUR_EVAPLAN (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLDATE DATETIME,
FFINISHDATE DATETIME,
FEVATYPEID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FPERIOD CHAR(1) DEFAULT ' ' NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FISTYPESCORER CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FDATETIMEFROM DATETIME,
FDATETIMETO DATETIME,
FEVAMETHOD CHAR(1) DEFAULT 'A' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLAN_A') 
 CREATE TABLE T_PUR_EVAPLAN_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FTERMINATERID BIGINT DEFAULT 0 NOT NULL,
FTERMINATEDATE DATETIME,
FTERMINATION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPUSHNOTICE CHAR(1) DEFAULT '0' NOT NULL,
FPUSHSCORE CHAR(1) DEFAULT '0' NOT NULL,
FSRCBILLTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSRCBILLID VARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLANENTRY') 
 CREATE TABLE T_PUR_EVAPLANENTRY (
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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAPLAN_L') 
 CREATE TABLE T_PUR_EVAPLAN_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_RECRUIT_A') 
 CREATE TABLE T_PUR_RECRUIT_A (
FID BIGINT 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FCFMOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPUSHNOTICE INT DEFAULT 0 NOT NULL,
FPUSH1688 INT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_RECRUITENTRY') 
 CREATE TABLE T_PUR_RECRUITENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORY NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTRADE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FYEARAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_RECRUIT_L') 
 CREATE TABLE T_PUR_RECRUIT_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_RECRUIT') 
 CREATE TABLE T_PUR_RECRUIT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FTITLE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBILLDATE DATETIME,
FENDDATE DATETIME,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPAYCONDID BIGINT DEFAULT 0 NOT NULL,
FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FINVTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FBIZMODEL VARCHAR(50) DEFAULT ' ' NOT NULL,
FCERTIFICATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZADDR NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREGCAPITAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCONTENT NCLOB,
FCONTENT_TAG NCLOB,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INDEXCLASS_L') 
 CREATE TABLE T_PUR_INDEXCLASS_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INDEXCLASS') 
 CREATE TABLE T_PUR_INDEXCLASS (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLOWESTSCORE CHAR(1) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCORE_A') 
 CREATE TABLE T_PUR_SCORE_A (
FID BIGINT 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,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FFEEDBACK NVARCHAR(510) DEFAULT ' ' NOT NULL,
FREVIEWER BIGINT DEFAULT 0 NOT NULL,
FREVIEWDATE DATETIME,
FSUGGESTION NVARCHAR(510) DEFAULT ' ' NOT NULL,
FAPPROVER BIGINT DEFAULT 0 NOT NULL,
FAPPROVEDATE DATETIME,
FAUDITOPINION NVARCHAR(510) DEFAULT ' ' NOT NULL,
FTERMINATERID BIGINT DEFAULT 0 NOT NULL,
FTERMINATEDATE DATETIME,
FTERMINATION NVARCHAR(510) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAGRADE_L') 
 CREATE TABLE T_PUR_EVAGRADE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAGRADE') 
 CREATE TABLE T_PUR_EVAGRADE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FEVATYPEID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FPAYCONDID BIGINT DEFAULT 0 NOT NULL,
FQUOTARATIO DECIMAL(19,6) DEFAULT 0 NOT NULL,
FQUOTAORDER INT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID2 BIGINT 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,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCOREENTRY') 
 CREATE TABLE T_PUR_SCOREENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT 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,
FVETO CHAR(1) DEFAULT ' ' NOT NULL,
FWEIGHT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FFINALSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSCORED CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCORE') 
 CREATE TABLE T_PUR_SCORE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FTASKBILLID BIGINT DEFAULT 0 NOT NULL,
FTASKBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLDATE DATETIME,
FPLANDATE DATETIME,
FFINISHDATE DATETIME,
FEVATYPEID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FPERIOD CHAR(1) DEFAULT ' ' NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FGRADEID BIGINT DEFAULT 0 NOT NULL,
FSUMSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCALGRADEID BIGINT DEFAULT 0 NOT NULL,
FSUPGRADEID BIGINT DEFAULT 0 NOT NULL,
FTRIALRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITGRADEID BIGINT DEFAULT 0 NOT NULL,
FAUDITRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FDATETIMEFROM DATETIME,
FDATETIMETO DATETIME,
FMATERIALID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_GRADENTRY') 
 CREATE TABLE T_PUR_GRADENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID 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,
FEVAGRADEID BIGINT DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INDEXENTRY') 
 CREATE TABLE T_PUR_INDEXENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FITEM NVARCHAR(255) DEFAULT ' ' NOT NULL,
FVALUEFROM DECIMAL(19,6) DEFAULT 0 NOT NULL,
FVALUETO DECIMAL(19,6) DEFAULT 0 NOT NULL,
FITEMSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FFORMULA VARCHAR(100) DEFAULT ' ' NOT NULL,
FVETO CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INDEX') 
 CREATE TABLE T_PUR_INDEX (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FINDEXCLASSID BIGINT DEFAULT 0 NOT NULL,
FINDEXTYPEID BIGINT DEFAULT 0 NOT NULL,
FPROPERTY CHAR(1) DEFAULT ' ' NOT NULL,
FSCORETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FSCORE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FISFORMULA CHAR(1) DEFAULT ' ' NOT NULL,
FISDEDUCT CHAR(1) DEFAULT ' ' NOT NULL,
FISEVATYPE CHAR(1) DEFAULT ' ' NOT NULL,
FISORG CHAR(1) DEFAULT ' ' NOT NULL,
FISCATEGORY CHAR(1) DEFAULT ' ' NOT NULL,
FAPIPLUGIN VARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT 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,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FFORMULAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCORE_L') 
 CREATE TABLE T_PUR_SCORE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_INDEX_L') 
 CREATE TABLE T_PUR_INDEX_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_GRADE_L') 
 CREATE TABLE T_PUR_GRADE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_GRADE') 
 CREATE TABLE T_PUR_GRADE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FSCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FEVATYPEID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT 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,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CALRESULT') 
 CREATE TABLE T_PUR_CALRESULT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSRMINDEX BIGINT DEFAULT 0 NOT NULL,
FCALFORMULA BIGINT DEFAULT 0 NOT NULL,
FEVAPLANID BIGINT DEFAULT 0 NOT NULL,
FEVAPLANNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FEVADIMENSION CHAR(1) DEFAULT ' ' NOT NULL,
FFORMULA NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFORMULATRAN NVARCHAR(1000) DEFAULT ' ' NOT NULL
);



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CALRESULTENTITY') 
 CREATE TABLE T_PUR_CALRESULTENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FSCORETASKID BIGINT DEFAULT 0 NOT NULL,
FINDEXSCOREDETAILID BIGINT DEFAULT 0 NOT NULL,
FRESULT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESULT1 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESULT2 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESULT3 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESULT4 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESULT5 DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPCHGENTRY_ATT') 
 CREATE TABLE T_PUR_SUPCHGENTRY_ATT (
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_PUR_SUPCHGENTRY_CHGATT') 
 CREATE TABLE T_PUR_SUPCHGENTRY_CHGATT (
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_PUR_CALFORMULA') 
 CREATE TABLE T_PUR_CALFORMULA (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFORMULAPREVIEW NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FFORMULA NVARCHAR(500) DEFAULT ' ',
FPLUGINNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCALMETHOD 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,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FISPREINSDATA CHAR(1) DEFAULT '0' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL
);







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