CREATE TABLE ALARM_HANDLE
(  ID VARCHAR  NULL,
   VEHICLE_ID  BINARY(16) NOT NULL,
   ALARM_START_TIME BIGINT NOT NULL,
   ALARM_TYPE  INTEGER NOT NULL,
   PLATE_NUMBER VARCHAR NULL,
   ASSIGNMENT_NAME VARCHAR NULL,
   PROFESSIONALS_NAME VARCHAR NULL,
   ALARM_END_TIME BIGINT,
   ALARM_START_LOCATION VARCHAR NULL,
   ALARM_END_LOCATION VARCHAR NULL,
   ALARM_SOURCE INTEGER NULL,
   SPEED VARCHAR NULL,
   ANGLE VARCHAR NULL,
   POSITIONAL_ID VARCHAR NULL,
   PERSON_ID VARCHAR NULL,
   PERSON_NAME VARCHAR NULL,
   HANDLE_TIME BIGINT,
   STATUS INTEGER,
   HANDLE_TYPE VARCHAR NULL,
   DESCRIPTION VARCHAR NULL,
   HEIGHT VARCHAR NULL,
   RECORDER_SPEED VARCHAR NULL,
   FENCE_TYPE VARCHAR NULL,
   FENCE_NAME VARCHAR NULL,
   MONITOR_TYPE INTEGER NULL,
   PROTOCOL_TYPE INTEGER NULL,
   SWIFT_NUMBER VARCHAR NULL,
   PUSH_TYPE INTEGER NULL,
   CAL_STANDARD INTEGER NULL,
   SPEED_TYPE  INTEGER  NULL,
   SEVERITY DOUBLE NULL,
   SPEED_LIMIT DOUBLE NULL,
   SPEED_TIME INTEGER NULL,
   MAX_SPEED DOUBLE NULL,
   GROUP_ID BINARY(16) NULL,
   OVERSEE_TIME BIGINT NULL,
   OVERSEE_DEAD_TIME BIGINT NULL,
   OVERSEE_PEOPLE VARCHAR NULL,
   RESPONSE_TIME BIGINT NULL,
   OVERSEE_STATUS TINYINT NULL,
   OVERSEE_TYPE TINYINT NULL,
   OVERSEE_LEVEL TINYINT NULL,
   RISK_ID VARCHAR NULL,
   GROUP_ID_STR VARCHAR NULL,
   REMARK VARCHAR NULL,
   oversee_result TINYINT NULL,
   ROAD_NET_SPEED_LIMIT DOUBLE NULL,
   PERSON_GROUP_NAME VARCHAR,
   SEND_OF_MSG varchar NULL,
   DEAL_OF_MSG varchar NULL,
   ROAD_TYPE INTEGER NULL,
   GROUP_NAME VARCHAR,
   PLATE_COLOR VARCHAR,
   VEHICLE_TYPE VARCHAR,
   DRIVER_NAME VARCHAR NULL,
   CERTIFICATION_ID VARCHAR NULL,
   HANDLE_RESULT INTEGER NULL
   CONSTRAINT PK PRIMARY KEY (VEHICLE_ID,ALARM_START_TIME,ALARM_TYPE)
) COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

CREATE TABLE BUSINESS_AREAS
(  ID VARCHAR NOT NULL,
   POSITION_INFO_ID VARCHAR NULL,
   BUSINESS_ID VARCHAR NULL,
   NAME VARCHAR NULL,
   LOCATION VARCHAR NULL,  CONSTRAINT PK PRIMARY KEY (ID)
);

CREATE TABLE INTEGRATED_STATISTICS
(
   ID VARCHAR NULL,
   VEHICLE_ID BINARY(16) NOT NULL,
   DAY_TIME BIGINT NOT NULL,
   PLATE_NUMBER VARCHAR NULL,
   GPS_MILE DOUBLE,
   TRAVEL_TIME BIGINT,
   DOWN_TIME BIGINT,
   OVER_SPEED_TIMES BIGINT,
   TRAVEL_TIMES BIGINT,
   ALARM_TIMES BIGINT,
   NIGHT_TRAVEL_MILE DOUBLE
   CONSTRAINT PK PRIMARY KEY (VEHICLE_ID,DAY_TIME)
);

