IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PMBD_EP_HM_RES_PO') 
CREATE TABLE T_PMBD_EP_HM_RES_PO
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL, 	
  FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL, 	
  FSTATUS NVARCHAR(1) DEFAULT ' ' NOT NULL, 	
  FCREATORID BIGINT DEFAULT 0 NOT NULL,   	
  FMODIFIERID BIGINT DEFAULT 0 NOT NULL,  
  FENABLE NVARCHAR(1) DEFAULT ' ' NOT NULL, 	
  FCREATETIME DATETIME ,                  	
  FMODIFYTIME DATETIME ,                  	
  FMASTERID BIGINT DEFAULT 0 NOT NULL,    	
  FAVATAR NVARCHAR(255) DEFAULT ' ' NOT NULL, 	
  FGENDER NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FUSERTYPE BIGINT DEFAULT 0 NOT NULL,    	
  FORG BIGINT DEFAULT 0 NOT NULL,         
  FWORKCENTER BIGINT DEFAULT 0 NOT NULL,  
  FDATASOURCES NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FDATASOURCESID BIGINT DEFAULT 0 NOT NULL 
);


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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PMBD_HM_RES_USERP') 
CREATE TABLE T_PMBD_HM_RES_USERP
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     	
  FSEQ INT DEFAULT 0 NOT NULL,            	
  FDPTID BIGINT DEFAULT 0 NOT NULL,       	
  FORGSTRUCTUREID BIGINT DEFAULT 0 NOT NULL, 	
  FISINCHARGE CHAR(1) DEFAULT '0' NOT NULL, 	
  FISPARTJOB CHAR(1) DEFAULT '0' NOT NULL, 	
  FSUPERIORID BIGINT DEFAULT 0 NOT NULL,  	
  FDEPCREATER BIGINT DEFAULT 0 NOT NULL,  
  FPOSITION NVARCHAR(255) DEFAULT ' ' NOT NULL,
  FDEPMODIFYDATE DATETIME ,               	
  FDEPCREATEDATE DATETIME ,               	
  FDEPMODIFIER BIGINT DEFAULT 0 NOT NULL 	
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PMBD_HM_RES_USERP_L') 
CREATE TABLE T_PMBD_HM_RES_USERP_L
(
  FPKID NVARCHAR(255) DEFAULT ' ' NOT NULL,          
  FENTRYID BIGINT DEFAULT 0 NOT NULL,          	
  FLOCALEID NVARCHAR(255) DEFAULT ' ' NOT NULL,          
  FPOSITION NVARCHAR(255) DEFAULT ' ' NOT NULL 
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PMBD_HM_RES_USERCONTACT') 
CREATE TABLE T_PMBD_HM_RES_USERCONTACT
(
  FID BIGINT DEFAULT 0 NOT NULL,          
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     	
  FSEQ INT DEFAULT 0 NOT NULL,            	
  FCONTACTTYPEID BIGINT DEFAULT 0 NOT NULL, 
  FCONTACT NVARCHAR(255) DEFAULT ' ' NOT NULL, 
  FISDEFAULT CHAR(1) DEFAULT '0' NOT NULL, 	
  FCONTACTCREATER BIGINT DEFAULT 0 NOT NULL, 	
  FCONTACTCREATEDATE DATETIME ,         
  FCONTACTMODIFIER BIGINT DEFAULT 0 NOT NULL, 	
  FCONTACTMODIFYDATE DATETIME       
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PMBD_HM_RES_ROLE') 
CREATE TABLE T_PMBD_HM_RES_ROLE
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     
  FSEQ INT DEFAULT 0 NOT NULL,            	
  FROLEID NVARCHAR(50) DEFAULT ' ' NOT NULL,      	
  FMAINROLE CHAR(1) DEFAULT '0' NOT NULL, 	
  FCURRENCY BIGINT DEFAULT 0 NOT NULL,    
  FCOSTPRICE DECIMAL(23,2) DEFAULT 0 NOT NULL, 	
  FSERVICEPRICE DECIMAL(23,2) DEFAULT 0 NOT NULL, 
  FSTANDARDTIME DECIMAL(23,2) DEFAULT 0 NOT NULL, 
  FSTANDARDMAXTIME DECIMAL(23,2) DEFAULT 0 NOT NULL, 
  FROLECREATER BIGINT DEFAULT 0 NOT NULL, 	
  FROLECREATEDATE DATETIME ,              	
  FROLEMODIFIER BIGINT DEFAULT 0 NOT NULL, 	
  FROLEMODIFYDATE DATETIME               	
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PMBD_HM_RES_QATION') 
CREATE TABLE T_PMBD_HM_RES_QATION
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     	
  FSEQ INT DEFAULT 0 NOT NULL,            	
  FQUALIFICATIONCREATER BIGINT DEFAULT 0 NOT NULL, 	
  FQUALIFICATCREATEDATE DATETIME ,        
  FQUALIFICATIOMODIFIER BIGINT DEFAULT 0 NOT NULL, 	
  FQUALIFICATIONMODIFYDATE DATETIME ,     
  FWORKTYPE BIGINT DEFAULT 0 NOT NULL,    
  FGRADELEVEL BIGINT DEFAULT 0 NOT NULL,  
  FISDEFWORKTYPE CHAR(1) DEFAULT '0' NOT NULL, 
  FQUALIFICATIONS BIGINT DEFAULT 0 NOT NULL, 	
  FCRENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL, 
  FEFFECTIVEDATE DATETIME ,               	
  FCLOSINGDATE DATETIME ,                 
  FVERIDATE DATETIME ,                    
  FREMARK NVARCHAR(250) DEFAULT ' ' NOT NULL 	
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PMBD_HM_RES_PROJECT') 
CREATE TABLE T_PMBD_HM_RES_PROJECT
(
  FID BIGINT DEFAULT 0 NOT NULL,          	
  FENTRYID BIGINT DEFAULT 0 NOT NULL,     	
  FSEQ INT DEFAULT 0 NOT NULL,            
  FPROJECTCREATER BIGINT DEFAULT 0 NOT NULL, 
  FPROJECTCREATEDATE DATETIME ,           
  FPROJECTMODIFIER BIGINT DEFAULT 0 NOT NULL, 
  FPROJECTMODIFYDATE DATETIME ,           
  FROLE NVARCHAR(50) DEFAULT ' ' NOT NULL,    
  FSOURCENAME NVARCHAR(5) DEFAULT ' ' NOT NULL, 	
  FADDPRODUCTTIME DATETIME ,              
  FPROJECTHMRESPL BIGINT DEFAULT 0 NOT NULL 	
);




