IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_TRIP_VEHICLE_SETTING')
CREATE TABLE T_ER_TRIP_VEHICLE_SETTING
(
    FID          BIGINT                                     NOT NULL,
    FNUMBER      VARCHAR(30) DEFAULT ' ' NOT NULL,
    FAPPLYSOURCE VARCHAR(50) DEFAULT ' ' NOT NULL,
    FVEHICLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
    FDATENUM     BIGINT,
    FSERVER      VARCHAR(50) DEFAULT ' ' NOT NULL,
    FCREATORID   BIGINT,
    FMODIFIERID  BIGINT,
    FENABLE      VARCHAR(50) DEFAULT ' ' NOT NULL,
    FCREATETIME  TIMESTAMP,
    FMODIFYTIME  TIMESTAMP,
    FMASTERID    BIGINT
);
EXEC p_AlterPK 'PK_T_ER_TRIP_VEHICLE_SETTING', 'T_ER_TRIP_VEHICLE_SETTING', 'FID', '1';
    IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_TRIP_VEHICLE_SETTING_FAPPLYSOURCE') CREATE INDEX IDX_ER_TRIP_VEHICLE_SETTING_FAPPLYSOURCE ON T_ER_TRIP_VEHICLE_SETTING ( FAPPLYSOURCE );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_TRIP_VEHICLE_SETTING_L')
CREATE TABLE T_ER_TRIP_VEHICLE_SETTING_L
(
    FPKID     VARCHAR(36)                                NOT NULL,
    FID       BIGINT      DEFAULT 0                      NOT NULL,
    FLOCALEID VARCHAR(10) DEFAULT ''  NOT NULL,
    FNAME     VARCHAR(50) DEFAULT ' ' NOT NULL
);
EXEC p_AlterPK 'PK_T_ER_TRIP_VEHICLE_SETTING_L', 'T_ER_TRIP_VEHICLE_SETTING_L', 'fpkid', '1';