CREATE TABLE POSITIONAL
(
   ID VARCHAR NULL,
   VEHICLE_ID BINARY(16) NOT NULL,
   DEVICE_NUMBER VARCHAR,
   SIM_CARD VARCHAR NULL,
   ASSIGNMENT_NAME VARCHAR NULL,
   VTIME BIGINT NOT NULL,
   ALARM VARCHAR NULL,
   STATUS VARCHAR NULL,
   LONGTITUDE VARCHAR NULL,
   LATITUDE VARCHAR NULL,
   ADDRESS VARCHAR NULL,
   HEIGHT VARCHAR NULL,
   RECORDER_SPEED VARCHAR NULL,
   SPEED VARCHAR NULL,
   ANGLE VARCHAR NULL,
   TEMPERTURE VARCHAR NULL,
   RESERVE VARCHAR NULL,
   GPS_MILE VARCHAR NULL,
   DEVICE_ID_ONE VARCHAR NULL,
   DEVICE_ID_TWO VARCHAR NULL,
   MESSAGE_LENGTH_ONE VARCHAR NULL,
   MESSAGE_LENGTH_TWO VARCHAR NULL,
   TOTAL_OILWEAR_ONE VARCHAR NULL,
   TOTAL_OILWEAR_TWO VARCHAR NULL,
   OILTANK_TEMPERATURE_ONE VARCHAR NULL,
   OILTANK_TEMPERATURE_TWO VARCHAR NULL,
   TRANSIENT_OILWEAR_ONE VARCHAR NULL,
   TRANSIENT_OILWEAR_TWO VARCHAR NULL,
   TOTAL_TIME_ONE VARCHAR NULL,
   TOTAL_TIME_TWO VARCHAR NULL,
   PLATE_NUMBER VARCHAR NULL,
   VEHICLE_TYPE VARCHAR NULL,
   FUEL_TYPE VARCHAR NULL,
   AIR_CONDITION_STATUS VARCHAR NULL,
   SATELLITE_NUMBER VARCHAR NULL,
   OIL_TANK_ID_ONE VARCHAR NULL,
   OIL_TANK_ID_TWO VARCHAR NULL,
   OIL_TANK_MSG_LENGTH_ONE VARCHAR NULL,
   OIL_TANK_MSG_LENGTH_TWO VARCHAR NULL,
   FUEL_TEM_ONE VARCHAR NULL,
   FUEL_TEM_TWO VARCHAR NULL,
   ENVIRONMENT_TEM_ONE VARCHAR NULL,
   ENVIRONMENT_TEM_TWO VARCHAR NULL,
   FUEL_AMOUNT_ONE VARCHAR NULL,
   FUEL_AMOUNT_TWO VARCHAR NULL,
   FUEL_SPILL_ONE VARCHAR NULL,
   FUEL_SPILL_TWO VARCHAR NULL,
   OIL_TANK_ONE VARCHAR NULL,
   OIL_TANK_TWO VARCHAR NULL,
   AD_HEIGHT_ONE VARCHAR NULL,
   OIL_HEIGHT_ONE VARCHAR NULL,
   AD_HEIGHT_TWO VARCHAR NULL,
   OIL_HEIGHT_TWO VARCHAR NULL,
   MILEAGE_SPEED DOUBLE NULL,
   MILEAGE_TOTAL DOUBLE NULL,
   WINCH_STATUS INTEGER NULL,
   WINCH_ORIENTATION INTEGER NULL,
   WINCH_SPEED INTEGER NULL,
   WINCH_TIME INTEGER NULL,
   WINCH_COUNTER INTEGER NULL,
   WINCH_ROTATE_TIME INTEGER NULL,
   TEMP_VALUE_ONE INTEGER NULL,
   TEMP_TIME_ONE INTEGER NULL,
   TEMP_HIGH_LOW_ONE INTEGER NULL,
   TEMP_VALUE_TWO INTEGER NULL,
   TEMP_TIME_TWO INTEGER NULL,
   TEMP_HIGH_LOW_TWO INTEGER NULL,
   TEMP_VALUE_THREE INTEGER NULL,
   TEMP_TIME_THREE INTEGER NULL,
   TEMP_HIGH_LOW_THREE INTEGER NULL,
   TEMP_VALUE_FOUR INTEGER NULL,
   TEMP_TIME_FOUR INTEGER NULL,
   TEMP_HIGH_LOW_FOUR INTEGER NULL,
   TEMP_VALUE_FIVE INTEGER NULL,
   TEMP_TIME_FIVE INTEGER NULL,
   TEMP_HIGH_LOW_FIVE INTEGER NULL,
   WETNESS_VALUE_ONE INTEGER NULL,
   WETNESS_TIME_ONE INTEGER NULL,
   WETNESS_HIGH_LOW_ONE INTEGER NULL,
   WETNESS_VALUE_TWO INTEGER NULL,
   WETNESS_TIME_TWO INTEGER NULL,
   WETNESS_HIGH_LOW_TWO INTEGER NULL,
   WETNESS_VALUE_THREE INTEGER NULL,
   WETNESS_TIME_THREE INTEGER NULL,
   WETNESS_HIGH_LOW_THREE INTEGER NULL,
   WETNESS_VALUE_FOUR INTEGER NULL,
   WETNESS_TIME_FOUR INTEGER NULL,
   WETNESS_HIGH_LOW_FOUR INTEGER NULL,
   UPLOAD_TIME VARCHAR NULL,
   BATTERY_ELECTRICITY INTEGER NULL,
   BATTERY_VOLTAGE INTEGER NULL,
   SIGNAL_STRENGTH INTEGER NULL,
   TERMINAL_VERSION VARCHAR NULL,
   LOCATION_TYPE INTEGER NULL,
   ABNORMITY_STATUS INTEGER NULL,
   ABNORMITY_TYPE INTEGER NULL,
   ABNORMITY_LEVEL INTEGER NULL,
   ABNORMITY_FATIGUE_TIME INTEGER NULL,
   ABNORMITY_MEDIA_TOTAL INTEGER NULL,
   ABNORMITY_MEDIA_INFO VARCHAR NULL,
   DRIVER_STATUS INTEGER NULL,
   DRIVER_TYPE INTEGER NULL,
   DRIVER_LEVEL INTEGER NULL,
   DRIVER_MEDIA_TOTAL INTEGER NULL,
   DRIVER_RESERVE_VALUE INTEGER NULL,
   DRIVER_MEDIA_INFO VARCHAR NULL,
   AIR_COMP_STATUS INTEGER NULL,
   ORIGINAL_LONGTITUDE VARCHAR NULL,
   ORIGINAL_LATITUDE VARCHAR NULL,
   ROAD_MARKINGS_TYPE INTEGER NULL,
   ROAD_MARKINGS_DATA INTEGER NULL,
   LIMITING_VELOCITY INTEGER NULL,
   IO_ONE INTEGER NULL,
   IO_TWO INTEGER NULL,
   IO_THREE INTEGER NULL,
   IO_FOUR INTEGER NULL,
   SIGNAL_STATE BIGINT NULL,
   WORK_INSPECTION_METHOD_ONE INTEGER NULL,
   WORKING_POSITION_ONE INTEGER NULL,
   CONTINUE_TIME_ONE BIGINT NULL,
   CHECK_DATA_ONE DOUBLE NULL,
   WORK_TOTAL_ONE BIGINT NULL, 
   STANDBY_TOTAL_ONE BIGINT NULL, 
   HALT_TOTAL_ONE BIGINT NULL, 
   IMPORTANT_DATA_ONE INTEGER NULL, 
   WORK_INSPECTION_METHOD_TWO INTEGER NULL, 
   WORKING_POSITION_TWO  INTEGER NULL, 
   CONTINUE_TIME_TWO BIGINT NULL, 
   CHECK_DATA_TWO DOUBLE NULL, 
   WORK_TOTAL_TWO BIGINT NULL, 
   STANDBY_TOTAL_TWO BIGINT NULL, 
   HALT_TOTAL_TWO BIGINT NULL, 
   IMPORTANT_DATA_TWO INTEGER NULL,
   PROTOCOL_TYPE VARCHAR NULL,
   SUB_PROTOCOL_TYPE VARCHAR NULL,
   SATELLITES_NUMBER VARCHAR NULL,
   USER_CODE VARCHAR NULL,
   KEEP1 INTEGER NULL,
   KEEP2 INTEGER NULL,
   ALARM_SIGN INTEGER NULL,
   WIFI_INFO VARCHAR NULL,
   STATION_INFO VARCHAR NULL,
   HUMIDITY_SIGN INTEGER NULL,
   TEMPERATURE_SIGN INTEGER NULL,
   OIL_WEAR_SIGN INTEGER NULL,
   OILMASS_SIGN INTEGER NULL,
   MONITOR_TYPE INTEGER NULL,
   IO_OBJ_ONE VARCHAR NULL,
   IO_OBJ_TWO VARCHAR NULL,
   LIQUID_ONE_OBJ VARCHAR NULL,
   LIQUID_TWO_OBJ VARCHAR NULL,
   LIQUID_THREE_OBJ VARCHAR NULL,
   LIQUID_FOUR_OBJ VARCHAR NULL,
   LIQUID_FIVE_OBJ VARCHAR NULL,
   LIQUID_SIX_OBJ VARCHAR NULL,
   LIQUID_SEVEN_OBJ VARCHAR NULL,
   LIQUID_EIGHT_OBJ VARCHAR NULL,
   FLUCTUATE_VALUE_ONE DOUBLE NULL,
   FLUCTUATE_VALUE_TWO DOUBLE NULL,
   LOAD_OBJ_ONE VARCHAR NULL,
   LOAD_OBJ_TWO VARCHAR NULL,
   OBD_OBJ VARCHAR NULL,
   PROVINCE VARCHAR NULL,
   OBD_ORIGINAL_VEHICLE_DATA VARCHAR NULL,
   OBD_TRIP_DATA VARCHAR NULL,
   TIRE_PRESSURE_PARAMETER VARCHAR NULL,
   TERMINAL_ALARM_SIGN INTEGER,
   AIR_PRESSURE BIGINT,
   VOLTAGE_VALID INTEGER,
   ACC_VALID INTEGER,
   TERMINAL_STATE INTEGER,
   LOCATION_PRECISION DOUBLE,
   ELECTRIC_TYPE INTEGER NULL,
   DEVICE_ELECTRIC DOUBLE NULL,
   DRIVING_ELECTRIC DOUBLE NULL,
   COLD_STORAGE DOUBLE NULL,
   COMMUNICATION_TYPE INTEGER NULL,
   OPERATOR INTEGER NULL,
   REFRIGERATION_TYPE INTEGER NULL,
   SCHEDULED_STATUS  VARCHAR NULL,
   WORK_STATUS VARCHAR NULL,
   VH DOUBLE NULL,
   VL DOUBLE NULL,
   START_VALUE DOUBLE NULL,
   STOP_VALUE DOUBLE NULL,
   LOCATION_STATUS TINYINT NULL,
   GROUP_NAME VARCHAR NULL,
   PROFESSIONALS_NAME VARCHAR NULL,
   PLATE_COLOR VARCHAR NULL,
   INVALID INTEGER NULL,
   RFID1D VARCHAR NULL,
   RFID1E VARCHAR NULL,
   RFID1F VARCHAR NULL,
   GROUP_ID VARCHAR NULL,
   GPS_ATTACH_INFO VARCHAR NULL,
   REISSUE INTEGER NULL
   CONSTRAINT PK PRIMARY KEY (VEHICLE_ID,VTIME)
) COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

CREATE INDEX POSITIONAL_INDEX ON POSITIONAL(VTIME) INCLUDE(LONGTITUDE,LATITUDE);


