/**Begin D:\PDM_UPGRADE\PDM1\HOM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_SSCTASK_Q') 
 CREATE TABLE T_HOM_SSCTASK_Q (
FID BIGINT DEFAULT 0 NOT NULL,
FOPERATORID BIGINT DEFAULT 0 NOT NULL,
FSOURCETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FAPPROVEOP CHAR(1) DEFAULT '1' NOT NULL,
FDECISIONITEM CHAR(1) DEFAULT ' ' NOT NULL,
FPENDINGOPINION NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FRESCANOPINION NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FUNPASSREASONDATA VARCHAR(1000) DEFAULT ' ' NOT NULL,
FDECISIONITEMNEW BIGINT DEFAULT 0 NOT NULL,
FITEMID VARCHAR(255) DEFAULT ' ' NOT NULL,
FMATCHRULE BIGINT DEFAULT 0 NOT NULL,
FAUTOPROCESSRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FFIRSTRECEIVETIME DATETIME,
FFIRSTCOSTWAITTIME DECIMAL(19,6) DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_SSCTASK') 
 CREATE TABLE T_HOM_SSCTASK (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLLONGID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSOURCE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKTYPEID BIGINT DEFAULT 0 NOT NULL,
FCREATERULEID BIGINT DEFAULT 0 NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FSYSBILLID BIGINT DEFAULT 0 NOT NULL,
FBILLID VARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSSCID BIGINT DEFAULT 0 NOT NULL,
FOPRT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FASSIGNID VARCHAR(100) DEFAULT ' ' NOT NULL,
FPROCINSTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FIMAGEOK NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPOOLTYPE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FSTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FOLDTASKSTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FRECYCLESTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKLEVELID BIGINT DEFAULT 0 NOT NULL,
FEXPIRESTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FMULTISTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCOMPLETETIME DATETIME,
FRESTTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVETIME DATETIME,
FWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNPASSREASONID BIGINT DEFAULT 0 NOT NULL,
FLEVEL DECIMAL(16,9) DEFAULT 0 NOT NULL,
FSUBJECT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINFO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFLAGMSG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINNERMSG NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FCONSIGNERID BIGINT DEFAULT 0 NOT NULL,
FFLOWBACKSTGID BIGINT DEFAULT 0 NOT NULL,
FPAUSEWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESCANWAITTIME INT DEFAULT 0 NOT NULL,
FCOSTWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAUTOPROCESS CHAR(1) DEFAULT '0' NOT NULL,
FIMAGEUPLOADTIME DATETIME,
FALLOCATECOUNT INT DEFAULT 0 NOT NULL,
FISLASTAUDIT CHAR(1) DEFAULT '0' NOT NULL,
FBILLSTATUS NVARCHAR(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,
FHASALLOCATED CHAR(1) DEFAULT '0' NOT NULL,
FEXTENDERPID BIGINT DEFAULT 0 NOT NULL,
FREVERSEOPRT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FIMAGENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZDATA NCLOB,
FBIZDATA_TAG NCLOB,
FBILLNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FORGLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FTASKCREATETIME DATETIME,
FAPPREVALMESSAGE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FUNPASSREASONDESC NCLOB,
FUNPASSREASONDESC_TAG NCLOB,
FCOEFFICIENT DECIMAL(23,10) DEFAULT 0.0000000000 NOT NULL,
FQUALITYSTATE NVARCHAR(30) DEFAULT '0' NOT NULL,
FSOURCETASKID BIGINT DEFAULT 0 NOT NULL,
FQUALITYSAMPLELIBRARYID BIGINT DEFAULT 0 NOT NULL,
FORIGNALPERSONID BIGINT DEFAULT 0 NOT NULL,
FREFORMPERSON BIGINT DEFAULT 0 NOT NULL,
FQUALITYRESULT NVARCHAR(10) DEFAULT '0' NOT NULL,
FAUTOPROCESSFORCHECK CHAR(1) DEFAULT '0' NOT NULL,
FQUALITYCHECKTIME DATETIME,
FAPPLYTIME DATETIME,
FPREDICTDISTIME DATETIME,
FUSERGROUP BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_SSCTASKHIS') 
 CREATE TABLE T_HOM_SSCTASKHIS (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLLONGID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSOURCE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKTYPEID BIGINT DEFAULT 0 NOT NULL,
FCREATERULEID BIGINT DEFAULT 0 NOT NULL,
FBILLTYPEID BIGINT DEFAULT 0 NOT NULL,
FSYSBILLID BIGINT DEFAULT 0 NOT NULL,
FBILLID VARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSSCID BIGINT DEFAULT 0 NOT NULL,
FOPRT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FASSIGNID VARCHAR(100) DEFAULT ' ' NOT NULL,
FPROCINSTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FIMAGEOK NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPOOLTYPE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FSTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FOLDTASKSTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FRECYCLESTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKLEVELID BIGINT DEFAULT 0 NOT NULL,
FEXPIRESTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FMULTISTATE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCOMPLETETIME DATETIME,
FRESTTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVETIME DATETIME,
FWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNPASSREASONID BIGINT DEFAULT 0 NOT NULL,
FLEVEL DECIMAL(16,9) DEFAULT 0 NOT NULL,
FSUBJECT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINFO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFLAGMSG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINNERMSG NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FCONSIGNERID BIGINT DEFAULT 0 NOT NULL,
FFLOWBACKSTGID BIGINT DEFAULT 0 NOT NULL,
FPAUSEWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESCANWAITTIME INT DEFAULT 0 NOT NULL,
FCOSTWAITTIME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAUTOPROCESS CHAR(1) DEFAULT '0' NOT NULL,
FIMAGEUPLOADTIME DATETIME,
FALLOCATECOUNT INT DEFAULT 0 NOT NULL,
FISLASTAUDIT CHAR(1) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(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,
FHASALLOCATED CHAR(1) DEFAULT ' ' NOT NULL,
FEXTENDERPID BIGINT DEFAULT 0 NOT NULL,
FREVERSEOPRT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FIMAGENUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZDATA NCLOB,
FBIZDATA_TAG NCLOB,
FBILLNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FORGLONGNUMBER NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSOURCETASKID BIGINT DEFAULT 0 NOT NULL,
FTASKCREATETIME DATETIME,
FAPPREVALMESSAGE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FUNPASSREASONDESC NCLOB,
FUNPASSREASONDESC_TAG NCLOB,
FCOEFFICIENT DECIMAL(23,10) DEFAULT 0.0000000000 NOT NULL,
FQUALITYSTATE VARCHAR(30) DEFAULT ' ' NOT NULL,
FISCALCULATED CHAR(1) DEFAULT '0' NOT NULL,
FISHANDLED CHAR(1) DEFAULT '0' NOT NULL,
FQUALITYSAMPLELIBRARYID BIGINT DEFAULT 0 NOT NULL,
FQUALITYCHECKTIME DATETIME,
FORIGNALPERSONID BIGINT DEFAULT 0 NOT NULL,
FREFORMPERSON BIGINT DEFAULT 0 NOT NULL,
FQUALITYRESULT NVARCHAR(10) DEFAULT '0' NOT NULL,
FAUTOPROCESSFORCHECK CHAR(1) DEFAULT '0' NOT NULL,
FAPPLYTIME DATETIME,
FUSERGROUP BIGINT DEFAULT 0 NOT NULL
);



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