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



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_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_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_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_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_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_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
);



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