CREATE TABLE POSITION_INFO
(
   ID VARCHAR NULL,
   LONGTITUDE FLOAT NOT NULL,
   LATITUDE FLOAT NOT NULL,
   ADCODE VARCHAR NULL,
   BUILDING VARCHAR NULL,
   BUILDING_TYPE VARCHAR NULL,
   CITY VARCHAR NULL,
   CITY_CODE VARCHAR NULL,
   DISTRICT VARCHAR NULL,
   NEIGHBORHOOD VARCHAR NULL,
   NEIGHBORHOOD_TYPE VARCHAR NULL,
   PROVINCE VARCHAR NULL,
   STREET VARCHAR NULL,
   STREET_NUMBER VARCHAR NULL,
   TOWNSHIP VARCHAR NULL,
   CROSSES VARCHAR NULL,
   FORMATTED_ADDRESS VARCHAR NULL,
   POIS VARCHAR NULL,
   ROADS VARCHAR NULL,
   CONSTRAINT PK PRIMARY KEY (LONGTITUDE,LATITUDE)
);

CREATE TABLE POSITION_STATISTIC
(
  VEHICLE_ID BINARY(16) NOT NULL,
   ADDRESS VARCHAR NOT NULL,
   ADDR_COUNT INTEGER,
   LONGTITUDE_NORTH VARCHAR NULL,
   LATITUDE_NORTH VARCHAR NULL,
   LONGTITUDE_SOUTH VARCHAR NULL,
   LATITUDE_SOUTH VARCHAR NULL,
   LONGTITUDE_EAST VARCHAR NULL,
   LATITUDE_EAST VARCHAR NULL,
   LONGTITUDE_WEST VARCHAR NULL,
   LATITUDE_WEST VARCHAR NULL,
   CONSTRAINT PK PRIMARY KEY (VEHICLE_ID,ADDRESS)
);

CREATE TABLE VEHICLE_ONLINE_MONTH
(
   ID VARCHAR NULL,
   VEHICLE_ID BINARY(16) NOT NULL,
   GROUP_ID BINARY(16) NOT NULL,
   MONTH_DATE BIGINT NOT NULL,
   DAY1 INTEGER NULL,
   DAY2 INTEGER NULL,
   DAY3 INTEGER NULL,
   DAY4 INTEGER NULL,
   DAY5 INTEGER NULL,
   DAY6 INTEGER NULL,
   DAY7 INTEGER NULL,
   DAY8 INTEGER NULL,
   DAY9 INTEGER NULL,
   DAY10 INTEGER NULL,
   DAY11 INTEGER NULL,
   DAY12 INTEGER NULL,
   DAY13 INTEGER NULL,
   DAY14 INTEGER NULL,
   DAY15 INTEGER NULL,
   DAY16 INTEGER NULL,
   DAY17 INTEGER NULL,
   DAY18 INTEGER NULL,
   DAY19 INTEGER NULL,
   DAY20 INTEGER NULL,
   DAY21 INTEGER NULL,
   DAY22 INTEGER NULL,
   DAY23 INTEGER NULL,
   DAY24 INTEGER NULL,
   DAY25 INTEGER NULL,
   DAY26 INTEGER NULL,
   DAY27 INTEGER NULL,
   DAY28 INTEGER NULL,
   DAY29 INTEGER NULL,
   DAY30 INTEGER NULL,
   DAY31 INTEGER NULL,
   GROUP_NAME VARCHAR(64),
   PLATE_COLOR VARCHAR(64),
   VEHICLE_TYPE VARCHAR(64),
   MONITOR_NAME VARCHAR(64),
   CONSTRAINT PK PRIMARY KEY (VEHICLE_ID,GROUP_ID,MONTH_DATE)
) COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

CREATE TABLE VEHICLE_MILE_MONTH
(
   ID VARCHAR NULL,
   VEHICLE_ID BINARY(16) NOT NULL,
   GROUP_ID BINARY(16) NOT NULL,
   MONTH_DATE BIGINT NOT NULL,
   DAY1 DOUBLE NULL,
   DAY2 DOUBLE NULL,
   DAY3 DOUBLE NULL,
   DAY4 DOUBLE NULL,
   DAY5 DOUBLE NULL,
   DAY6 DOUBLE NULL,
   DAY7 DOUBLE NULL,
   DAY8 DOUBLE NULL,
   DAY9 DOUBLE NULL,
   DAY10 DOUBLE NULL,
   DAY11 DOUBLE NULL,
   DAY12 DOUBLE NULL,
   DAY13 DOUBLE NULL,
   DAY14 DOUBLE NULL,
   DAY15 DOUBLE NULL,
   DAY16 DOUBLE NULL,
   DAY17 DOUBLE NULL,
   DAY18 DOUBLE NULL,
   DAY19 DOUBLE NULL,
   DAY20 DOUBLE NULL,
   DAY21 DOUBLE NULL,
   DAY22 DOUBLE NULL,
   DAY23 DOUBLE NULL,
   DAY24 DOUBLE NULL,
   DAY25 DOUBLE NULL,
   DAY26 DOUBLE NULL,
   DAY27 DOUBLE NULL,
   DAY28 DOUBLE NULL,
   DAY29 DOUBLE NULL,
   DAY30 DOUBLE NULL,
   DAY31 DOUBLE NULL,
   GROUP_NAME VARCHAR(64),
   PLATE_COLOR VARCHAR(64),
   VEHICLE_TYPE VARCHAR(64),
   MONITOR_NAME VARCHAR(64),
   CONSTRAINT PK PRIMARY KEY (VEHICLE_ID,GROUP_ID,MONTH_DATE)
) COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));


CREATE TABLE RISK_VISIT (
   ID VARCHAR,
   RISK_ID BINARY(16) NOT NULL,
   ISVISIT TINYINT,
   TIME BIGINT ,
   ACCURACY INTEGER,
   INTERVENTION INTEGER,
   COOPERATION INTEGER,
   WARN_STATUS INTEGER,
   WARN_LEVEL INTEGER,
   CONTENT VARCHAR,
   REASON VARCHAR,
   VISIT_ORDER TINYINT,
   DRIVER_ID VARCHAR,
   DRIVER_NAME VARCHAR,
   CREATE_TIME BIGINT NOT NULL,
   CREATE_USER VARCHAR,
   CONSTRAINT PK PRIMARY KEY (RISK_ID, CREATE_TIME )
)COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));


CREATE TABLE RISK_MEDIA (
   ID BINARY(16) NOT NULL,
   MEDIA_ID BIGINT,
   RISK_ID VARCHAR,
   RISK_EVENT_ID VARCHAR,
   RISK_NUMBER VARCHAR,
   EVENT_NUMBER VARCHAR,
   VEHICLE_ID VARCHAR,
   VISIT_ID VARCHAR,
   TYPE TINYINT,
   NAME VARCHAR,
   URL VARCHAR,
   FORMAT_CODE INTEGER,
   EVENT_CODE TINYINT,
   CHANNEL_ID TINYINT,
   BRAND VARCHAR,
   SOURCE TINYINT,
   EVENT_ID INTEGER,
   RISK_TIME BIGINT,
   ADDRESS VARCHAR,
   RISK_TYPE VARCHAR,
   CREATE_TIME BIGINT,
   CREATE_USER VARCHAR,
   PROTOCOL_TYPE TINYINT,
   DEALER VARCHAR,
   RESULT TINYINT,
   RISK_LEVEL TINYINT,
   DEAL_STATUS TINYINT,
   DRIVER_NAME VARCHAR,
   FILE_SIZE BIGINT,
   CONSTRAINT PK PRIMARY KEY (ID)
)COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

