ALTER TABLE POSITIONAL ADD IF NOT EXISTS GPS_ATTACH_INFO VARCHAR NULL;
--车辆与终端运行状态信息表
CREATE TABLE IF NOT EXISTS VEHICLE_DEVICE_RUNNING_STATUS( 
 GROUP_ID BINARY(16) NOT NULL,
 TIME BIGINT NOT NULL,
 DATA_SOURCE INTEGER NOT NULL,
 MONITOR_ID	BINARY(16) NOT NULL,
 MONITOR_NAME VARCHAR,
 ASSIGNMENT_NAME VARCHAR,
 GROUP_NAME VARCHAR,
 PLATE_COLOR INTEGER,
 VEHICLE_TYPE VARCHAR,
 ORIGINAL_LONGITUDE VARCHAR,
 ORIGINAL_LATITUDE VARCHAR,
 ALTITUDE INTEGER,
 SPEED DOUBLE,
 DIRECTION INTEGER,
 VEHICLE_SPEED DOUBLE,
 AXIS_ACCELERATION_X DOUBLE,
 AXIS_ACCELERATION_Y DOUBLE,
 AXIS_ACCELERATION_Z DOUBLE,
 AXIS_ANGULAR_X DOUBLE,
 AXIS_ANGULAR_Y DOUBLE,
 AXIS_ANGULAR_Z DOUBLE,
 BRAKING_STATUS INTEGER,
 TURN_SIGNAL_STATUS INTEGER,
 HIGH_BEAM_STATUS INTEGER,
 LOW_BEAM_STATUS INTEGER,
 OBD_SPEED DOUBLE,
 GEAR_STATUS INTEGER,
 ACCELERATOR_PEDAL_VALUE INTEGER,
 BRAKE_PEDAL_VALUE INTEGER,
 ENGINE_SPEED INTEGER,
 STEERING_WHEEL_ANGLE INTEGER,
 AIR_STATUS INTEGER,
 HEATER_STATUS INTEGER,
 CLUTCH_STATUS INTEGER,
 ABS_STATUS INTEGER,
 CLEARANCE_LAMP_STATUS INTEGER,
 POWER_STATUS INTEGER,
 SPARE_BATTERY_STATUS INTEGER,
 GPS_STATUS INTEGER,
 TTS_STATUS INTEGER,
 MEMORY_STATUS INTEGER,
 SPARE_MEMORY_STATUS INTEGER
 CONSTRAINT PK PRIMARY KEY (GROUP_ID,TIME,DATA_SOURCE,MONITOR_ID)
)
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON ('20','40','60','80');

--设备报修表
CREATE TABLE IF NOT EXISTS DEVICE_REQUEST_REPAIR( 
 GROUP_ID BINARY(16) NOT NULL,
 TIME BIGINT NOT NULL,
 TYPE INTEGER NOT NULL,
 MONITOR_ID BINARY(16) NOT NULL,
 MONITOR_NAME VARCHAR,
 ASSIGNMENT_NAME VARCHAR,
 GROUP_NAME VARCHAR,
 PLATE_COLOR INTEGER,
 VEHICLE_TYPE VARCHAR,
 DEVICE_ID VARCHAR,
 TERMINAL_VENDOR VARCHAR,
 TERMINAL_TYPE VARCHAR,
 DEVICE_NUMBER VARCHAR,
 HANDLE_STATUS INTEGER,
 REPAIR_DATE BIGINT,
 CONFIRM_REMARK VARCHAR,
 FINISH_REMARK VARCHAR
 CONSTRAINT PK PRIMARY KEY (GROUP_ID,TIME,TYPE,MONITOR_ID)
)
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON ('30','70');