 CREATE SCHEMA if not EXISTS GUI_ZHOU_809_TEST;
 
 drop table if EXISTS GUI_ZHOU_809_TEST.positional;
 CREATE table GUI_ZHOU_809_TEST.positional( 
 REVERSE_MONITOR_ID VARCHAR(20) not null,
 VTIME BIGINT not null,
 MONITOR_ID BIGINT null,
 MONITOR_NAME VARCHAR,
 GROUP_IDS VARCHAR,
 GROUP_NAMES VARCHAR,
 ORGANIZATION_ID BIGINT,
 ORGANIZATION_NAME VARCHAR,
 DEVICE_TYPE INTEGER,
 MONITOR_TYPE INTEGER,
 PROFESSIONAL_IDS VARCHAR,
 PROFESSIONALS_NAME VARCHAR,
 PLATE_COLOR INTEGER,
 SIM_CARD VARCHAR,
 REISSUE INTEGER,
 CREATE_TIME BIGINT,
 SYS_TIME BIGINT,
 MILE_SEN_MILEAGE DOUBLE,
 MILE_SEN_SPEED DOUBLE,
 MILE_SEN_UNUSUAL integer,
 GPS_SPEED DOUBLE,
 GRAPHER_SPEED DOUBLE,
 GPS_MILEAGE DOUBLE,
 GPS_OIL DOUBLE,
 DIRECTION DOUBLE,
 LATITUDE DOUBLE,
 LONGITUDE DOUBLE,
 ALTITUDE DOUBLE,
 ADDRESS VARCHAR,
 CITY VARCHAR,
 PROVINCES VARCHAR,
 STATUS BIGINT,
 ORIGINAL_LATITUDE DOUBLE,
 ORIGINAL_LONGITUDE DOUBLE,
 SATELLITES_NUMBER INTEGER,
 LOCATION_TYPE INTEGER,
 LOCATION_PATTERN INTEGER,
 MSG_SN INTEGER,
 ALARM BIGINT,
 ACC INTEGER,
 LOCATION_STATUS INTEGER,
 OPERATION_STATUS INTEGER,
 OIL_WAY_STATUS INTEGER,
 CIRCUITRY_STATUS INTEGER,
 CAR_DOOR_LOCK INTEGER,
 TRAVEL_STATUS INTEGER,
 AIR_COMP_STATUS INTEGER,
 DURATION_TIME BIGINT,
 BATTERY_ELEC INTEGER,
 BATTERY_VOLTAGE DOUBLE,
 SIGNAL_TYPE INTEGER,
 SIGNAL_STRENGTH INTEGER,
 WIFI_SIGNAL_STRENGTH INTEGER,
 TERMINAL_VERSION VARCHAR,
 DEVICE_MESSAGE VARCHAR,
 ATTACH_INFO VARCHAR,
 POSITIVE_NEGATIVE VARCHAR,
 IO_SIGNAL_DATA VARCHAR,
 LBS_DATA VARCHAR,
 WIFIS_DATA VARCHAR,
 DRIVE_WARN VARCHAR,
 UNUSUAL_DRIVE_WARN VARCHAR,
 ELEC_DATA VARCHAR,
 OBD VARCHAR,
 MONITOR_STATUS INTEGER,
 TYRE_INFOS VARCHAR,
 BLUETOOTH_LIST VARCHAR,
 TERMINALCHECK VARCHAR,
 TEMP_DATA_21 VARCHAR,
 TEMP_DATA_22 VARCHAR,
 TEMP_DATA_23 VARCHAR,
 TEMP_DATA_24 VARCHAR,
 TEMP_DATA_25 VARCHAR,
 HUMI_DATA_26 VARCHAR,
 HUMI_DATA_27 VARCHAR,
 HUMI_DATA_28 VARCHAR,
 HUMI_DATA_29 VARCHAR,
 HUMI_DATA_2A VARCHAR,
 OIL_EXPEND_DATA_45 VARCHAR,
 OIL_EXPEND_DATA_46 VARCHAR,
 LIQUID_DATA_41 VARCHAR,
 LIQUID_DATA_42 VARCHAR,
 LIQUID_DATA_43 VARCHAR,
 LIQUID_DATA_44 VARCHAR,
 LIQUID_DATA_47 VARCHAR,
 LIQUID_DATA_48 VARCHAR,
 LIQUID_DATA_49 VARCHAR,
 LIQUID_DATA_4A VARCHAR,
 LIQUID_DATA_4B VARCHAR,
 LIQUID_DATA_4C VARCHAR,
 LIQUID_DATA_4D VARCHAR,
 LIQUID_DATA_4E VARCHAR,
 LOAD_DATA_70 VARCHAR,
 LOAD_DATA_71 VARCHAR,
 WORK_DATA_80 VARCHAR,
 WORK_DATA_81 VARCHAR,
 CIR_IO_DATA_91 VARCHAR,
 CIR_IO_DATA_92 VARCHAR,
 DEVICE_NUMBER VARCHAR,
 SIM_CARD_DATA_1A VARCHAR,
 DURATION_TYPE INTEGER,
 WORK_STATUS TINYINT,
 FENCE_STATUS TINYINT,
 FUNCTION_STATUS VARCHAR,
 PLATFORM_ID BIGINT,
 ORG_INDUSTRY_CATEGORY_ID VARCHAR,
 VEH_INDUSTRY_CATEGORY_ID VARCHAR,
 ORGANIZATION_ZONE VARCHAR,
 SOURCE_MSG_ID INTEGER,
 VALID INTEGER
     CONSTRAINT PK PRIMARY KEY (REVERSE_MONITOR_ID,VTIME desc )
 )
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY'
 SPLIT ON ('05','10','15','20','25','30','35','40','45','50','55','60','65','70','75','80','85','90','95');
 
 CREATE INDEX POSITIONAL_INDEX ON GUI_ZHOU_809_TEST.POSITIONAL(VTIME) INCLUDE(LONGITUDE,LATITUDE) async;
 
 
 
 drop table if EXISTS GUI_ZHOU_809_TEST.rel_emp_monitor;
 create table if not EXISTS GUI_ZHOU_809_TEST.rel_emp_monitor(
     day varchar(8) not null,
     enterprise_ID   bigint not null,
     enterprise_name varchar null,
     monitor_id bigint not null,
     REVERSE_monitor_id varchar null
     CONSTRAINT PK PRIMARY KEY (day,enterprise_ID,monitor_id desc )
 )
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 drop table if EXISTS GUI_ZHOU_809_TEST.rel_group_monitor;
 create table if not EXISTS GUI_ZHOU_809_TEST.rel_group_monitor(
     day varchar(8) not null,
     group_id   bigint not null,
     group_name varchar null,
     monitor_id bigint not null,
     REVERSE_monitor_id varchar null
     CONSTRAINT PK PRIMARY KEY (day,group_id,monitor_id desc )
 )
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
  
 drop table if EXISTS GUI_ZHOU_809_TEST.rel_emp_group;
 create table if not EXISTS GUI_ZHOU_809_TEST.rel_emp_group(
     day varchar(8) not null,
     enterprise_ID bigint not null,
     group_id bigint not null
     CONSTRAINT PK PRIMARY KEY (day,enterprise_ID,group_id desc )
 )
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
  
 
  CREATE TABLE GUI_ZHOU_809_TEST.ALARM_HANDLE (
    REVERSE_MONITOR_ID varchar not null,
    ALARM_START_TIME bigint not null,
    ALARM_TYPE integer not null,
    MONITOR_ID bigint,
    MONITOR_NAME varchar,
    GROUP_ID varchar,
    GROUP_NAME varchar,
    PROFESSIONALS_NAME varchar,
    ALARM_END_TIME bigint,
    ALARM_START_LOCATION varchar,
    ALARM_END_LOCATION varchar,
    ALARM_SOURCE integer,
    SPEED DOUBLE,
    ANGLE varchar,
    PERSON_ID varchar,
    PERSON_NAME varchar,
    HANDLE_TIME bigint,
    STATUS integer,
    HANDLE_TYPE varchar,
    DESCRIPTION varchar,
    HEIGHT DOUBLE,
    RECORDER_SPEED DOUBLE,
    FENCE_TYPE integer,
    FENCE_NAME varchar,
    MONITOR_TYPE integer,
    PROTOCOL_TYPE integer,
    SWIFT_NUMBER varchar,
    PUSH_TYPE integer,
    CAL_STANDARD integer,
    SPEED_TYPE integer,
    SEVERITY DOUBLE,
    SPEED_LIMIT DOUBLE,
    ALARM_DURATION_TIME integer,
    MAX_SPEED DOUBLE,
    ORGANIZATION_ID bigint,
    ORGANIZATION_NAME varchar,
    OVERSEE_TIME bigint,
    OVERSEE_DEAD_TIME bigint,
    OVERSEE_PEOPLE varchar,
    RESPONSE_TIME bigint,
    OVERSEE_STATUS integer,
    OVERSEE_TYPE integer,
    OVERSEE_LEVEL integer,
    RISK_ID varchar,
    REMARK varchar,
    OVERSEE_RESULT integer,
    ROAD_NET_SPEED_LIMIT DOUBLE,
    PERSON_ORGANIZATION_NAME varchar,
    SEND_OF_MSG varchar,
    DEAL_OF_MSG varchar,
    ROAD_TYPE integer,
    MISSION_ID bigint,
    ALARM_DATA_SOURCE integer,
    STATUS_START_TIME bigint,
    ALARM_THRESHOLDS integer,
    PLATFORM_ID bigint,
    PLATFORM_NAME varchar,
    SUPERVISION_STATUS integer,
    SOURCE_DATA_TYPE integer,
    WARN_NO varchar,
    PLATE_COLOR integer,
    THIRD_PARTIES_DATA varchar,
    RISK_TYPE integer,
    SOURCE_MSG_SN integer,
    ORG_INDUSTRY_CATEGORY_ID varchar,
    VEH_INDUSTRY_CATEGORY_ID varchar,
    ORGANIZATION_ZONE varchar,
    DRIVER_NAME varchar,
    CERTIFICATION_ID varchar,
    HANDLE_RESULT INTEGER,
    WARN_GRADE INTEGER
    CONSTRAINT PK PRIMARY KEY (REVERSE_MONITOR_ID,ALARM_START_TIME,ALARM_TYPE) 
 )
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY'
 SPLIT ON ('05','10','15','20','25','30','35','40','45','50','55','60','65','70','75','80','85','90','95');
 
 
 
 CREATE SCHEMA if not EXISTS COMMON;
 
 CREATE TABLE if not EXISTS POSITION_INFO (
  LONGTITUDE FLOAT NOT NULL,
  LATITUDE FLOAT NOT NULL,
  ADCODE VARCHAR,
  BUILDING VARCHAR,
  BUILDING_TYPE VARCHAR,
  CITY VARCHAR,
  CITY_CODE VARCHAR,
  DISTRICT VARCHAR,
  NEIGHBORHOOD VARCHAR,
  NEIGHBORHOOD_TYPE VARCHAR,
  PROVINCE VARCHAR,
  STREET VARCHAR,
  STREET_NUMBER VARCHAR,
  TOWNSHIP VARCHAR,
  CROSSES VARCHAR,
  FORMATTED_ADDRESS VARCHAR,
  POIS VARCHAR,
  ROADS VARCHAR,
  CONSTRAINT PK PRIMARY KEY (LONGTITUDE,LATITUDE)
 )COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 /* 车辆统计  */
 -- 企业类型统计月表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_TYPE_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 VEHICLE_TYPE INTEGER NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,ENTERPRISE_ID,VEHICLE_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
  -- 企业类型统计天表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_TYPE_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 VEHICLE_TYPE INTEGER NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ENTERPRISE_ID,VEHICLE_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆类型每日明细表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_TYPE_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 VEHICLE_TYPE INTEGER NULL,
 ENTERPRISE_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 PLATE_COLOR INTEGER NULL,
 ENT_INDUSTRY_CATEGORY_ID VARCHAR NULL,
 ENT_INDUSTRY_CATEGORY VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 行业类别车辆数统计日表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INDUSTRY_CATEGORY_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 UPLINE_NUM INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,INDUSTRY_CATEGORY_ID,PLATFORM_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

 -- 行业类别车辆数统计月表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INDUSTRY_CATEGORY_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 UPLINE_NUM INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,INDUSTRY_CATEGORY_ID,PLATFORM_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 /* 运行状态统计（车辆上线、在线、轨迹、车辆数据不合格） */
 -- 平台运行状态统计月表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.PLAT_RUNNING_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 LINK_TYPE INTEGER NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 ACCESS_TIME BIGINT NULL,
 STATS_DAY INTEGER NULL,
 ONLINE_DURATION INTEGER NULL,
 INTERRUPT_NUM INTEGER NULL,
 INTERRUPT_TIME INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,PLATFORM_ID,LINK_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 平台运行状态统计日表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.PLAT_RUNNING_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 LINK_TYPE INTEGER NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 ACCESS_TIME BIGINT NULL,
 STATS_DAY INTEGER NULL,
 ONLINE_DURATION INTEGER NULL,
 INTERRUPT_NUM INTEGER NULL,
 INTERRUPT_TIME INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,PLATFORM_ID,LINK_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业运行状态统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_RUNNING_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 STATS_DAY INTEGER NULL,
 ONLINE_DURATION INTEGER NULL,
 UPLINE_DAY INTEGER NULL,
 TRACK_TOTAL_MILE_FULL VARCHAR NULL,
 TRACK_TOTAL_MILE VARCHAR NULL,
 POSITIONAL_NUM INTEGER NULL,
 POSITIONAL_FAIL_NUM INTEGER NULL,
 UPLINE_NUM	INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业运行状态统计日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_RUNNING_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 ONLINE_DURATION INTEGER NULL,
 UPLINE_NUM INTEGER NULL,
 TRACK_TOTAL_MILE_FULL VARCHAR NULL,
 TRACK_TOTAL_MILE VARCHAR NULL,
 POSITIONAL_NUM INTEGER NULL,
 POSITIONAL_FAIL_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆运行状态统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_RUNNING_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 ENTERPRISE_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 STATS_DAY INTEGER NULL,
 ONLINE_DURATION INTEGER NULL,
 UPLINE_DAY INTEGER NULL,
 TRACK_TOTAL_MILE_FULL VARCHAR NULL,
 TRACK_TOTAL_MILE VARCHAR NULL,
 POSITIONAL_NUM INTEGER NULL,
 POSITIONAL_FAIL_NUM INTEGER NULL,
 PLATE_COLOR INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,MONITOR_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆运行状态统计日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_RUNNING_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 ENTERPRISE_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ONLINE_DURATION INTEGER NULL,
 TRACK_TOTAL_MILE_FULL VARCHAR NULL,
 TRACK_TOTAL_MILE VARCHAR NULL,
 POSITIONAL_NUM INTEGER NULL,
 POSITIONAL_FAIL_NUM INTEGER NULL,
 PLATE_COLOR INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 /* 车辆报警统计 */
 -- 报警类型统计月表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ALARM_TYPE_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 ALARM_TOTAL INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

 -- 报警类型统计日表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ALARM_TYPE_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 ALARM_TOTAL INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

 -- 企业报警统计明细月表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_ALARM_STATS_MONTH_DETAIL
 (
 MONTH VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,ENTERPRISE_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业报警统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_ALARM_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 STATS_DAY INTEGER NULL,
 ALARM_TOTAL INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL,
 SPEED_ALARM INTEGER NULL,
 FATIGUED_ALARM INTEGER NULL,
 CRASH_RISK INTEGER NULL,
 DISTRACTION INTEGER NULL,
 VIOLATION_ABNORMAL INTEGER NULL,
 OTHER INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆报警统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_ALARM_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 ENTERPRISE_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL,
 KILOMETERS_ALARM_TOTAL VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,MONITOR_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆报警日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_ALARM_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 ALARM_TOTAL INTEGER NULL,
 KILOMETERS_ALARM_TOTAL VARCHAR NULL,
 ALARM_HANDLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆报警类型统计日表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_ALARM_TYPE_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 ALARM_TOTAL INTEGER NULL,
 KILOMETERS_ALARM_TOTAL VARCHAR NULL,
 ALARM_HANDLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 行业类别报警统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INCA_ALARM_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 AREA_ID VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 STATS_DAY INTEGER NULL,
 ALARM_TOTAL INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL,
 SPEED_ALARM INTEGER NULL,
 FATIGUED_ALARM INTEGER NULL,
 CRASH_RISK INTEGER NULL,
 DISTRACTION INTEGER NULL,
 VIOLATION_ABNORMAL INTEGER NULL,
 OTHER INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,AREA_ID,INDUSTRY_CATEGORY_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 行业类别报警类型统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INCA_ALARM_MONTH
 (
 MONTH VARCHAR NOT NULL,
 AREA_ID VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,AREA_ID,INDUSTRY_CATEGORY_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 行业类别报警类型统计日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INCA_ALARM_DAY
 (
 DAY VARCHAR NOT NULL,
 AREA_ID VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,AREA_ID,INDUSTRY_CATEGORY_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 行业类别报警类型统计小时表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INCA_ALARM_HOURS
 (
 HOURS VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (HOURS,INDUSTRY_CATEGORY_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

 -- 车辆类型报警类型统计日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_TYPE_ALARM_DAY
 (
 DAY VARCHAR NOT NULL,
 VEHICLE_TYPE INTEGER NOT NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,VEHICLE_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

 -- 车辆类型报警类型统计小时表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_TYPE_ALARM_HOURS
 (
 HOURS VARCHAR NOT NULL,
 VEHICLE_TYPE INTEGER NOT NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (HOURS,VEHICLE_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 /* 车辆报警处理统计 */
 -- 企业车辆报警处理统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_ALARM_HANDLE_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 STATS_DAY INTEGER NULL,
 ALARM_NUM INTEGER NULL,
 ALARM_HANDLE_NUM INTEGER NULL,
 ALARM_MONITOR_NUM INTEGER NULL,
 ALARM_HANDLE_MONITOR_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业车辆报警处理统计日表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_ALARM_HANDLE_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 ALARM_NUM INTEGER NULL,
 ALARM_HANDLE_NUM INTEGER NULL,
 ALARM_HANDLE_VEHICLE_NUM INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆报警处理统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_ALARM_HANDLE_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 ENTERPRISE_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 STATS_DAY INTEGER NULL,
 ALARM_NUM INTEGER NULL,
 ALARM_HANDLE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,MONITOR_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 /* 查岗统计 */
 --平台查岗统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.PLAT_INSPECT_SENTRIES_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 INSPECT_SENTRIES_NUM INTEGER NULL,
 REPLY_NUM INTEGER NULL,
 EXACT_NUM INTEGER NULL,
 VALID_NUM INTEGER NULL,
 EXACT_VALID_NUM INTEGER NULL,
 RESPONSE_AVERAGE_TIME INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,PLATFORM_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 平台查岗统计明细
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.PLAT_INSPECT_SENTRIES_STATS
 (
 INSPECT_SENTRIES_TIME VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 REPLY_TIME VARCHAR NULL,
 VALID TINYINT NULL,
 EXACT TINYINT NULL,
 RESPONSE_TIME INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (INSPECT_SENTRIES_TIME,PLATFORM_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业查岗统计月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_INSPECT_SENTRIES_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 INSPECT_SENTRIES_NUM INTEGER NULL,
 REPLY_NUM INTEGER NULL,
 EXACT_NUM INTEGER NULL,
 VALID_NUM INTEGER NULL,
 EXACT_VALID_NUM INTEGER NULL,
 RESPONSE_AVERAGE_TIME INTEGER NULL,
 RESPONSE_NUM_SHORT INTEGER NULL,
 RESPONSE_NUM_MIDDLE INTEGER NULL,
 RESPONSE_NUM_LONG INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业查岗统计明细 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_INSPECT_SENTRIES_STATS
 (
 INSPECT_SENTRIES_TIME VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 REPLY_TIME VARCHAR NULL,
 VALID TINYINT NULL,
 EXACT TINYINT NULL,
 RESPONSE_TIME INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (INSPECT_SENTRIES_TIME,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业查岗统计日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_INSPECT_SENTRIES_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 RESPONSE_AVERAGE_TIME INTEGER NULL,
 RESPONSE_NUM_SHORT INTEGER NULL,
 RESPONSE_NUM_MIDDLE INTEGER NULL,
 RESPONSE_NUM_LONG INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 /* TOP表  */
 -- TOP统计月表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.TOP_STATS_MONTH
 (
 MONTH VARCHAR NOT NULL,
 TOP_TYPE TINYINT NOT NULL,
 RANK TINYINT NOT NULL,
 DATA VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,TOP_TYPE,RANK)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- TOP统计日表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.TOP_STATS_DAY
 (
 DAY VARCHAR NOT NULL,
 TOP_TYPE TINYINT NOT NULL,
 RANK TINYINT NOT NULL,
 DATA VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (DAY,TOP_TYPE,RANK)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 下级平台数据合格率统计日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.LOWER_PLAT_PASS_TOP_DAY
 (
 DAY VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 UPLINE_NUM INTEGER NULL,
 ENTERPRISE_NUM INTEGER NULL,
 ONLINE_DURATION INTEGER NULL,
 TRACK_TOTAL_MILE_FULL VARCHAR NULL,
 TRACK_TOTAL_MILE VARCHAR NULL,
 POSITIONAL_NUM INTEGER NULL,
 POSITIONAL_FAIL_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,PLATFORM_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 下级平台报警数日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.LOWER_PLAT_ALARM_TOP_DAY
 (
 DAY VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 PLATFORM_NAME VARCHAR NULL,
 ALARM_DATA VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,PLATFORM_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业报警数日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_ALARM_TOP_DAY
 (
 DAY VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 UPLINE_NUM INTEGER NULL,
 ALARM_VEHICLE_NUM INTEGER NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业报警处理日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_ALARM_UNHANDLE_TOP_DAY
 (
 DAY VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 MONITOR_NUM INTEGER NULL,
 UPLINE_NUM INTEGER NULL,
 ALARM_TOTAL INTEGER NULL,
 ALARM_HANDLE_NUM INTEGER NULL,
 ALARM_UNHANDLE_NUM INTEGER NULL,
 ALARM_HANDLE_RATE VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 企业查岗响应日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ENT_RESPONSE_TOP_DAY
 (
 DAY VARCHAR NOT NULL,
 ENTERPRISE_ID BIGINT NOT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 RESPONSE_AVERAGE_TIME INTEGER NULL,
 RESPONSE_NUM INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,ENTERPRISE_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆报警数日表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_ALARM_TOP_DAY
 (
 DAY VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATE_COLOR TINYINT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 -- 车辆百公里报警数日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.VEHICLE_HUNDRED_ALARM_TOP_DAY
 (
 DAY VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_NAME VARCHAR NULL,
 PLATE_COLOR TINYINT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 KILOMETERS_ALARM_TOTAL VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (DAY,MONITOR_ID)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

 --行业类别报警类型统计看板月表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INCA_ALARM_BOARD_MONTH
 (
 MONTH VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (MONTH,INDUSTRY_CATEGORY_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

 --行业类别报警类型统计看板日表 
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.INCA_ALARM_BOARD_DAY
 (
 DAY VARCHAR NOT NULL,
 INDUSTRY_CATEGORY_ID VARCHAR NOT NULL,
 ALARM_TYPE INTEGER NOT NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ALARM_TOTAL INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,INDUSTRY_CATEGORY_ID,ALARM_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

/* 督办统计 */
-- 督办查询明细表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.PLAT_SUPERVISION_QUERY_DETAIL
 (
 MONITOR_ID BIGINT NOT NULL,
 SUPERVISION_TIME BIGINT NOT NULL,
 SUPERVISION_STATUS INTEGER NULL,
 HANDLE_STATUS INTEGER NULL,
 HANDLE_RESULT INTEGER NULL,
 HAND_TIME BIGINT NULL,
 MONITOR_NAME VARCHAR NULL,
 PLATE_COLOR INTEGER NULL,
 INDUSTRY_CATEGORY VARCHAR NULL,
 ENTERPRISE_ID BIGINT NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_ID BIGINT NULL,
 PLATFORM_NAME VARCHAR NULL,
 RISK_TYPE INTEGER NULL,
 ALARM_TYPE INTEGER NULL,
 CUTOFF_TIME BIGINT NULL,
 ALARM_START_TIME BIGINT NULL,
 SUPERVISION_PEOPLE VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,SUPERVISION_TIME)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

/* 多媒体表  */
 --多媒体明细表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.MEDIA_DETAIL
 (
 MONITOR_ID BIGINT NOT NULL,
 UPLOAD_TIME BIGINT NOT NULL,
 FILE_TYPE INTEGER NOT NULL,
 WARN_NO VARCHAR NULL,
 FILE_NAME VARCHAR NULL,
 FILE_SIZE INTEGER NULL,
 FILE_URL VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,UPLOAD_TIME,FILE_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
 
 --多媒体中间表（报警编号与多媒体明细表关系）
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.MEDIA_DETAIL_MIDDLE
 (
 WARN_NO VARCHAR NOT NULL,
 MONITOR_ID BIGINT NOT NULL,
 UPLOAD_TIME BIGINT NOT NULL,
 FILE_TYPE INTEGER NOT NULL,
 NAME VARCHAR NULL
 CONSTRAINT PK PRIMARY KEY (WARN_NO,MONITOR_ID,UPLOAD_TIME,FILE_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

/* 报警风险类型表 */
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.ALARM_RISK_TYPE
 (
 MONITOR_ID BIGINT NOT NULL,
 ALARM_TIME VARCHAR NOT NULL,
 MONITOR_NAME VARCHAR NULL,
 PLATE_COLOR INTEGER NULL,
 RISK_NAME VARCHAR NULL,
 RISK_LEVEL INTEGER NULL,
 ALARM_LOCATION VARCHAR NULL,
 ENTERPRISE_NAME VARCHAR NULL,
 PLATFORM_NAME VARCHAR NULL,
 DRIVER_NAME VARCHAR NULL,
 SUPERVISION_STATUS TINYINT NULL,
 ALARM_KEY VARCHAR NULL,
 RISK_SPEED TINYINT NULL,
 RISK_TIRED TINYINT NULL,
 RISK_DISTRACTION TINYINT NULL,
 RISK_CRASH TINYINT NULL,
 RISK_VIOLATION TINYINT NULL,
 RISK_OTHER TINYINT NULL
 CONSTRAINT PK PRIMARY KEY (MONITOR_ID,ALARM_TIME)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';

/* 平台连接信息表 */
 --平台连接信息表
 CREATE TABLE IF NOT EXISTS GUI_ZHOU_809_TEST.PLAT_CONNECT_INFO
 (
 LINK_TIME VARCHAR NOT NULL,
 PLATFORM_ID BIGINT 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';

 --平台最后状态表
 CREATE TABLE GUI_ZHOU_809_TEST.PLAT_LAST_STATUS
 (
 DAY VARCHAR NOT NULL,
 PLATFORM_ID BIGINT NOT NULL,
 LINK_TYPE INTEGER NOT NULL,
 LINK_STATUS INTEGER NULL
 CONSTRAINT PK PRIMARY KEY (DAY,PLATFORM_ID,LINK_TYPE)
 )
 BLOOMFILTER=NONE,
 COLUMN_ENCODED_BYTES=0,
 COMPRESSION='SNAPPY';