CREATE TABLE RISK_EVENT (
   ID BINARY(16) NOT NULL,
   NUMBER VARCHAR,
   EVENT_ID VARCHAR,
   VEHICLE_ID VARCHAR,
   BRAND VARCHAR,
   TIME BIGINT,
   RISK_ID VARCHAR,
   RISK_NUMBER VARCHAR,
   MEDIA_ID VARCHAR,
   MEDIA_NAME VARCHAR,
   MEDIA_URL VARCHAR,
   WARN_ID INTEGER,
   SENSOR_ID TINYINT,
   STATUS TINYINT,
   TYPE TINYINT,
   LEVEL TINYINT,
   SIGN_TYPE TINYINT,
   SIGN_DATA INTEGER,
   FATIGUE_LEVEL INTEGER,
   SPEED_LIMIT INTEGER,
   FRONT_SPEED DOUBLE,
   FRONT_DISTANCE DOUBLE,
   DEVIATION TINYINT,
   SPEED DOUBLE,
   ALTITUDE INTEGER,
   LATITUDE DOUBLE,
   LONGITUDE DOUBLE,
   WARN_TIME BIGINT,
   VEHICLE_STATUS INTEGER,
   KEEP INTEGER,
   MEDIA_TOTAL INTEGER,
   CREATE_TIME BIGINT,
   CREATE_USER VARCHAR,
   VISIT_TIMES BIGINT,
   RESULT TINYINT,
   RISK_TYPE VARCHAR,
   DRIVER_ID VARCHAR,
   DEALER VARCHAR,
   DRIVER_NAME VARCHAR,
   RISK_LEVEL TINYINT,
   ADDRESS VARCHAR,
   RISK_SPEED DOUBLE,
   JOB VARCHAR,
   DEAL_STATUS TINYINT,
   RISK_TIME BIGINT,
   DEAL_TIME BIGINT,
   FILE_TIME BIGINT,
   VIDEO_FLAG TINYINT,
   PIC_FLAG TINYINT,
   WEATHER VARCHAR,
   oversee_status TINYINT,
   transportation TINYINT,
   MULTIMEDIA_NUMBER INTEGER,
   SEQUENCE_NUMBER INTEGER,
   attachment_status TINYINT,
   MEDIA_INFO VARCHAR,
   PLATEFORM_ID varchar,
   MSG_SN varchar,
   ORIGINAL_LONGITUDE DOUBLE,
   ORIGINAL_LATITUDE DOUBLE,
   DRIVER_NO varchar,
   DIRECTION DOUBLE,
   GRAPHER_SPEED DOUBLE,
   INFO_CONTENT VARCHAR,
   HANDLE_TYPE VARCHAR,
   REMARK VARCHAR,
   PLATE_COLOR tinyint,
   ROAD_TYPE INTEGER,
   ROAD_LIMIT_SPEED DOUBLE,
   alarm_id varchar,
   DRV_LINE_ID INTEGER,
   PROTOCOL_TYPE INTEGER NULL,
   IS_REMIND_DRIVER INTEGER NULL,
   LIMIT_SPEED INTEGER NULL,
   ACTUAL_LOAD INTEGER NULL,
   LIMITED_LOAD INTEGER NULL
   CONSTRAINT PK PRIMARY KEY (ID)
)COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

CREATE TABLE RISK (
   ID BINARY(16) NOT NULL,
   NUMBER VARCHAR,
   VEHICLE_ID VARCHAR,
   BRAND VARCHAR,
   PLATE_COLOR TINYINT,
   LEVEL TINYINT,
   TYPE VARCHAR,
   WARNING_TIME BIGINT ,
   STATUS TINYINT ,
   COORDINATE VARCHAR,
   ADDRESS VARCHAR,
   SPEED DOUBLE,
   DEAL_ID VARCHAR,
   DRIVER_ID VARCHAR,
   JOB VARCHAR,
   FILE_TIME BIGINT,
   DEAL_TIME BIGINT,
   RESULT TINYINT,
   VISIT1 VARCHAR,
   VISIT2 VARCHAR,
   VISIT3 VARCHAR,
   VISIT4 VARCHAR,
   LAST_VISIT_TIME BIGINT,
   DRIVER_NAMES VARCHAR,
   CREATE_TIME BIGINT,
   CREATE_USER VARCHAR,
   UPDATE_TIME BIGINT,
   UPDATE_USER VARCHAR,
   VISIT_TIMES TINYINT,
   MEDIA_NAME VARCHAR,
   MEDIA_URL VARCHAR,
   DEVICE_NUMBER VARCHAR,
   VIDEO_FLAG TINYINT,
   PIC_FLAG TINYINT,
   WEATHER VARCHAR,
   oversee_status TINYINT,
   transportation TINYINT,
   certification_code varchar(24),
   deal_dead_time bigint,
   ACCURACY TINYINT,
   DRIVER_STATUS TINYINT,
   INTERVENTION TINYINT,
   COOPERATION TINYINT,
   WARN_STATUS TINYINT,
   OTHER VARCHAR,
   HANDLE_TYPE VARCHAR,
   BUSINESS_SCOPE VARCHAR,
   DEAL_PEOPLE_ID VARCHAR,
   DEAL_ORG_ID VARCHAR,
   DEAL_ORG_NAME VARCHAR
   CONSTRAINT PK PRIMARY KEY (ID)
)COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));


-- 主动安全车辆上线报表相关的HBASE表结构
CREATE TABLE VEHICLE_ONLINE_STAT (
    VEHICLE_ID BINARY(16) NOT NULL,
    DATE BIGINT NOT NULL,
    ADAS_CNT INTEGER,
    LAST_TIME BIGINT,
    LAST_LAT DOUBLE,
    LAST_LON DOUBLE,
    ADDRESS VARCHAR
    CONSTRAINT PK PRIMARY KEY (VEHICLE_ID, DATE)
)COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));


CREATE TABLE TRAVLLED_DISTANCE_REPORT
(
   MONITOR_ID BINARY(16) NOT NULL,
   DAY BIGINT NOT NULL,
   MONITOR_NAME VARCHAR(64) NULL,
   PLATE_COLOR VARCHAR(64) NULL,
   MILEAGE DOUBLE NULL,
   OIL_WEAR DOUBLE NULL,
   TRAVEL_TIME BIGINT NULL,
   TRAVEL_NUM INTEGER NULL,
   GROUP_NAME VARCHAR(64) NULL,
   ASSIGNMENT_NAME VARCHAR(64) NULL,
   MONITOR_TYPE VARCHAR(10) NULL
   CONSTRAINT PK PRIMARY KEY (MONITOR_ID,DAY)
)
BLOOMFILTER=NONE,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('7F','HEX'));


CREATE TABLE GROUP_VEH_ONLINE (
  GROUP_ID BINARY(16) NOT NULL,
  TIME BIGINT NOT NULL,
  VEHICLE_ID BINARY(16) NOT NULL,
  flag TINYINT ,
  CONSTRAINT PK PRIMARY KEY (GROUP_ID,TIME,VEHICLE_ID)
)COMPRESSION='snappy' SPLIT ON (decode('0F','HEX'),decode('1F','HEX'),decode('2F','HEX'),decode('3F','HEX'),decode('4F','HEX'),decode('5F','HEX'),decode('6F','HEX'),decode('7F','HEX'),decode('8F','HEX'),decode('9F','HEX'),decode('AF','HEX'),decode('BF','HEX'),decode('CF','HEX'),decode('DF','HEX'),decode('EF','HEX'));


CREATE TABLE ALARM_FORWARD_INFO
(
TIME BIGINT NOT NULL,
MSG_SN BIGINT NOT NULL,
MSG_ID INTEGER NOT NULL,
PLAT_ID BINARY(16) NOT NULL,
MONITOR_ID VARCHAR(64) NULL,
MONITOR_NAME VARCHAR(64) NULL,
PLATE_COLOR TINYINT NULL,
GROUP_ID VARCHAR(64) NULL,
ALARM_TYPE INTEGER NULL,
ALARM_START_TIME BIGINT NULL,
RISK_EVENT_ID VARCHAR(64),
PROTOCOL_TYPE INTEGER,
ALARM_ID VARCHAR NULL,
CONSTRAINT PK PRIMARY KEY (TIME,MSG_SN,MSG_ID,PLAT_ID)
);


CREATE TABLE ALARM_FORWARD_INFO_MIDDLE
(
MONITOR_ID BINARY(16) NOT NULL,
TIME BIGINT NOT NULL,
ALARM_TYPE INTEGER NOT NULL,
PLAT_ID BINARY(16) NOT NULL,
STATUS TINYINT NULL,
MSG_SN BIGINT NULL,
MSG_ID INTEGER NULL,
ALARM_START_TIME BIGINT NULL,
RISK_EVENT_ID VARCHAR(64),
PROTOCOL_TYPE INTEGER,
ALARM_ID VARCHAR NULL,
REPORT_FLAG INTEGER NULL,
FAILURE_FLAG INTEGER NULL,
GROUP_ID VARCHAR NULL,
GROUP_NAME VARCHAR NULL,
WARN_SRC INTEGER NULL
CONSTRAINT PK PRIMARY KEY (MONITOR_ID,TIME,ALARM_TYPE,PLAT_ID)
)TTL=604800,COMPRESSION='snappy' SPLIT ON (decode('0F','HEX'),decode('1F','HEX'),decode('2F','HEX'),decode('3F','HEX'),decode('4F','HEX'),decode('5F','HEX'),decode('6F','HEX'),decode('7F','HEX'),decode('8F','HEX'),decode('9F','HEX'),decode('AF','HEX'),decode('BF','HEX'),decode('CF','HEX'),decode('DF','HEX'),decode('EF','HEX'));


