/**Begin D:\PDM_UPGRADE\PDM1\HOM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_ACTIVITYINFO') 
 CREATE TABLE T_HOM_ACTIVITYINFO (
FID BIGINT DEFAULT 0 NOT NULL,
FONBRDID BIGINT DEFAULT 0 NOT NULL,
FACTIVITYSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FACTIVITYSCHEMEHISVID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FFINISHDATE DATETIME,
FTOTALACTIVITNUM INT DEFAULT 0 NOT NULL,
FWAITACTIVITNUM INT DEFAULT 0 NOT NULL,
FFINISHACTIVITNUM INT DEFAULT 0 NOT NULL,
FEARLYWARNACTIVITNUM INT DEFAULT 0 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_HOM_ACTIVITYINFODETAIL') 
 CREATE TABLE T_HOM_ACTIVITYINFODETAIL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FACTIVITYID BIGINT DEFAULT 0 NOT NULL,
FACTIVITYINSID BIGINT DEFAULT 0 NOT NULL,
FLATESTDEADLINE DATETIME,
FONBRDLINK VARCHAR(2) DEFAULT ' ' NOT NULL,
FACTIVITYTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FHANDLER BIGINT DEFAULT 0 NOT NULL,
FFINISHDATE DATETIME,
FREMARKS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSEQ INT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_ONBRDBILL')
 CREATE TABLE T_HOM_ONBRDBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FEMPLOYEENO VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FAADMINORGID BIGINT DEFAULT 0 NOT NULL,
FACOMPANYID BIGINT DEFAULT 0 NOT NULL,
FAJOBSCMORGID BIGINT DEFAULT 0 NOT NULL,
FAJOBSCMID BIGINT DEFAULT 0 NOT NULL,
FAJOBID BIGINT DEFAULT 0 NOT NULL,
FAJOBLEVELID BIGINT DEFAULT 0 NOT NULL,
FAJOBGRADEID BIGINT DEFAULT 0 NOT NULL,
FBASELOCATIONID BIGINT DEFAULT 0 NOT NULL,
FPROBATIONTIME INT DEFAULT 0 NOT NULL,
FPERPROBATIONTIME VARCHAR(2) DEFAULT ' ' NOT NULL,
FVALIDUNTIL DATETIME,
FALABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FALABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FCANDIDATEID BIGINT DEFAULT 0 NOT NULL,
FENROLLSTATUS VARCHAR(2) DEFAULT '0' NOT NULL,
FSTARTTIME DATETIME,
FPROCESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FISINVALID CHAR(1) DEFAULT ' ' NOT NULL,
FBREAKUPDATE DATETIME,
FBREAKUPTYPEID BIGINT DEFAULT 0 NOT NULL,
FBREAKUPREASONID BIGINT DEFAULT 0 NOT NULL,
FBREAKUPREMARKS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISHIGHEND CHAR(1) DEFAULT ' ' NOT NULL,
FISSPECIALTALENT CHAR(1) DEFAULT ' ' NOT NULL,
FISFOREIGN CHAR(1) DEFAULT ' ' NOT NULL,
FISRDPERSONNEL CHAR(1) DEFAULT ' ' NOT NULL,
FHRBUID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FDEPENDENCYID BIGINT DEFAULT 0 NOT NULL,
FDEPENDENCYTYPEID BIGINT DEFAULT 0 NOT NULL,
FROLEID BIGINT DEFAULT 0 NOT NULL,
FROLETYPEID BIGINT DEFAULT 0 NOT NULL,
FISRESPONSIBLE CHAR(1) DEFAULT '0' NOT NULL,
FRULESID VARCHAR(50) DEFAULT ' ' NOT NULL,
FISELIGIBLEONBOARD CHAR(1) DEFAULT '0' NOT NULL,
FCHECKCITYID BIGINT DEFAULT 0 NOT NULL,
FCHECKHOSPITAL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCHECKDATE DATETIME,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_ONBRDBILL_A')
 CREATE TABLE T_HOM_ONBRDBILL_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,
FBILLSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FISEXISTSWORKFLOW CHAR(1) DEFAULT '0' NOT NULL,
FISSUBMIT CHAR(1) DEFAULT '0' NOT NULL,
FBARCODE VARCHAR(60) DEFAULT ' ' NOT NULL,
FEVENTEFFECTDATE DATETIME,
FINPUTDEVICETYPE VARCHAR(100) DEFAULT '1' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FAUDITSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FGENDERID BIGINT DEFAULT 0 NOT NULL,
FPHONE VARCHAR(30) DEFAULT ' ' NOT NULL,
FPEREMAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FCERTIFICATETYPEID BIGINT DEFAULT 0 NOT NULL,
FCERTIFICATENUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FCERTIFICATENUMBER_ENP NCLOB,
FPICTUREFIELD VARCHAR(1000) DEFAULT ' ' NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FONBRDTYPEID BIGINT DEFAULT 0 NOT NULL,
FMANAGEMENTSCOPEID BIGINT DEFAULT 0 NOT NULL,
FDATASOURCE VARCHAR(2) DEFAULT ' ' NOT NULL,
FRECRUITTYPEID BIGINT DEFAULT 0 NOT NULL,
FRECRUITSOURCEID BIGINT DEFAULT 0 NOT NULL,
FRESUMENO VARCHAR(50) DEFAULT ' ' NOT NULL,
FOFFERNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FPREENROLLSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FPREENEFFECTDATE DATETIME,
FPREENONBRDTCITYID BIGINT DEFAULT 0 NOT NULL,
FCHECKINSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FEFFECTDATE DATETIME,
FONBRDTCITYID BIGINT DEFAULT 0 NOT NULL,
FCHECKINTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FNOCHECKINTIMES INT DEFAULT 0 NOT NULL,
FISCHECKINEXCEPTION CHAR(1) DEFAULT '0' NOT NULL,
FEXCEPTIONCAUSE VARCHAR(2) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_BREAKUPREASON')
 CREATE TABLE T_HOM_BREAKUPREASON (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBREAKUPTYPEID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_BREAKUPTYPE')
 CREATE TABLE T_HOM_BREAKUPTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSYSDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_PLACE')
 CREATE TABLE T_HOM_PLACE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCITYID BIGINT DEFAULT 0 NOT NULL,
FADDRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSETGPSINFO CHAR(1) DEFAULT ' ' NOT NULL,
FISDEFAULTADDRESS CHAR(1) DEFAULT ' ' NOT NULL,
FLONGITUDE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FLATITUDE DECIMAL(19,6) DEFAULT 0 NOT NULL,
FEFFECTRADIUS INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOGROUPFIELD_L')
 CREATE TABLE T_HOM_INFOGROUPFIELD_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDREMARK VARCHAR(200) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOGROUP_L')
 CREATE TABLE T_HOM_INFOGROUP_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FINFOGROUPNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FDISPLAYTIPS VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOGROUPFIELD')
 CREATE TABLE T_HOM_INFOGROUPFIELD (
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPAGEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FAPPROVESHOW CHAR(1) DEFAULT ' ' NOT NULL,
FLISTSHOW CHAR(1) DEFAULT ' ' NOT NULL,
FLISTSHOWFIRSTLINE CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDREMARK NVARCHAR(200) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_UPLOADCONFIG')
 CREATE TABLE T_HOM_UPLOADCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FENTITYNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FPKIDFIELD VARCHAR(50) DEFAULT ' ' NOT NULL,
FATTACHMENTPANEL VARCHAR(50) DEFAULT ' ' NOT NULL,
FFILETYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FPICTUREFILFIELDS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCERTIFICATETYPEID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCONFIGFIELD')
 CREATE TABLE T_HOM_INFOCONFIGFIELD (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDMUSTINPUT CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDAPPROVE CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDREMARK NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDRECHECK CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDCOUNT BIGINT DEFAULT 0 NOT NULL,
FFIELDNAMESHOW NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDRECHECKSTAND NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCONFIGFIELDHIS')
 CREATE TABLE T_HOM_INFOCONFIGFIELDHIS (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDMUSTINPUT CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDAPPROVE CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDREMARK NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDRECHECK CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDCOUNT BIGINT DEFAULT 0 NOT NULL,
FFIELDNAMESHOW NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDRECHECKSTAND NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCONFIGFIELD_L')
 CREATE TABLE T_HOM_INFOCONFIGFIELD_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIELDREMARK VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNAMESHOW VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDRECHECKSTAND VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCONFIGFIELDHIS_L')
 CREATE TABLE T_HOM_INFOCONFIGFIELDHIS_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIELDREMARK VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNAMESHOW VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDRECHECKSTAND VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_CONFIG')
 CREATE TABLE T_HOM_CONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FBUSINESSKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FBUSINESSVALUE VARCHAR(2000) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FBUSINESSTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_CONFIG_L')
 CREATE TABLE T_HOM_CONFIG_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOGROUPCONFIG')
 CREATE TABLE T_HOM_INFOGROUPCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINFOGROUPID BIGINT DEFAULT 0 NOT NULL,
FINFOGROUPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINFOAPPROVE VARCHAR(1) DEFAULT ' ' NOT NULL,
FINFOMUSTINPUT VARCHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOGROUPCONFIGHIS')
 CREATE TABLE T_HOM_INFOGROUPCONFIGHIS (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINFOGROUPID BIGINT DEFAULT 0 NOT NULL,
FINFOGROUPNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINFOAPPROVE VARCHAR(1) DEFAULT ' ' NOT NULL,
FINFOMUSTINPUT VARCHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOGROUPCONFIG_L')
 CREATE TABLE T_HOM_INFOGROUPCONFIG_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FINFOGROUPNAME VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOGROUPCONFIGHIS_L')
 CREATE TABLE T_HOM_INFOGROUPCONFIGHIS_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FINFOGROUPNAME VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCOLLECTCONFHIS')
 CREATE TABLE T_HOM_INFOCOLLECTCONFHIS (
FVID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREGIONID BIGINT DEFAULT 0 NOT NULL,
FMUSTINPUT VARCHAR(2) DEFAULT ' ' NOT NULL,
FAPPROVE VARCHAR(2) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FISSYSPRESET VARCHAR(2) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCOLLECTCONFIG')
 CREATE TABLE T_HOM_INFOCOLLECTCONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREGIONID BIGINT DEFAULT 0 NOT NULL,
FMUSTINPUT VARCHAR(2) DEFAULT ' ' NOT NULL,
FAPPROVE VARCHAR(2) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FISSYSPRESET VARCHAR(2) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCOLLECTCONFHIS_L')
 CREATE TABLE T_HOM_INFOCOLLECTCONFHIS_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_CONFIGENTITY')
 CREATE TABLE T_HOM_CONFIGENTITY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTITYKEY VARCHAR(100) DEFAULT ' ' NOT NULL,
FENTITYVALUE VARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCONFCERT')
 CREATE TABLE T_HOM_INFOCONFCERT (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FISCHECK VARCHAR(2) DEFAULT ' ' NOT NULL,
FCERTTYPEID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_INFOCONFCERTHIS')
 CREATE TABLE T_HOM_INFOCONFCERTHIS (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FISCHECK VARCHAR(2) DEFAULT ' ' NOT NULL,
FCERTTYPEID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_COLLECT') 
 CREATE TABLE T_HOM_COLLECT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(2) 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,
FBARCODE VARCHAR(60) DEFAULT ' ' NOT NULL,
FINPUTDEVICETYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FISEXISTSWORKFLOW VARCHAR(2) DEFAULT ' ' NOT NULL,
FAUDITSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FEVENTEFFECTDATE DATETIME,
FISSUBMIT VARCHAR(2) DEFAULT ' ' NOT NULL,
FONBOARDID BIGINT DEFAULT 0 NOT NULL,
FCOLLECTSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FAPPROVESTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FSUBMITPRO VARCHAR(10) DEFAULT ' ' NOT NULL,
FCOLLECTCONFIGID BIGINT DEFAULT 0 NOT NULL,
FCOLLECTCONFIGHISID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATERESULT VARCHAR(2) DEFAULT ' ' NOT NULL,
FSENDTEXT VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEADLINE DATETIME,
FAPPROVEMODIFIER BIGINT DEFAULT 0 NOT NULL,
FAPPROVECREATOR BIGINT DEFAULT 0 NOT NULL,
FAPPROVECREATETIME DATETIME,
FAPPROVEMODIFYTIME DATETIME
);



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