IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_bos_mapservice_config')
CREATE TABLE t_bos_mapservice_config (
     FID               BIGINT DEFAULT 0 NOT NULL,
     FMAPSERVICE       VARCHAR(50)  default ' ' not null,
     FISCUSTOMSERVICE  CHAR(1)         default '0' not null,
     FAMAP_SECURITYKEY VARCHAR(512) default ' ' not null,
     FAMAP_APIKEY      VARCHAR(512) default ' ' not null,
     FBAIDU_BROWSERKEY VARCHAR(512)  default ' ' not null,
     FBAIDU_SERVERKEY  VARCHAR(512) default ' ' not null,
     FAMAP_JSAPIKEY    VARCHAR(512) default ' ' not null,
     FMODIFIERID       BIGINT,
     FCREATETIME       DATETIME,
     FMODIFYTIME       DATETIME,
     FCREATORID        BIGINT
);

EXEC P_ALTERPK 'pk_bos_mapservice_config', 't_bos_mapservice_config', 'fid', '1';


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_bos_mapservice_confi_r3')
CREATE TABLE t_bos_mapservice_confi_r3 (
   fid        BIGINT default 0 not null,
   frefstatus CHAR(1)    default '0' not null
);

EXEC P_ALTERPK 'pk_t_bos_mapservice_confi_r3', 't_bos_mapservice_confi_r3', 'fid', '1';