-- APP最后一次报警表
CREATE TABLE LAST_ALARM_HANDLE
(  ID VARCHAR  NULL,
   VEHICLE_ID  BINARY(16) NOT NULL,
   ALARM_START_TIME BIGINT NULL,
   PLATE_NUMBER VARCHAR NULL,
   ALARM_START_LOCATION VARCHAR NULL,
   MONITOR_TYPE INTEGER NULL,
   CONSTRAINT PK PRIMARY KEY (VEHICLE_ID)
)TTL=86400,COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

CREATE TABLE DRIVER_STATISTICS
(
  CARD_NUMBER VARCHAR NOT NULL,
  INSERT_CARD_TIME BIGINT NOT NULL,
  MONITOR_ID VARCHAR NULL,
  TRAVEL_START_TIME VARCHAR NULL,
  TRAVEL_END_TIME VARCHAR NULL,
  TRAVEL_START_MILE VARCHAR  NULL,
  TRAVEL_END_MILE VARCHAR NULL,
  ZERO_TIME_MILE DOUBLE NULL,
  REST_START_TIME VARCHAR  NULL,
  REST_END_TIME VARCHAR  NULL,
  DRIVER_NAME VARCHAR NULL,
  MONITOR_NAME VARCHAR NULL,
  GROUP_ID VARCHAR NULL,
  REMOVE_CARD_TIME BIGINT NULL,
  CONSTRAINT PK PRIMARY KEY (CARD_NUMBER,INSERT_CARD_TIME)
) TTL=5184000,COMPRESSION='SNAPPY' SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

-- ISSUE_MESSAGE_DETAIL（下发消息统计明细表）.xlsx
CREATE TABLE ISSUE_MESSAGE_DETAIL
(
    ISSUE_TIME BIGINT NOT NULL,
    ISSUE_TYPE TINYINT NOT NULL,
    ISSUE_STATUS TINYINT NOT NULL,
    MONITOR_ID BINARY(16) NOT NULL,
    PLAY_TYPE VARCHAR NULL,
    MONITOR_NAME VARCHAR NULL,
    PLATE_COLOR SMALLINT NULL,
    MONITOR_TYPE VARCHAR NULL,
    GROUP_NAME VARCHAR NULL,
    ISSUE_PEOPLE VARCHAR NULL,
    MESSAGE_INFO VARCHAR NULL,
    MSG_ID INTEGER NULL,
    FAIL_REASON VARCHAR NULL
    CONSTRAINT PK PRIMARY KEY (ISSUE_TIME,ISSUE_TYPE,ISSUE_STATUS,MONITOR_ID)
)
    BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));



-- LOCATION_STATS_DETAIL（定位统计明细表）.xlsx
CREATE TABLE LOCATION_STATS_DETAIL
(
    DAY BIGINT NOT NULL,
    MONITOR_ID BINARY(16) NOT NULL,
    MONITOR_NAME VARCHAR NULL,
    PLATE_COLOR SMALLINT NULL,
    MONITOR_TYPE VARCHAR NULL,
    GROUP_NAME VARCHAR NULL,
    TOTAL INTEGER NULL,
    INVALID INTEGER NULL,
    INTERRUPT INTEGER NULL,
    OFFLINE_DISPLACE INTEGER NULL,
    POS_VALID INTEGER NULL,
    POS_INVALID INTEGER NULL,
    POS_TOTAL INTEGER NULL
    CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID)
)
    BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

-- LAST_VALID_LOCATION（最后一条有效定位表）.xlsx
CREATE TABLE LAST_VALID_LOCATION
(
    MONITOR_ID BINARY(16) NOT NULL,
    MONITOR_NAME VARCHAR NULL,
    PLATE_COLOR SMALLINT NULL,
    MONITOR_TYPE VARCHAR NULL,
    GROUP_NAME VARCHAR NULL,
    LAST_LOCATION VARCHAR NULL,
    LAST_TIME BIGINT NULL
        CONSTRAINT PK PRIMARY KEY (MONITOR_ID)
)
    BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

-- LAST_VALID_LOCATION_OFFLINE（最后一条有效定位表（离线统计用））.xlsx
CREATE TABLE LAST_VALID_LOCATION_OFFLINE
(
    DAY BIGINT NOT NULL,
    MONITOR_ID BINARY(16) NOT NULL,
    MONITOR_NAME VARCHAR NULL,
    PLATE_COLOR SMALLINT NULL,
    MONITOR_TYPE VARCHAR NULL,
    GROUP_NAME VARCHAR NULL,
    LAST_LOCATION VARCHAR NULL,
    LAST_TIME BIGINT NULL,
    LAST_SPEED VARCHAR NULL
    CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID)
)
    BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

-- LOCATION_INTERRUPT_DETAIL（定位中断明细表）.xlsx
CREATE TABLE LOCATION_INTERRUPT_DETAIL
(
    START_TIME BIGINT NOT NULL,
    MONITOR_ID BINARY(16) NOT NULL,
    MONITOR_NAME VARCHAR NULL,
    PLATE_COLOR SMALLINT NULL,
    MONITOR_TYPE VARCHAR NULL,
    GROUP_NAME VARCHAR NULL,
    INTERRUPT_TIME BIGINT NULL,
    END_TIME BIGINT NULL,
    START_LOCATION VARCHAR NULL,
    END_LOCATION VARCHAR NULL
        CONSTRAINT PK PRIMARY KEY (START_TIME,MONITOR_ID)
)
    BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('7F','HEX'),DECODE('BF','HEX'));

-- OFFLINE_DISPLACE_DETAIL（离线位移明细表）.xlsx
CREATE TABLE OFFLINE_DISPLACE_DETAIL
(
    END_TIME BIGINT NOT NULL,
    MONITOR_ID BINARY(16) NOT NULL,
    MONITOR_NAME VARCHAR NULL,
    PLATE_COLOR SMALLINT NULL,
    MONITOR_TYPE VARCHAR NULL,
    GROUP_NAME VARCHAR NULL,
    START_TIME BIGINT NULL,
    DISPLACE_MILE DOUBLE NULL,
    speed VARCHAR NULL,
    level VARCHAR NULL,
    data_status VARCHAR NULL,
    monitor_process VARCHAR NULL,
    remark VARCHAR NULL,
    end_lonlat VARCHAR NULL,
    start_lonlat VARCHAR NULL
        CONSTRAINT PK PRIMARY KEY (END_TIME,MONITOR_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('7F','HEX'),DECODE('BF','HEX'));

-- VIDEO_POLLING_DETAIL（视频巡检明细表）.xlsx
CREATE TABLE VIDEO_POLLING_DETAIL
(
    START_TIME BIGINT NOT NULL,
    STATUS TINYINT NOT NULL,
    CHANNEL_NUM SMALLINT NOT NULL,
    MONITOR_ID BINARY(16) NOT NULL,
    MONITOR_NAME VARCHAR NULL,
    PLATE_COLOR SMALLINT NULL,
    MONITOR_TYPE VARCHAR NULL,
    GROUP_NAME VARCHAR NULL,
    FAIL_REASON VARCHAR NULL
        CONSTRAINT PK PRIMARY KEY (START_TIME,STATUS,CHANNEL_NUM,MONITOR_ID)
)
    BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('0F','HEX'),DECODE('1F','HEX'),DECODE('2F','HEX'),DECODE('3F','HEX'),DECODE('4F','HEX'),DECODE('5F','HEX'),DECODE('6F','HEX'),DECODE('7F','HEX'),DECODE('8F','HEX'),DECODE('9F','HEX'),DECODE('AF','HEX'),DECODE('BF','HEX'),DECODE('CF','HEX'),DECODE('DF','HEX'),DECODE('EF','HEX'));

