/**Begin D:\PDM_UPGRADE\PDM1\TSRBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_SSCTASKHIS')
 CREATE TABLE T_TSRBD_SSCTASKHIS (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FIMAGENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FIMAGEUPLOADTIME DATETIME,
FIMAGEOK VARCHAR(10) DEFAULT ' ' NOT NULL,
FASSIGNID VARCHAR(100) DEFAULT ' ' NOT NULL,
FINFO VARCHAR(255) DEFAULT ' ' NOT NULL,
FPROCINSTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FREVERSEOPRT VARCHAR(50) DEFAULT ' ' NOT NULL,
FOPRT VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCETASKID BIGINT DEFAULT 0 NOT NULL,
FREFORMPERSON BIGINT DEFAULT 0 NOT NULL,
FORIGNALPERSONID BIGINT DEFAULT 0 NOT NULL,
FQUALITYRESULT VARCHAR(10) DEFAULT ' ' NOT NULL,
FQUALITYSTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FQUALITYSAMPLELIBRARYID BIGINT DEFAULT 0 NOT NULL,
FQUALITYCHECKTIME DATETIME,
FAUTOPROCESSFORCHECK VARCHAR(10) DEFAULT ' ' NOT NULL,
FBILLID VARCHAR(100) DEFAULT ' ' NOT NULL,
FSYSBILLID INT DEFAULT 0 NOT NULL,
FBILLNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FTASKTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSSCID BIGINT DEFAULT 0 NOT NULL,
FSOURCE VARCHAR(10) DEFAULT ' ' NOT NULL,
FSUBJECT VARCHAR(255) DEFAULT ' ' NOT NULL,
FEXTENDERPID BIGINT DEFAULT 0 NOT NULL,
FPOOLTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FSTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKLEVELID BIGINT DEFAULT 0 NOT NULL,
FOLDTASKSTATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOEFFICIENT DECIMAL(23,2) DEFAULT 0 NOT NULL,
FCREATERULEID BIGINT DEFAULT 0 NOT NULL,
FRECYCLESTATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMULTISTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXPIRESTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FBIZDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZDATA_TAG NCLOB,
FAPPREVALMESSAGE NCLOB,
FINNERMSG VARCHAR(255) DEFAULT ' ' NOT NULL,
FUNPASSREASONID BIGINT DEFAULT 0 NOT NULL,
FUNPASSREASONDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FUNPASSREASONDESC_TAG NCLOB,
FFLAGMSG VARCHAR(255) DEFAULT ' ' NOT NULL,
FFLOWBACKSTGID BIGINT DEFAULT 0 NOT NULL,
FAUTOPROCESS CHAR(1) DEFAULT '0' NOT NULL,
FHASALLOCATED CHAR(1) DEFAULT '0' NOT NULL,
FALLOCATECOUNT INT DEFAULT 0 NOT NULL,
FISLASTAUDIT CHAR(1) DEFAULT '0' NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCONSIGNERID BIGINT DEFAULT 0 NOT NULL,
FAPPLYTIME DATETIME,
FTASKCREATETIME DATETIME,
FCOMPLETETIME DATETIME,
FCOSTWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESTTIME DECIMAL(23,2) DEFAULT 0 NOT NULL,
FRECEIVETIME DATETIME,
FWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESCANWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAUSEWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISCALCULATED CHAR(1) DEFAULT '0' NOT NULL,
FISHANDLED CHAR(1) DEFAULT '0' NOT NULL,
FORGLONGNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL,
FUSERGROUP BIGINT DEFAULT 0 NOT NULL,
FVOUCHERNO VARCHAR(500) DEFAULT ' ' NOT NULL,
FVOUCHERSTAT VARCHAR(100) DEFAULT ' ' NOT NULL,
FBILLLONGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_SSCTASKHIS_Q')
 CREATE TABLE T_TSRBD_SSCTASKHIS_Q (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMID VARCHAR(255) DEFAULT ' ' NOT NULL,
FSOURCETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FDECISIONITEM VARCHAR(10) DEFAULT ' ' NOT NULL,
FDECISIONITEMNEW BIGINT DEFAULT 0 NOT NULL,
FPENDINGOPINION NCLOB,
FRESCANOPINION NCLOB,
FPREDICTDISTIME DATETIME,
FMATCHRULE BIGINT DEFAULT 0 NOT NULL,
FAUTOPROCESSRESULT VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIRSTRECEIVETIME DATETIME,
FFIRSTCOSTWAITTIME DECIMAL(19,6) DEFAULT 0 NOT NULL,
FOPERATORID BIGINT DEFAULT 0 NOT NULL,
FPREDICTLEVEL VARCHAR(10) DEFAULT ' ' NOT NULL,
FPREDICTVALUE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDECISIONVALUE VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_SSCTASK')
 CREATE TABLE T_TSRBD_SSCTASK (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FBILLID VARCHAR(100) DEFAULT ' ' NOT NULL,
FSYSBILLID INT DEFAULT 0 NOT NULL,
FBILLNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FTASKTYPEID BIGINT DEFAULT 0 NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSSCID BIGINT DEFAULT 0 NOT NULL,
FSOURCE VARCHAR(10) DEFAULT ' ' NOT NULL,
FSUBJECT VARCHAR(255) DEFAULT ' ' NOT NULL,
FEXTENDERPID BIGINT DEFAULT 0 NOT NULL,
FPOOLTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FSTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKLEVELID BIGINT DEFAULT 0 NOT NULL,
FOLDTASKSTATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOEFFICIENT DECIMAL(23,2) DEFAULT 0 NOT NULL,
FCREATERULEID BIGINT DEFAULT 0 NOT NULL,
FRECYCLESTATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMULTISTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXPIRESTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FBIZDATA VARCHAR(255) DEFAULT ' ' NOT NULL,
FBIZDATA_TAG NCLOB,
FAPPREVALMESSAGE NCLOB,
FINNERMSG VARCHAR(2000) DEFAULT ' ' NOT NULL,
FUNPASSREASONID BIGINT DEFAULT 0 NOT NULL,
FUNPASSREASONDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FUNPASSREASONDESC_TAG NCLOB,
FFLAGMSG VARCHAR(255) DEFAULT ' ' NOT NULL,
FFLOWBACKSTGID BIGINT DEFAULT 0 NOT NULL,
FAUTOPROCESS CHAR(1) DEFAULT '0' NOT NULL,
FHASALLOCATED CHAR(1) DEFAULT '0' NOT NULL,
FALLOCATECOUNT INT DEFAULT 0 NOT NULL,
FISLASTAUDIT CHAR(1) DEFAULT '0' NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCONSIGNERID BIGINT DEFAULT 0 NOT NULL,
FTASKCREATETIME DATETIME,
FAPPLYTIME DATETIME,
FCOMPLETETIME DATETIME,
FCOSTWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESTTIME DECIMAL(23,2) DEFAULT 0 NOT NULL,
FPREDICTDISTIME DATETIME,
FRECEIVETIME DATETIME,
FWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESCANWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAUSEWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORGLONGNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL,
FUSERGROUP BIGINT DEFAULT 0 NOT NULL,
FVOUCHERNO VARCHAR(500) DEFAULT ' ' NOT NULL,
FVOUCHERSTAT VARCHAR(100) DEFAULT ' ' NOT NULL,
FBILLLONGID BIGINT DEFAULT 0 NOT NULL,
FIMAGENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FIMAGEUPLOADTIME DATETIME,
FIMAGEOK VARCHAR(10) DEFAULT ' ' NOT NULL,
FASSIGNID VARCHAR(100) DEFAULT ' ' NOT NULL,
FINFO VARCHAR(255) DEFAULT ' ' NOT NULL,
FPROCINSTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FREVERSEOPRT VARCHAR(50) DEFAULT ' ' NOT NULL,
FOPRT VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCETASKID BIGINT DEFAULT 0 NOT NULL,
FREFORMPERSON BIGINT DEFAULT 0 NOT NULL,
FORIGNALPERSONID BIGINT DEFAULT 0 NOT NULL,
FQUALITYRESULT VARCHAR(10) DEFAULT ' ' NOT NULL,
FQUALITYSTATE VARCHAR(10) DEFAULT ' ' NOT NULL,
FQUALITYSAMPLELIBRARYID BIGINT DEFAULT 0 NOT NULL,
FQUALITYCHECKTIME DATETIME,
FAUTOPROCESSFORCHECK VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXTTEXTFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_SSCTASK_Q')
 CREATE TABLE T_TSRBD_SSCTASK_Q (
FID BIGINT DEFAULT 0 NOT NULL,
FSOURCETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIRSTRECEIVETIME DATETIME,
FAPPROVEOP VARCHAR(10) DEFAULT ' ' NOT NULL,
FDECISIONITEM VARCHAR(10) DEFAULT ' ' NOT NULL,
FDECISIONITEMNEW BIGINT DEFAULT 0 NOT NULL,
FPENDINGOPINION NCLOB,
FRESCANOPINION NCLOB,
FUNPASSREASONDATA VARCHAR(1000) DEFAULT ' ' NOT NULL,
FMATCHRULE BIGINT DEFAULT 0 NOT NULL,
FAUTOPROCESSRESULT VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIRSTCOSTWAITTIME DECIMAL(19,6) DEFAULT 0 NOT NULL,
FOPERATORID BIGINT DEFAULT 0 NOT NULL,
FITEMID VARCHAR(255) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\TSRBD_table.sql **/
