/**Begin D:\PDM_UPGRADE\PDM1\SOEHRR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SOEHRR_COLLECTTASK') 
 CREATE TABLE T_SOEHRR_COLLECTTASK (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDISORG BIGINT DEFAULT 0 NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FTASKJSON VARCHAR(255) DEFAULT ' ' NOT NULL,
FTASKJSON_TAG NCLOB,
FREPORTCLASSIFY BIGINT DEFAULT 0 NOT NULL,
FYEAR VARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKSOURCE VARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SOEHRR_REPULSERECORD') 
 CREATE TABLE T_SOEHRR_REPULSERECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FTASKID BIGINT DEFAULT 0 NOT NULL,
FREPULSER BIGINT DEFAULT 0 NOT NULL,
FREPULSETIME DATETIME,
FREJECTREASON NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SOEHRR_CTFILLUNITS') 
 CREATE TABLE T_SOEHRR_CTFILLUNITS (
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_SOEHRR_REPORT') 
 CREATE TABLE T_SOEHRR_REPORT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FFILLTASK BIGINT DEFAULT 0 NOT NULL,
FYEAR VARCHAR(10) DEFAULT ' ' NOT NULL,
FBELONGPERIOD BIGINT DEFAULT 0 NOT NULL,
FPERIODTYPE BIGINT DEFAULT 0 NOT NULL,
FDATASTARTTIME DATETIME,
FDATAENDTIME DATETIME,
FJSON VARCHAR(255) DEFAULT ' ' NOT NULL,
FJSON_TAG NCLOB,
FREPTPL BIGINT DEFAULT 0 NOT NULL,
FEXEUNIT BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FREPORTCLASSIFYID BIGINT DEFAULT 0 NOT NULL,
FISCURRENTVERSION CHAR(1) DEFAULT '0' NOT NULL,
FHISVERSION VARCHAR(50) DEFAULT ' ' NOT NULL,
FREPORTSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SOEHRR_FILLTASKCHECKSTY') 
 CREATE TABLE T_SOEHRR_FILLTASKCHECKSTY (
FID BIGINT DEFAULT 0 NOT NULL,
FROW INT DEFAULT 0 NOT NULL,
FCOL INT DEFAULT 0 NOT NULL,
FSHEETNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILLTASKID BIGINT DEFAULT 0 NOT NULL,
FLBORDERCOLOR VARCHAR(100) DEFAULT ' ' NOT NULL,
FBORDERSTYLE VARCHAR(100) DEFAULT ' ' NOT NULL,
FLEVEL VARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SOEHRR_FILLTASK') 
 CREATE TABLE T_SOEHRR_FILLTASK (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME VARCHAR(255) DEFAULT ' ' NOT NULL,
FEXEUNIT BIGINT DEFAULT 0 NOT NULL,
FDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FDISUNIT BIGINT DEFAULT 0 NOT NULL,
FSOLUTION BIGINT DEFAULT 0 NOT NULL,
FHATCHSOLUTION BIGINT DEFAULT 0 NOT NULL,
FREPORTPERSON BIGINT DEFAULT 0 NOT NULL,
FREJECTREASON VARCHAR(255) DEFAULT ' ' NOT NULL,
FENDTIME DATETIME,
FSTARTTIME DATETIME,
FTASKSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FREPORTTIME DATETIME,
FSTOPTIME DATETIME,
FSTOPREASON VARCHAR(255) DEFAULT ' ' NOT NULL,
FTREPCONTENT VARCHAR(255) DEFAULT ' ' NOT NULL,
FTREPCONTENT_TAG NCLOB,
FSHEETCOMBO VARCHAR(60) DEFAULT ' ' NOT NULL,
FRETRIDATA CHAR(1) DEFAULT '0' NOT NULL,
FLASTRDTIME DATETIME,
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_SOEHRR_COLLECTTASKOBJS') 
 CREATE TABLE T_SOEHRR_COLLECTTASKOBJS (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FRPTTPL BIGINT DEFAULT 0 NOT NULL,
FPERIODTYPE BIGINT DEFAULT 0 NOT NULL,
FBELONGPERIOD BIGINT DEFAULT 0 NOT NULL,
FDATASTARTTIME DATETIME,
FDATAENDTIME DATETIME,
FID BIGINT DEFAULT 0 NOT NULL
);


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


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



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