-- 疲劳-企业-月统计
CREATE TABLE tire_org_month(
 org_id BINARY(16) not null,
 day bigint not null,
 org_name VARCHAR ,
 cnt_sum integer,
 cnt_day integer,
 cnt_night integer,
 cnt_acc integer,
 rank integer ,
 cnt_monitor integer,
 TIRE_TIME BIGINT
 CONSTRAINT PK PRIMARY KEY (org_id,day)
)COLUMN_ENCODED_BYTES= 0,
COMPRESSION='SNAPPY';

-- 疲劳-车-月统计
CREATE TABLE tire_monitor_month(
 monitor_id BINARY(16) not null,
 day bigint not null,
 monitor_name varchar ,
 org_id BINARY(16) ,
 org_name VARCHAR ,
 PLATE_COLOR VARCHAR,
 vehicle_Type varchar,
 cnt_sum integer,
 cnt_day integer,
 cnt_night integer,
 cnt_acc integer,
 rank integer,
 TIRE_TIME BIGINT
 CONSTRAINT PK PRIMARY KEY (monitor_id,day)
)COLUMN_ENCODED_BYTES= 0,
COMPRESSION='SNAPPY';

-- 疲劳-车-月统计(企业主键)
CREATE TABLE tire_monitor_month_by_org(
 org_id BINARY(16) not null,
 day bigint not null,
 monitor_id BINARY(16) not null,
 monitor_name varchar ,
 org_name VARCHAR ,
 PLATE_COLOR VARCHAR,
 vehicle_Type varchar,
 cnt_sum integer,
 cnt_day integer,
 cnt_night integer,
 cnt_acc integer,
 rank integer,
 TIRE_TIME BIGINT NULL
 CONSTRAINT PK PRIMARY KEY (org_id,day,monitor_id)
)COLUMN_ENCODED_BYTES= 0,
COMPRESSION='SNAPPY';

-- 超速-企业-月统计
CREATE TABLE overspeed_org_month(
 org_id BINARY(16) not null,
 day bigint not null,
 org_name VARCHAR ,
 cnt_sum integer,
 cnt_p_20_t_5 integer,
 cnt_p_20_t_10 integer,
 cnt_p_20_t_max integer,
 cnt_p_50_t_5 integer,
 cnt_p_50_t_10 integer,
 cnt_p_50_t_max integer,
 cnt_p_max_5 integer,
 cnt_p_max_10 integer,
 cnt_p_max_t_max integer,
 rank integer ,
 cnt_monitor integer,
 CONSTRAINT PK PRIMARY KEY (org_id,day)
)COLUMN_ENCODED_BYTES= 0,
COMPRESSION='SNAPPY';

-- 超速-车-月统计
CREATE TABLE overspeed_monitor_month(
 monitor_id BINARY(16) not null,
 day bigint not null,
 monitor_name varchar,
 org_id BINARY(16) ,
 org_name VARCHAR ,
 PLATE_COLOR VARCHAR,
 vehicle_Type varchar,
 cnt_sum integer,
 cnt_p_20_t_5 integer,
 cnt_p_20_t_10 integer,
 cnt_p_20_t_max integer,
 cnt_p_50_t_5 integer,
 cnt_p_50_t_10 integer,
 cnt_p_50_t_max integer,
 cnt_p_max_5 integer,
 cnt_p_max_10 integer,
 cnt_p_max_t_max integer,
 rank integer ,
 CONSTRAINT PK PRIMARY KEY (monitor_id,day)
)COLUMN_ENCODED_BYTES= 0,
COMPRESSION='SNAPPY';

-- 超速-车-月统计(企业主键)
CREATE TABLE overspeed_monitor_month_by_org(
 org_id BINARY(16) not null ,
 day bigint not null,
 monitor_id BINARY(16) not null,
 monitor_name varchar ,
 org_name VARCHAR ,
 PLATE_COLOR VARCHAR,
 vehicle_Type varchar,
 cnt_sum integer,
 cnt_p_20_t_5 integer,
 cnt_p_20_t_10 integer,
 cnt_p_20_t_max integer,
 cnt_p_50_t_5 integer,
 cnt_p_50_t_10 integer,
 cnt_p_50_t_max integer,
 cnt_p_max_5 integer,
 cnt_p_max_10 integer,
 cnt_p_max_t_max integer,
 rank integer ,
 CONSTRAINT PK PRIMARY KEY (org_id,day,monitor_id)
)COLUMN_ENCODED_BYTES= 0,
COMPRESSION='SNAPPY';

--车辆与终端运行状态信息表
CREATE TABLE 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 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');

