/**Begin C:\PDM_UPGRADE\PDM1\PBD_table.sql **/


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CERTIFIAPPLY') 
 CREATE TABLE T_PUR_CERTIFIAPPLY (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(80) 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,
FBIZTYPEID BIGINT DEFAULT 0 NOT NULL,
FOPERGROUPID BIGINT DEFAULT 0 NOT NULL,
FHAVEISSUE CHAR(1) DEFAULT ' ' NOT NULL,
FPROJECTNAME NVARCHAR(512) DEFAULT ' ',
FCERTIFICATIONBACKGROUND NCLOB DEFAULT ' ',
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_REGSUPGOODS') 
 CREATE TABLE T_PUR_REGSUPGOODS (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMODEL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMONTHLYCAPACITY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FYEARCAPACITY NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SUPBIZPERSON') 
 CREATE TABLE T_PUR_SUPBIZPERSON (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZSCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) 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,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FSUPGROUPID BIGINT DEFAULT 0 NOT NULL,
FSCPUSERID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPPLIER') 
 CREATE TABLE T_PUR_REGSUPPLIER (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FCENTRALPURTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FINDUSTRYID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBIZREGISTERNO NVARCHAR(60) DEFAULT ' ' NOT NULL,
FTXREGISTERNO NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSOCIETYCREDITCODE NVARCHAR(60) DEFAULT ' ' NOT NULL,
FORGCODE NVARCHAR(60) DEFAULT ' ' NOT NULL,
FREGCAPITAL DECIMAL(19,6) DEFAULT 0 NOT NULL,
FREGDATE DATETIME,
FCOUNTRYID BIGINT DEFAULT 0 NOT NULL,
FAREACODEID BIGINT DEFAULT 0 NOT NULL,
FAREACODE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTELEPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMPLAINTEL VARCHAR(50) DEFAULT ' ' NOT NULL,
FFAX VARCHAR(50) DEFAULT ' ' NOT NULL,
FPOST VARCHAR(10) DEFAULT ' ' NOT NULL,
FEMAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FURL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXCLASS CHAR(1) DEFAULT ' ' NOT NULL,
FTAXKIND CHAR(1) DEFAULT ' ' NOT NULL,
FTAXCODE CHAR(1) DEFAULT ' ' NOT NULL,
FTAXRATE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FTAXTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FINVOICETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FDEDUCTIBLE CHAR(1) DEFAULT ' ' NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL,
FPAYCONDID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS1 CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS2 CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS3 CHAR(1) DEFAULT ' ' NOT NULL,
FAUDITSTATUS4 CHAR(1) DEFAULT ' ' NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FTAXRATEID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FINVOICETYPEID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FARTIFICIALPERSON NVARCHAR(60) DEFAULT ' ' NOT NULL,
FREGADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLINKMAN 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_BASECONFIGENTRY') 
 CREATE TABLE T_PUR_BASECONFIGENTRY (
FSEQ BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FGUESTBASEDATANO VARCHAR(30) DEFAULT ' ' NOT NULL,
FSOURCEBASEDATANO VARCHAR(30) DEFAULT ' ' NOT NULL,
FISENTRYFIELD CHAR(1) DEFAULT '0' NOT NULL,
FENTRYNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FSELECTS VARCHAR(512) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FISMULTIPLE CHAR(1) DEFAULT '0' NOT NULL,
FCUSTOMDATASOURCE VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_PBDBASEDATACONFIG') 
 CREATE TABLE T_PUR_PBDBASEDATACONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) 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,
FMAINENTITY VARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL
);



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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_HANDLERESULTENTRY') 
 CREATE TABLE T_PUR_HANDLERESULTENTRY (
FSEQ BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FTASKID BIGINT DEFAULT 0 NOT NULL,
FSUBSTARTTIME DATETIME,
FSUBTIME BIGINT DEFAULT 0 NOT NULL,
FSUBSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FDETAIL NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCDATARESULT') 
 CREATE TABLE T_PUR_SCDATARESULT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS 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,
FTASKID BIGINT DEFAULT 0 NOT NULL,
FSTARTTIME DATETIME,
FTIME BIGINT DEFAULT 0 NOT NULL,
FPROGRESS BIGINT DEFAULT 0 NOT NULL,
FEXECUTORID BIGINT DEFAULT 0 NOT NULL,
FCONTEXT NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FSOURCEBILLID VARCHAR(30) DEFAULT ' ' NOT NULL,
FSOURCEBILLTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_TASKCONFIG') 
 CREATE TABLE T_PUR_TASKCONFIG (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTASKID BIGINT DEFAULT 0 NOT NULL,
FVALID CHAR(1) DEFAULT '1' NOT NULL,
FSUBSORT BIGINT DEFAULT 0 NOT NULL,
FPERCENT BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SCDATASET') 
 CREATE TABLE T_PUR_SCDATASET (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FISPRE CHAR(1) DEFAULT '0' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_DATAHANDLETASK') 
 CREATE TABLE T_PUR_DATAHANDLETASK (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FPARAM VARCHAR(255) DEFAULT ' ' NOT NULL,
FCLASSNAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FISPRE CHAR(1) DEFAULT '0' NOT NULL,
FCANDISABLE CHAR(1) DEFAULT '1' NOT NULL,
FISDISPLAY CHAR(1) DEFAULT '1' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL
);



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPCONTRACT_ATT') 
 CREATE TABLE T_PUR_REGSUPCONTRACT_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_MGATT') 
 CREATE TABLE T_PUR_MGATT (
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_TARGETANDCATEGORY') 
 CREATE TABLE T_PUR_TARGETANDCATEGORY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FTARGET VARCHAR(512) DEFAULT ' ' NOT NULL,
FCATEGORYNOTE NCLOB DEFAULT ' '
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CONTENTCONFIG_L') 
 CREATE TABLE T_PUR_CONTENTCONFIG_L (
FPKID VARCHAR(20) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(512) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CONTENTCONFIG') 
 CREATE TABLE T_PUR_CONTENTCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(50) 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,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FBIZTYPEID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(512) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAFACTOR_L') 
 CREATE TABLE T_PUR_EVAFACTOR_L (
FPKID VARCHAR(20) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EVAFACTOR') 
 CREATE TABLE T_PUR_EVAFACTOR (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) 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,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FASSESS VARCHAR(512) DEFAULT ' ' NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APTITUDESTDCONFIG') 
 CREATE TABLE T_PUR_APTITUDESTDCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) 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,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FEVAFACTORCONFIGID BIGINT DEFAULT 0 NOT NULL,
FASSESSCONTENT NVARCHAR(512) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_RFICONTENT_L') 
 CREATE TABLE T_PUR_RFICONTENT_L (
FPKID VARCHAR(20) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(20) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_RFICONTENT') 
 CREATE TABLE T_PUR_RFICONTENT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) 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,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FSEQNUMBER VARCHAR(10) DEFAULT ' ' NOT NULL,
FPAGENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FPAGENAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FISPUBLIC CHAR(1) DEFAULT ' ' NOT NULL,
FPRESET CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPPLIER_C') 
 CREATE TABLE T_PUR_REGSUPPLIER_C (
FID BIGINT DEFAULT 0 NOT NULL,
FCERTIFIAPPLYID BIGINT DEFAULT 0 NOT NULL,
FISSUERFIID VARCHAR(80) DEFAULT ' ' NOT NULL,
FDUNSNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPNAMEEN VARCHAR(255) DEFAULT ' ' NOT NULL,
FTAXREGISTREDADS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTERPRISETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FTECHNICIANNUM DECIMAL(19) DEFAULT 0 NOT NULL,
FQUALITYSTAFFNUM DECIMAL(19) DEFAULT 0 NOT NULL,
FMANAGECUR BIGINT DEFAULT 0 NOT NULL,
FMANAGEMENTSTAFF DECIMAL(19) DEFAULT 0 NOT NULL,
FTYEAR NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLASTYEAR NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBEFOREYEAR NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESIGNCAPACITY CHAR(1) DEFAULT ' ' NOT NULL,
FSTANDCAPACITY CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSTOCK') 
 CREATE TABLE T_PUR_REGSTOCK (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSTOCKNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTOCKRATIO DECIMAL(19,6) DEFAULT 0.0 NOT NULL,
FNATIONALITY BIGINT DEFAULT 0 NOT NULL,
FSTOCKLEVEL CHAR(1) DEFAULT ' ' NOT NULL,
FSTOCKREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUCUSTOMER') 
 CREATE TABLE T_PUR_REGSUCUSTOMER (
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FTOPCUSTOMER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTRADEVOLUME DECIMAL(19,6) DEFAULT 0.0 NOT NULL,
FTRADECUR BIGINT DEFAULT 0 NOT NULL,
FCOOPERATSCOPE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGCORESTAFF') 
 CREATE TABLE T_PUR_REGCORESTAFF (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCORESTAFFNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCORESTAFFPOST NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCORESNATIONALITY BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_PRODUCT') 
 CREATE TABLE T_PUR_PRODUCT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPRODUCTOOLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FPRODUCTOOLNUM DECIMAL(19) DEFAULT 0 NOT NULL,
FPRODUCTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTAFFNUMS DECIMAL(19) DEFAULT 0 NOT NULL,
FQESTAFFNUMS DECIMAL(19) DEFAULT 0 NOT NULL,
FPUTDATE DATETIME,
FCYCLE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FTRAFFIC NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPAPTITUDE_FJ') 
 CREATE TABLE T_PUR_REGSUPAPTITUDE_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_APISCHEMEENTRY') 
 CREATE TABLE T_PUR_APISCHEMEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FISENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FEXTAPIID BIGINT DEFAULT 0 NOT NULL,
FAPIPLUGIN VARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APISCHEME') 
 CREATE TABLE T_PUR_APISCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
MASTERID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EXTAPIENTRY') 
 CREATE TABLE T_PUR_EXTAPIENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FISENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FBILLFORM VARCHAR(80) DEFAULT ' ' NOT NULL,
FENTITYOPERATE VARCHAR(80) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BASEDATALINK') 
 CREATE TABLE T_PUR_BASEDATALINK (
FID BIGINT DEFAULT 0 NOT NULL,
FSRCBASEDATA NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESTBASEDATA NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBASEDATATYPE NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_QUALITY_MAT') 
 CREATE TABLE T_PUR_QUALITY_MAT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMODEL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPMODEL_NEW NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPMODEL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPNAME_NEW NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_QUALITY_EQUIP') 
 CREATE TABLE T_PUR_QUALITY_EQUIP (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEQUIP1 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEQUIP5 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEQUIP2 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPPLIER2 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPPLIER3 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPPLIER1 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPPLIER4 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEQUIP3 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSUPPLIER5 NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEQUIP4 NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_QUALITY_TECH') 
 CREATE TABLE T_PUR_QUALITY_TECH (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FPROCESS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_QUALITY_MANAGE') 
 CREATE TABLE T_PUR_QUALITY_MANAGE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTYPEID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FAUDITORG NVARCHAR(100) DEFAULT ' ' NOT NULL,
FAUDITDATE DATETIME,
FDATETO DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_QUALITY_LINK') 
 CREATE TABLE T_PUR_QUALITY_LINK (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FGENDER CHAR(1) DEFAULT ' ' NOT NULL,
FDEPT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDUTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZSCOPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMOBILE VARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FFAX VARCHAR(50) DEFAULT ' ' NOT NULL,
FPOST VARCHAR(10) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISDEFAULT CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_QUALITY_L') 
 CREATE TABLE T_PUR_QUALITY_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_QUALITY_A') 
 CREATE TABLE T_PUR_QUALITY_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_QUALITY') 
 CREATE TABLE T_PUR_QUALITY (
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,
FCHGTYPEID BIGINT DEFAULT 0 NOT NULL,
FSUBJECT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FCATEGORYID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FBILLSTATUS 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_IMPROVE_L') 
 CREATE TABLE T_PUR_IMPROVE_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(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_IMPROVE_A') 
 CREATE TABLE T_PUR_IMPROVE_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,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FHANDLERID BIGINT DEFAULT 0 NOT NULL,
FHANDLEDATE DATETIME,
FORIGIN CHAR(1) 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,
FINVALIDDATE DATETIME,
FINVALIDID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_IMPROVE') 
 CREATE TABLE T_PUR_IMPROVE (
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,
FLINKMANID BIGINT DEFAULT 0 NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FIMPROVETYPEID BIGINT DEFAULT 0 NOT NULL,
FSUBJECT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREPLYDATE DATETIME,
FENDDATE DATETIME,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(510) DEFAULT ' ',
FQUALITY NVARCHAR(510) DEFAULT ' ',
FSERVICE NVARCHAR(510) DEFAULT ' ',
FOTHER NVARCHAR(510) DEFAULT ' ',
FSUPQUALITY NVARCHAR(510) DEFAULT ' ',
FSUPSERVICE NVARCHAR(510) DEFAULT ' ',
FSUPOTHER NVARCHAR(510) DEFAULT ' ',
FSUPREPLY 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,
FFINISHSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FEXPECTDATE DATETIME,
FFINISHDATE DATETIME,
FCONFIRMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FSRCBILLNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FLASTUPDATEUSERID BIGINT DEFAULT 0 NOT NULL,
FLASTUPDATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EXTDATA_L') 
 CREATE TABLE T_PUR_EXTDATA_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_EXTDATA') 
 CREATE TABLE T_PUR_EXTDATA (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FGROUPID 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,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FOBJECTID VARCHAR(30) DEFAULT ' ' NOT NULL,
FISSYSPRESET CHAR(1) 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_EXTTYPE_L') 
 CREATE TABLE T_PUR_EXTTYPE_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_EXTTYPE') 
 CREATE TABLE T_PUR_EXTTYPE (
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,
FOBJECTID VARCHAR(30) 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_APISERVICE_L') 
 CREATE TABLE T_PUR_APISERVICE_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_APISERVICE') 
 CREATE TABLE T_PUR_APISERVICE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSERVICENAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FAPIOPID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
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,
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_APIPLUGINCONFIG_L') 
 CREATE TABLE T_PUR_APIPLUGINCONFIG_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_APIPLUGINCONFIG') 
 CREATE TABLE T_PUR_APIPLUGINCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FPLUGIN VARCHAR(100) DEFAULT ' ' NOT NULL,
FAPINAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FENABLELOG CHAR(1) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID 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,
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_BIZPERSON_CREATOR') 
 CREATE TABLE T_PUR_BIZPERSON_CREATOR (
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_BIZPERSON_PRODCLASS') 
 CREATE TABLE T_PUR_BIZPERSON_PRODCLASS (
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_BIZPERSON_SUPCLASS') 
 CREATE TABLE T_PUR_BIZPERSON_SUPCLASS (
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_CHKSCHEME_INV') 
 CREATE TABLE T_PUR_CHKSCHEME_INV (
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_CHKSCHEME_RCV') 
 CREATE TABLE T_PUR_CHKSCHEME_RCV (
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_SUPBIZ_SETORG') 
 CREATE TABLE T_PUR_SUPBIZ_SETORG (
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_SUPBIZ_RCVORG') 
 CREATE TABLE T_PUR_SUPBIZ_RCVORG (
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_SUPBIZ_PURORG') 
 CREATE TABLE T_PUR_SUPBIZ_PURORG (
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_REGSUPAUDIT') 
 CREATE TABLE T_PUR_REGSUPAUDIT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FEXAMTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FEXAMTIME DATETIME,
FEXAMERID BIGINT DEFAULT 0 NOT NULL,
FEXAMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FEXAMNOTE NVARCHAR(510) DEFAULT ' ' NOT NULL,
FSRCTYPE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FSRCBILLID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPAWARD') 
 CREATE TABLE T_PUR_REGSUPAWARD (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FAWARDORG NVARCHAR(100) DEFAULT ' ' NOT NULL,
FAWARDNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FAWARDRANK NVARCHAR(20) DEFAULT ' ' NOT NULL,
FAWARDDATE DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPCONTRACT') 
 CREATE TABLE T_PUR_REGSUPCONTRACT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCUSTOMER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCONNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCONDATE DATETIME,
FCONAMOUNT 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_REGSUPINDEX') 
 CREATE TABLE T_PUR_REGSUPINDEX (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FYEAR NVARCHAR(10) DEFAULT ' ' NOT NULL,
FVALUE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FUNIT NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_PROJECT_TRACE') 
 CREATE TABLE T_PUR_PROJECT_TRACE (
FID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FTRACEID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_APILOG') 
 CREATE TABLE T_PUR_APILOG (
FID BIGINT DEFAULT 0 NOT NULL,
FAPICONFIGID BIGINT DEFAULT 0 NOT NULL,
FINTERFACE VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FINPUTDATA NCLOB,
FINPUTDATA_TAG NCLOB,
FOUTPUTDATA NCLOB,
FOUTPUTDATA_TAG NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPPLIER_A') 
 CREATE TABLE T_PUR_REGSUPPLIER_A (
FID 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,
FCFMID BIGINT DEFAULT 0 NOT NULL,
FCFMDATE DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPUSHSUPPLIER INT DEFAULT 0 NOT NULL,
FRECRUITNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCREDITRATE CHAR(1) DEFAULT ' ' NOT NULL,
FSTAFFNUM INT DEFAULT 0 NOT NULL,
FISLISTEDCO CHAR(1) DEFAULT ' ' NOT NULL,
FLISTEDADDR NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLISTEDDATE DATETIME,
FSUMMARY NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FBIZSCOPE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FADVANTAGE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FIDCARD NVARCHAR(20) DEFAULT ' ' NOT NULL,
FAUDITOPINION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FARTIFICIALPERSON NVARCHAR(60) DEFAULT ' ' NOT NULL,
FREGADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLINKMAN NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXECUTERESULT CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPAPTITUDE') 
 CREATE TABLE T_PUR_REGSUPAPTITUDE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSUEORG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FGRADE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FISSUEDATE DATETIME,
FDATETO DATETIME,
FCHECKDATE DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOMPANYTYPEID BIGINT DEFAULT 0 NOT NULL,
FAPTITUDETYPEID BIGINT DEFAULT 0 NOT NULL,
FREQUIRED CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_EXTUSER_L') 
 CREATE TABLE T_PUR_EXTUSER_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_EXTUSER') 
 CREATE TABLE T_PUR_EXTUSER (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FPASSWORD VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' 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,
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_ADJUSTENTRY_A') 
 CREATE TABLE T_PUR_ADJUSTENTRY_A (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FGOODSID BIGINT DEFAULT 0 NOT NULL,
FGOODSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FQTYOLD DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPRICEOLD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXPRICEOLD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXRATEOLD DECIMAL(19,6) DEFAULT 0 NOT NULL,
FLOWPRICEOLD DECIMAL(19,6) DEFAULT 0 NOT NULL,
FUPPRICEOLD DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMINORDERQTYOLD DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDATEFROMOLD DATETIME,
FDATETOOLD DATETIME,
FSRCENTRYID VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_ADJUST_A') 
 CREATE TABLE T_PUR_ADJUST_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,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BIZPERSONENTRY') 
 CREATE TABLE T_PUR_BIZPERSONENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FCONTACTERID BIGINT DEFAULT 0 NOT NULL,
FBIZSCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FFORBID CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CHKSCHEME_A') 
 CREATE TABLE T_PUR_CHKSCHEME_A (
FID 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,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_PRICE_SUP') 
 CREATE TABLE T_PUR_PRICE_SUP (
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_PRICE_RCV') 
 CREATE TABLE T_PUR_PRICE_RCV (
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_PRICE_ORG') 
 CREATE TABLE T_PUR_PRICE_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_DISCOUNT_PRI') 
 CREATE TABLE T_PUR_DISCOUNT_PRI (
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_DISCOUNT_RCV') 
 CREATE TABLE T_PUR_DISCOUNT_RCV (
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_DISCOUNT_SUP') 
 CREATE TABLE T_PUR_DISCOUNT_SUP (
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_DISCOUNT_ORG') 
 CREATE TABLE T_PUR_DISCOUNT_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_BIZPERSON_WHA') 
 CREATE TABLE T_PUR_BIZPERSON_WHA (
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_BIZPERSON_MAT') 
 CREATE TABLE T_PUR_BIZPERSON_MAT (
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_BIZPERSON_SUP') 
 CREATE TABLE T_PUR_BIZPERSON_SUP (
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_BIZPERSON_ORG') 
 CREATE TABLE T_PUR_BIZPERSON_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_APICONFIG_L') 
 CREATE TABLE T_PUR_APICONFIG_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_APICONFIG') 
 CREATE TABLE T_PUR_APICONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSYSTEM CHAR(1) DEFAULT ' ' NOT NULL,
FIP VARCHAR(100) DEFAULT ' ' NOT NULL,
FPORT VARCHAR(50) DEFAULT ' ' NOT NULL,
FDBNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FLANGUAGE CHAR(1) DEFAULT ' ' NOT NULL,
FUSERNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FPASSWORD VARCHAR(50) DEFAULT ' ' NOT NULL,
FLICENSE VARCHAR(100) DEFAULT ' ' NOT NULL,
FCLIENT_ID VARCHAR(50) DEFAULT ' ' NOT NULL,
FCLIENT_SECRET VARCHAR(50) DEFAULT ' ' NOT NULL,
FTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FENABLELOG CHAR(1) DEFAULT ' ' NOT NULL,
FISLOCK CHAR(1) DEFAULT ' ' NOT NULL,
FENABLECACHE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID 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,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNUSER CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNUNITGROUP CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNUNIT CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNCURRENCY CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNSETTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNPAYCOND CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNSUPGROUP CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNSUPPLIER CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNMATGROUP CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNMATERIAL CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNBIZGROUP CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNBIZPERSON CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNWAREHOUSE CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNLOCATION CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNLOT CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNORG CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNPROJECT CHAR(1) DEFAULT ' ' NOT NULL,
FISSYNTRACE 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_TRACE_L') 
 CREATE TABLE T_PUR_TRACE_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_TRACE') 
 CREATE TABLE T_PUR_TRACE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' 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,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FPROJECTID 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_PROJECT_L') 
 CREATE TABLE T_PUR_PROJECT_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_PROJECT') 
 CREATE TABLE T_PUR_PROJECT (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' 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,
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_LOCATION_L') 
 CREATE TABLE T_PUR_LOCATION_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_LOCATION') 
 CREATE TABLE T_PUR_LOCATION (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FWAREHOUSEID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' 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,
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_LOGSUPPLIER_L') 
 CREATE TABLE T_PUR_LOGSUPPLIER_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_LOGSUPPLIER') 
 CREATE TABLE T_PUR_LOGSUPPLIER (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' 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,
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_CHKSCHEME_MAT') 
 CREATE TABLE T_PUR_CHKSCHEME_MAT (
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_CHKSCHEME_ORG') 
 CREATE TABLE T_PUR_CHKSCHEME_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_CHKSCHEME') 
 CREATE TABLE T_PUR_CHKSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FDATETO INT DEFAULT 0 NOT NULL,
FSETTLEORG CHAR(1) DEFAULT ' ' NOT NULL,
FRCVORG CHAR(1) DEFAULT ' ' NOT NULL,
FCURRENCY CHAR(1) DEFAULT ' ' NOT NULL,
FTAXRATE CHAR(1) DEFAULT ' ' NOT NULL,
FSALBILLNO CHAR(1) DEFAULT ' ' NOT NULL,
FPROJECT CHAR(1) DEFAULT ' ' NOT NULL,
FGOODS CHAR(1) DEFAULT ' ' NOT NULL,
FPOBILLNO CHAR(1) DEFAULT ' ' NOT NULL,
FMATERIAL CHAR(1) DEFAULT ' ' NOT NULL,
FUNIT CHAR(1) DEFAULT ' ' NOT NULL,
FASSTATTRIB CHAR(1) DEFAULT ' ' NOT NULL,
FPOENTRYID CHAR(1) DEFAULT ' ' NOT NULL,
FNODIFFTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FDIFFTREATTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FDIFFTREATTYPE1 CHAR(1) DEFAULT ' ' NOT NULL,
FDIFFTREATTYPE2 CHAR(1) DEFAULT ' ' NOT NULL,
FAUTOCFM CHAR(1) DEFAULT ' ' NOT NULL,
FDATASRC1 CHAR(1) DEFAULT ' ' NOT NULL,
FDATASRC2 CHAR(1) DEFAULT ' ' NOT NULL,
FHAVEFINISH CHAR(1) DEFAULT ' ' NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FSUMUPAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FUPAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FINVTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FINVDETAIL CHAR(1) DEFAULT ' ' NOT NULL,
FINVUPAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FINVSEQ NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FORGSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE 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_CHKSCHEME_L') 
 CREATE TABLE T_PUR_CHKSCHEME_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_BIZGROUP_L') 
 CREATE TABLE T_PUR_BIZGROUP_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_BIZGROUP') 
 CREATE TABLE T_PUR_BIZGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FLONGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FISLEAF 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,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 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_REGSUPBANK') 
 CREATE TABLE T_PUR_REGSUPBANK (
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(100) DEFAULT ' ' NOT NULL,
FACCOUNTNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBANKID BIGINT DEFAULT 0 NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISDEFAULT CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPLINK') 
 CREATE TABLE T_PUR_REGSUPLINK (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FGENDER CHAR(1) DEFAULT ' ' NOT NULL,
FDEPT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDUTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZSCOPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMOBILE VARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FFAX VARCHAR(50) DEFAULT ' ' NOT NULL,
FPOST VARCHAR(10) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FBIZSCOPETYPE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPPLIER_L') 
 CREATE TABLE T_PUR_REGSUPPLIER_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,
FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FARTIFICIALPERSON NVARCHAR(60) DEFAULT ' ' NOT NULL,
FREGADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLINKMAN NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_BIZPERSON') 
 CREATE TABLE T_PUR_BIZPERSON (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZSCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FPHONE VARCHAR(50) DEFAULT ' ' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID 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,
FPERSON BIGINT DEFAULT 0 NOT NULL,
FCREATORCONTROL CHAR(1) DEFAULT '1' NOT NULL,
FORGCONTROL CHAR(1) DEFAULT '1' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_LOT_L') 
 CREATE TABLE T_PUR_LOT_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_WAREHOUSE_L') 
 CREATE TABLE T_PUR_WAREHOUSE_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,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_LOT') 
 CREATE TABLE T_PUR_LOT (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FMATERIALDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FASSTPROID VARCHAR(50) DEFAULT ' ' NOT NULL,
FINSTOCKDATE DATETIME,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPLOT NVARCHAR(80) DEFAULT ' ' NOT NULL,
FGOODSID BIGINT DEFAULT 0 NOT NULL,
FGOODSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' 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,
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_WAREHOUSE') 
 CREATE TABLE T_PUR_WAREHOUSE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FREGIONID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' 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,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SOURCE_ORG') 
 CREATE TABLE T_PUR_SOURCE_ORG (
FPKID VARCHAR(36) DEFAULT ' ' 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_ITEM') 
 CREATE TABLE T_PUR_ITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FTYPEID BIGINT DEFAULT 0 NOT NULL,
FSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) 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,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTENT NVARCHAR(500) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_PRICE_L') 
 CREATE TABLE T_PUR_PRICE_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_SOURCENTRY') 
 CREATE TABLE T_PUR_SOURCENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FMATERIALDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FASSTPROID VARCHAR(50) DEFAULT ' ' NOT NULL,
FGOODSID BIGINT DEFAULT 0 NOT NULL,
FGOODSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMATCLASSID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FQUOTARATIO DECIMAL(19,6) DEFAULT 0 NOT NULL,
FQUOTAORDER INT DEFAULT 0 NOT NULL,
FISPRIMARY CHAR(1) DEFAULT ' ' NOT NULL,
FMINPACKQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMINORDERQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMAXORDERQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FTOTALORDQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPURLEADDAY INT DEFAULT 0 NOT NULL,
FTAXRATE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPAYCONDID BIGINT DEFAULT 0 NOT NULL,
FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SOURCE') 
 CREATE TABLE T_PUR_SOURCE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLDATE DATETIME,
FPURORGSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FBIZTYPESCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) 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,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FCOMPARENO NVARCHAR(80) 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_ADJUSTENTRY') 
 CREATE TABLE T_PUR_ADJUSTENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPRICEID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FMATERIALDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FASSTPROID VARCHAR(50) DEFAULT ' ' NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FQTYTO DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FADJRANGE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FTAXRATE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FLOWPRICE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FUPPRICE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FMINORDERQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_ADJUST') 
 CREATE TABLE T_PUR_ADJUST (
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,
FADJREASONID INT DEFAULT 0 NOT NULL,
FBIZTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCFMSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBIZPARTNERID BIGINT DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_DISCOUNTENTRY') 
 CREATE TABLE T_PUR_DISCOUNTENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FMATERIALDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FASSTPROID VARCHAR(50) DEFAULT ' ' NOT NULL,
FMATCLASSID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FDCTBASIS CHAR(1) DEFAULT ' ' NOT NULL,
FQTYAMTTO DECIMAL(19,6) DEFAULT 0 NOT NULL,
FCALCTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FDCTRATE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDCTAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FGOODSID BIGINT DEFAULT 0 NOT NULL,
FGOODSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_DISCOUNT') 
 CREATE TABLE T_PUR_DISCOUNT (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLDATE DATETIME,
FDCTOBJ CHAR(1) DEFAULT ' ' NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FSUPSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FPURORGSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FRCVORGSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FBIZTYPESCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPRICESCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID 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_PRICENTRY') 
 CREATE TABLE T_PUR_PRICENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FMATERIALDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FASSTPROID VARCHAR(50) DEFAULT ' ' NOT NULL,
FMATCLASSID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FQTYTO DECIMAL(19,6) DEFAULT 0 NOT NULL,
FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDCTRATE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FTAXRATE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FLOWPRICE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FUPPRICE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDATEFROM DATETIME,
FDATETO DATETIME,
FMINORDERQTY DECIMAL(19,6) DEFAULT 0 NOT NULL,
FREFPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FGOODSID BIGINT DEFAULT 0 NOT NULL,
FGOODSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_PRICE') 
 CREATE TABLE T_PUR_PRICE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLDATE DATETIME,
FPRICEOBJ CHAR(1) DEFAULT ' ' NOT NULL,
FCURRID BIGINT DEFAULT 0 NOT NULL,
FTAXTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FSUPSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FPURORGSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FRCVORGSCOPE CHAR(1) DEFAULT ' ' NOT NULL,
FBIZTYPESCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) 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,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY CHAR(1) DEFAULT ' ' NOT NULL,
FCOMPARENO NVARCHAR(80) 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_UPDATEPARAMCONFIG') 
 CREATE TABLE T_PUR_UPDATEPARAMCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FPARAMNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMVALUE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPARAMMSG NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SPLITROWENTRY') 
 CREATE TABLE T_PUR_SPLITROWENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FCURRENTMETADATA NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCURRENTMETADATAKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCOPYROW CHAR(1) DEFAULT ' ' NOT NULL,
FSPLITROW CHAR(1) DEFAULT ' ' NOT NULL,
FDEFAULTROW CHAR(1) DEFAULT ' ' NOT NULL,
FDEFAULTVALUE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SPLITROW') 
 CREATE TABLE T_PUR_SPLITROW (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FBILLKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FRELATIONCONFIG NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPLUGINNAME NVARCHAR(255) 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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_SOURCE_L') 
 CREATE TABLE T_PUR_SOURCE_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_REGSUPPLYSCOPE') 
 CREATE TABLE T_PUR_REGSUPPLYSCOPE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FENTRYREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLONGNUMBER VARCHAR(1500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_REGSUPPLIER_CITY') 
 CREATE TABLE T_PUR_REGSUPPLIER_CITY (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID 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_REGSUPGOODS_ATT') 
 CREATE TABLE T_PUR_REGSUPGOODS_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_ITEM_L') 
 CREATE TABLE T_PUR_ITEM_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,
FCONTENT NVARCHAR(500) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_DISCOUNT_L') 
 CREATE TABLE T_PUR_DISCOUNT_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_ADJUST_L') 
 CREATE TABLE T_PUR_ADJUST_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_SUPBIZPERSONENTRY') 
 CREATE TABLE T_PUR_SUPBIZPERSONENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FPURORGID BIGINT DEFAULT 0 NOT NULL,
FCONTACTERID BIGINT DEFAULT 0 NOT NULL,
FBIZSCOPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FFORBID CHAR(1) DEFAULT ' ' NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PUR_CACATEGORY') 
 CREATE TABLE T_PUR_CACATEGORY (
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(512) DEFAULT ' ' NOT NULL,
FCATEGORYTYPE CHAR(1) DEFAULT 'B' NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL
);



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