--4.3.7版本更新
--企业信息统计月表
CREATE TABLE GROUP_INFO_STATS_MONTH( 
 MONTH BIGINT NOT NULL,
 GROUP_ID BINARY(16) NOT NULL,
 MONITOR_NUM INTEGER,
 GROUP_NAME VARCHAR,
 ACCESS_NUM INTEGER,
 UPLINE_NUM INTEGER,
 ACCESS_RATE DOUBLE,
 UPLINE_RATE DOUBLE,
 TRACK_FULL_RATE DOUBLE,
 POSITIONAL_PASS_RATE DOUBLE,
 DRIFT_RATE DOUBLE,
 OVER_SPEED_NUM INTEGER,
 FATIGUE_DURATION BIGINT
 CONSTRAINT PK PRIMARY KEY (MONTH,GROUP_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

--监控对象在线时长统计表
CREATE TABLE MONITOR_ONLINE_MONTH
(
   MONTH BIGINT NOT NULL,
   MONITOR_ID BINARY(16) NOT NULL,
   GROUP_NAME VARCHAR,
   PLATE_COLOR VARCHAR,
   VEHICLE_TYPE VARCHAR,
   MONITOR_NAME VARCHAR,
   DAY1 INTEGER NULL,
   DAY2 INTEGER NULL,
   DAY3 INTEGER NULL,
   DAY4 INTEGER NULL,
   DAY5 INTEGER NULL,
   DAY6 INTEGER NULL,
   DAY7 INTEGER NULL,
   DAY8 INTEGER NULL,
   DAY9 INTEGER NULL,
   DAY10 INTEGER NULL,
   DAY11 INTEGER NULL,
   DAY12 INTEGER NULL,
   DAY13 INTEGER NULL,
   DAY14 INTEGER NULL,
   DAY15 INTEGER NULL,
   DAY16 INTEGER NULL,
   DAY17 INTEGER NULL,
   DAY18 INTEGER NULL,
   DAY19 INTEGER NULL,
   DAY20 INTEGER NULL,
   DAY21 INTEGER NULL,
   DAY22 INTEGER NULL,
   DAY23 INTEGER NULL,
   DAY24 INTEGER NULL,
   DAY25 INTEGER NULL,
   DAY26 INTEGER NULL,
   DAY27 INTEGER NULL,
   DAY28 INTEGER NULL,
   DAY29 INTEGER NULL,
   DAY30 INTEGER NULL,
   DAY31 INTEGER NULL
   CONSTRAINT PK PRIMARY KEY (MONTH,MONITOR_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY' 
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--企业在线时长统计表
CREATE TABLE GROUP_ONLINE_MONTH
(
   MONTH BIGINT NOT NULL,
   GROUP_ID BINARY(16) NOT NULL,
   GROUP_NAME VARCHAR NULL,
   DAY1 INTEGER NULL,
   DAY2 INTEGER NULL,
   DAY3 INTEGER NULL,
   DAY4 INTEGER NULL,
   DAY5 INTEGER NULL,
   DAY6 INTEGER NULL,
   DAY7 INTEGER NULL,
   DAY8 INTEGER NULL,
   DAY9 INTEGER NULL,
   DAY10 INTEGER NULL,
   DAY11 INTEGER NULL,
   DAY12 INTEGER NULL,
   DAY13 INTEGER NULL,
   DAY14 INTEGER NULL,
   DAY15 INTEGER NULL,
   DAY16 INTEGER NULL,
   DAY17 INTEGER NULL,
   DAY18 INTEGER NULL,
   DAY19 INTEGER NULL,
   DAY20 INTEGER NULL,
   DAY21 INTEGER NULL,
   DAY22 INTEGER NULL,
   DAY23 INTEGER NULL,
   DAY24 INTEGER NULL,
   DAY25 INTEGER NULL,
   DAY26 INTEGER NULL,
   DAY27 INTEGER NULL,
   DAY28 INTEGER NULL,
   DAY29 INTEGER NULL,
   DAY30 INTEGER NULL,
   DAY31 INTEGER NULL
   CONSTRAINT PK PRIMARY KEY (MONTH,GROUP_ID)
) 
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY' 
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--行政区划在线时长统计表
CREATE TABLE AREA_ONLINE_MONTH
(
   MONTH BIGINT NOT NULL,
   PROVINCE_ID VARCHAR NOT NULL,
   CITY_ID VARCHAR NOT NULL,
   COUNTY_ID VARCHAR NOT NULL,
   PROVINCE VARCHAR NULL,
   CITY VARCHAR NULL,
   COUNTY VARCHAR NULL,
   DAY1 INTEGER NULL,
   DAY2 INTEGER NULL,
   DAY3 INTEGER NULL,
   DAY4 INTEGER NULL,
   DAY5 INTEGER NULL,
   DAY6 INTEGER NULL,
   DAY7 INTEGER NULL,
   DAY8 INTEGER NULL,
   DAY9 INTEGER NULL,
   DAY10 INTEGER NULL,
   DAY11 INTEGER NULL,
   DAY12 INTEGER NULL,
   DAY13 INTEGER NULL,
   DAY14 INTEGER NULL,
   DAY15 INTEGER NULL,
   DAY16 INTEGER NULL,
   DAY17 INTEGER NULL,
   DAY18 INTEGER NULL,
   DAY19 INTEGER NULL,
   DAY20 INTEGER NULL,
   DAY21 INTEGER NULL,
   DAY22 INTEGER NULL,
   DAY23 INTEGER NULL,
   DAY24 INTEGER NULL,
   DAY25 INTEGER NULL,
   DAY26 INTEGER NULL,
   DAY27 INTEGER NULL,
   DAY28 INTEGER NULL,
   DAY29 INTEGER NULL,
   DAY30 INTEGER NULL,
   DAY31 INTEGER NULL
   CONSTRAINT PK PRIMARY KEY (MONTH,PROVINCE_ID,CITY_ID,COUNTY_ID)
) 
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY' 
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--平台连接信息表
CREATE TABLE PLAT_CONNECT_INFO
(
 LINK_TIME BIGINT NOT NULL,
 PLATFORM_ID BINARY(16) NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 LINK_TYPE INTEGER NULL,
 LINK_STATUS INTEGER NULL,
 SOURCE_TYPE INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (LINK_TIME,PLATFORM_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON ('30','70');

--平台连接情况统计月表
CREATE TABLE PLAT_CONNECT_STATS_MONTH
(
 MONTH BIGINT NOT NULL,
 PLATFORM_ID BINARY(16) NOT NULL,
 LINK_TYPE INTEGER NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 CREATE_TIME BIGINT NULL,
 STATS_DAYS INTEGER NULL,
 ONLINE_DURATION INTEGER NULL,
 INTERRUPT_NUM INTEGER NULL,
 INTERRUPT_DURATION INTEGER NULL,
 ONLINE_RATE DOUBLE NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,PLATFORM_ID,LINK_TYPE)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--监控对象途经点明细表
CREATE TABLE MONITOR_PASS_POINT_DETAIL
(
 MONITOR_ID BINARY(16) NOT NULL,
 PASS_TIME BIGINT NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 PASS_ID VARCHAR NULL,
 PASS_NAME VARCHAR NULL,
 GROUP_ID VARCHAR NULL,
 GROUP_NAME VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,PASS_TIME)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--监控对象途经点统计日表
CREATE TABLE MONITOR_PASS_POINT_STATS
(
 MONITOR_ID BINARY(16) NOT NULL,
 DAY BIGINT NOT NULL,
 PASS_ID BINARY(16) NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 PASS_NAME VARCHAR NULL,
 PASS_NUM BIGINT NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,DAY,PASS_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--企业途经点统计日表
CREATE TABLE GROUP_PASS_POINT_STATS
(
 GROUP_ID BINARY(16) NOT NULL,
 DAY BIGINT NOT NULL,
 PASS_ID BINARY(16) NOT NULL,
 GROUP_NAME VARCHAR NULL,
 PASS_NAME VARCHAR NULL,
 PASS_NUM BIGINT NULL
 CONSTRAINT PK PRIMARY KEY (GROUP_ID,DAY,PASS_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--企业漏报报警统计表
CREATE TABLE GROUP_FAILURE_ALARM_STATS
(
 DAY BIGINT NOT NULL,
 GROUP_ID BINARY(16) NOT NULL,
 GROUP_NAME VARCHAR NULL,
 LINE_DEVIATE BIGINT NULL,
 NOT_FOLLOW_LINE BIGINT NULL,
 OUT_AREA BIGINT NULL,
 ENTER_AREA BIGINT NULL,
 OVER_SPEED BIGINT NULL,
 DRIVER_IDENTITY BIGINT NULL,
 FATIGUE BIGINT NULL
 CONSTRAINT PK PRIMARY KEY (DAY,GROUP_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--4.4.1版本更新
--监控对象路线偏离统计月表
CREATE TABLE LINE_DEVIATE_MONITOR_MONTH
(
 MONITOR_ID BINARY(16) NOT NULL,
 MONTH BIGINT NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 ORG_ID VARCHAR NULL,
 ORG_NAME VARCHAR NULL,
 PLATE_COLOR INTEGER NULL,
 VEHICLE_TYPE VARCHAR NULL,
 CNT_DEVIATE INTEGER NULL,
 CNT_FOLLOW INTEGER NULL,
 CNT_SUM INTEGER NULL,
 RANK INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,MONTH)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

--监控对象企业关联统计月表
CREATE TABLE LINE_DEVIATE_ORG_MONITOR_MONTH
(
 ORG_ID BINARY(16) NOT NULL,
 MONTH BIGINT NOT NULL,
 MONITOR_ID BINARY(16) NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 ORG_NAME VARCHAR NULL,
 PLATE_COLOR INTEGER NULL,
 VEHICLE_TYPE VARCHAR NULL,
 CNT_DEVIATE INTEGER NULL,
 CNT_FOLLOW INTEGER NULL,
 CNT_SUM INTEGER NULL,
 RANK INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (ORG_ID,MONTH,MONITOR_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

--企业路线偏离统计月表
CREATE TABLE LINE_DEVIATE_ORG_MONTH
(
 ORG_ID BINARY(16) NOT NULL,
 MONTH BIGINT NOT NULL,
 ORG_NAME VARCHAR NULL,
 CNT_MONITOR INTEGER NULL,
 CNT_DEVIATE INTEGER NULL,
 CNT_FOLLOW INTEGER NULL,
 CNT_SUM INTEGER NULL,
 RANK INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (ORG_ID,MONTH)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

--监控对象ACC统计明细表
CREATE TABLE ACC_STATS_DETAIL
(
 MONITOR_ID BINARY(16) NOT NULL,
 OPEN_TIME BIGINT NOT NULL,
 CLOSE_TIME BIGINT NULL,
 MONITOR_NAME VARCHAR NULL,
 DURATION BIGINT NULL,
 MILE DOUBLE NULL,
 OPEN_LONGITUDE DOUBLE NULL,
 OPEN_LATITUDE DOUBLE NULL,
 CLOSE_LONGITUDE DOUBLE NULL,
 CLOSE_LATITUDE DOUBLE NULL,
 OPEN_LOCATION VARCHAR NULL,
 CLOSE_LOCATION VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,OPEN_TIME)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

/* 4.4.6.1更新脚本 */
--监控对象轨迹完整率统计明细表
CREATE TABLE MONITOR_TRACK_DETAIL
(
 START_TIME BIGINT NOT NULL,
 MONITOR_ID BINARY(16) NOT NULL,
 END_TIME BIGINT NULL,
 MONITOR_NAME VARCHAR NULL,
 GROUP_NAME VARCHAR NULL,
 PLATE_COLOR VARCHAR NULL,
 VEHICLE_TYPE VARCHAR NULL,
 START_LOCATION VARCHAR NULL,
 END_LOCATION VARCHAR NULL,
 TRACK_TOTAL_MILE_FULL DOUBLE NULL,
 TRACK_TOTAL_MILE DOUBLE NULL
 CONSTRAINT PK PRIMARY KEY (START_TIME,MONITOR_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY'
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--监控对象轨迹完整率月统计表
CREATE TABLE MONITOR_TRACK_MONTH
(
 MONTH BIGINT NOT NULL,
 MONITOR_ID BINARY(16) NOT NULL,
 MONITOR_NAME VARCHAR,
 GROUP_ID VARCHAR,
 GROUP_NAME VARCHAR,
 PLATE_COLOR VARCHAR,
 VEHICLE_TYPE VARCHAR,
 DAY1F DOUBLE NULL,
 DAY1T DOUBLE NULL,
 DAY2F DOUBLE NULL,
 DAY2T DOUBLE NULL,
 DAY3F DOUBLE NULL,
 DAY3T DOUBLE NULL,
 DAY4F DOUBLE NULL,
 DAY4T DOUBLE NULL,
 DAY5F DOUBLE NULL,
 DAY5T DOUBLE NULL,
 DAY6F DOUBLE NULL,
 DAY6T DOUBLE NULL,
 DAY7F DOUBLE NULL,
 DAY7T DOUBLE NULL,
 DAY8F DOUBLE NULL,
 DAY8T DOUBLE NULL,
 DAY9F DOUBLE NULL,
 DAY9T DOUBLE NULL,
 DAY10F DOUBLE NULL,
 DAY10T DOUBLE NULL,
 DAY11F DOUBLE NULL,
 DAY11T DOUBLE NULL,
 DAY12F DOUBLE NULL,
 DAY12T DOUBLE NULL,
 DAY13F DOUBLE NULL,
 DAY13T DOUBLE NULL,
 DAY14F DOUBLE NULL,
 DAY14T DOUBLE NULL,
 DAY15F DOUBLE NULL,
 DAY15T DOUBLE NULL,
 DAY16F DOUBLE NULL,
 DAY16T DOUBLE NULL,
 DAY17F DOUBLE NULL,
 DAY17T DOUBLE NULL,
 DAY18F DOUBLE NULL,
 DAY18T DOUBLE NULL,
 DAY19F DOUBLE NULL,
 DAY19T DOUBLE NULL,
 DAY20F DOUBLE NULL,
 DAY20T DOUBLE NULL,
 DAY21F DOUBLE NULL,
 DAY21T DOUBLE NULL,
 DAY22F DOUBLE NULL,
 DAY22T DOUBLE NULL,
 DAY23F DOUBLE NULL,
 DAY23T DOUBLE NULL,
 DAY24F DOUBLE NULL,
 DAY24T DOUBLE NULL,
 DAY25F DOUBLE NULL,
 DAY25T DOUBLE NULL,
 DAY26F DOUBLE NULL,
 DAY26T DOUBLE NULL,
 DAY27F DOUBLE NULL,
 DAY27T DOUBLE NULL,
 DAY28F DOUBLE NULL,
 DAY28T DOUBLE NULL,
 DAY29F DOUBLE NULL,
 DAY29T DOUBLE NULL,
 DAY30F DOUBLE NULL,
 DAY30T DOUBLE NULL,
 DAY31F DOUBLE NULL,
 DAY31T DOUBLE NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,MONITOR_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY' 
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--企业轨迹完整率月统计表
CREATE TABLE GROUP_TRACK_MONTH
(
 MONTH BIGINT NOT NULL,
 GROUP_ID BINARY(16) NOT NULL,
 GROUP_NAME VARCHAR,
 DAY1F DOUBLE NULL,
 DAY1T DOUBLE NULL,
 DAY2F DOUBLE NULL,
 DAY2T DOUBLE NULL,
 DAY3F DOUBLE NULL,
 DAY3T DOUBLE NULL,
 DAY4F DOUBLE NULL,
 DAY4T DOUBLE NULL,
 DAY5F DOUBLE NULL,
 DAY5T DOUBLE NULL,
 DAY6F DOUBLE NULL,
 DAY6T DOUBLE NULL,
 DAY7F DOUBLE NULL,
 DAY7T DOUBLE NULL,
 DAY8F DOUBLE NULL,
 DAY8T DOUBLE NULL,
 DAY9F DOUBLE NULL,
 DAY9T DOUBLE NULL,
 DAY10F DOUBLE NULL,
 DAY10T DOUBLE NULL,
 DAY11F DOUBLE NULL,
 DAY11T DOUBLE NULL,
 DAY12F DOUBLE NULL,
 DAY12T DOUBLE NULL,
 DAY13F DOUBLE NULL,
 DAY13T DOUBLE NULL,
 DAY14F DOUBLE NULL,
 DAY14T DOUBLE NULL,
 DAY15F DOUBLE NULL,
 DAY15T DOUBLE NULL,
 DAY16F DOUBLE NULL,
 DAY16T DOUBLE NULL,
 DAY17F DOUBLE NULL,
 DAY17T DOUBLE NULL,
 DAY18F DOUBLE NULL,
 DAY18T DOUBLE NULL,
 DAY19F DOUBLE NULL,
 DAY19T DOUBLE NULL,
 DAY20F DOUBLE NULL,
 DAY20T DOUBLE NULL,
 DAY21F DOUBLE NULL,
 DAY21T DOUBLE NULL,
 DAY22F DOUBLE NULL,
 DAY22T DOUBLE NULL,
 DAY23F DOUBLE NULL,
 DAY23T DOUBLE NULL,
 DAY24F DOUBLE NULL,
 DAY24T DOUBLE NULL,
 DAY25F DOUBLE NULL,
 DAY25T DOUBLE NULL,
 DAY26F DOUBLE NULL,
 DAY26T DOUBLE NULL,
 DAY27F DOUBLE NULL,
 DAY27T DOUBLE NULL,
 DAY28F DOUBLE NULL,
 DAY28T DOUBLE NULL,
 DAY29F DOUBLE NULL,
 DAY29T DOUBLE NULL,
 DAY30F DOUBLE NULL,
 DAY30T DOUBLE NULL,
 DAY31F DOUBLE NULL,
 DAY31T DOUBLE NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,GROUP_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY' 
SPLIT ON (DECODE('3F','HEX'),DECODE('6F','HEX'),DECODE('9F','HEX'),DECODE('CF','HEX'));

--里程油耗统计月表
CREATE TABLE OBD_MILE_OIL_MONTH
(
 MONTH BIGINT NOT NULL,
 MONITOR_ID BINARY(16) NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 ORG_NAME VARCHAR NULL,
 MILE DOUBLE NULL,
 OIL_WEAR DOUBLE NULL,
 OIL_WEAR_HUNDRED DOUBLE NULL,
 UREA_WEAR DOUBLE NULL,
 UREA_OIL_WEAR DOUBLE NULL,
 TRAVEL_DAY INTEGER NULL,
 MAX_MILE DOUBLE NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,MONITOR_ID)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

--驾驶员工作明细表
CREATE TABLE DRIVER_WORK_DETAIL
(
 DRIVER_ID BIGINT NOT NULL,
 SAVE_TIME BIGINT NOT NULL,
 START_TIME BIGINT NULL,
 END_TIME BIGINT NULL,
 WORK_TIME BIGINT NULL,
 MONITOR_ID VARCHAR NULL,
 MONITOR_NAME VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (DRIVER_ID,SAVE_TIME)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';

--车辆作业统计明细表
CREATE TABLE VEHICLE_WORK_DETAIL
(
 MONITOR_ID BINARY(16) NOT NULL,
 SAVE_TIME BIGINT NOT NULL,
 MONITOR_NAME VARCHAR,
 DRIVER_IDENTITY_CARD VARCHAR NULL,
 DRIVER_NAME VARCHAR NULL,
 ORG_NAME VARCHAR NULL,
 START_TIME BIGINT NULL,
 END_TIME BIGINT NULL,
 WORK_TIME BIGINT NULL,
 DRIVER_ID BIGINT NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,SAVE_TIME)
)
BLOOMFILTER=NONE,
COLUMN_ENCODED_BYTES=0,
COMPRESSION='SNAPPY';
