--
-- PostgreSQL database dump
--

-- Dumped from database version 17.5 (Homebrew)
-- Dumped by pg_dump version 17.5 (Homebrew)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
-- Name: topology; Type: SCHEMA; Schema: -; Owner: 
CREATE SCHEMA topology;

-- Name: SCHEMA topology; Type: COMMENT; Schema: -; Owner: 
COMMENT ON SCHEMA topology IS 'PostGIS Topology schema';

-- Name: postgis; Type: EXTENSION; Schema: -; Owner: 
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;

-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner: 
COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';

-- Name: postgis_topology; Type: EXTENSION; Schema: -; Owner: 
CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology;

-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner: 
COMMENT ON EXTENSION postgis_topology IS 'PostGIS topology spatial types and functions';

-- Name: find_in_set(bigint, character varying); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.find_in_set(bigint, character varying) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$
DECLARE
    STR ALIAS FOR $1;
    STRS ALIAS FOR $2;
    POS INTEGER;
    STATUS BOOLEAN;
BEGIN
    SELECT POSITION( ','||STR||',' IN ','||STRS||',') INTO POS;
    IF POS > 0 THEN
        STATUS = TRUE;
    ELSE
        STATUS = FALSE;
    END IF;
    RETURN STATUS;
END;
$_$;

-- Name: get_child_types_by_code(character varying); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.get_child_types_by_code(p_parent_code character varying) RETURNS TABLE(type_code character varying, type_name character varying, display_name_cn character varying)
    LANGUAGE plpgsql
    AS $$
BEGIN
    RETURN QUERY
    SELECT vt.type_code, vt.type_name, vt.display_name_cn
    FROM sys_vehicle_type vt
    WHERE vt.parent_code = p_parent_code
      AND vt.enabled = true
    ORDER BY vt.sort_order, vt.type_code;
END;
$$;

-- Name: get_parent_type_by_code(character varying); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.get_parent_type_by_code(type_code character varying) RETURNS character varying
    LANGUAGE plpgsql
    AS $$
DECLARE
    parent_code VARCHAR(30);
    dot_pos INTEGER;
BEGIN
    -- 找到点的位置
    dot_pos := POSITION('.' IN type_code);
    
    IF dot_pos > 0 THEN
        -- 提取父路径编码（点之前的部分）
        parent_code := LEFT(type_code, dot_pos - 1);
        RETURN parent_code;
    ELSE
        -- 一级分类没有父级
        RETURN NULL;
    END IF;
END;
$$;

-- Name: get_top_level_type(character varying); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.get_top_level_type(type_code character varying) RETURNS character varying
    LANGUAGE plpgsql
    AS $$
DECLARE
    dot_pos INTEGER;
BEGIN
    -- 找到点的位置
    dot_pos := POSITION('.' IN type_code);
    
    IF dot_pos > 0 THEN
        -- 返回点之前的部分（一级分类）
        RETURN LEFT(type_code, dot_pos - 1);
    ELSE
        -- 本身就是一级分类
        RETURN type_code;
    END IF;
END;
$$;

-- Name: get_type_hierarchy(character varying); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.get_type_hierarchy(target_code character varying) RETURNS TABLE(level_num integer, type_code character varying, display_name_cn character varying)
    LANGUAGE plpgsql
    AS $$
BEGIN
    RETURN QUERY
    WITH RECURSIVE type_hierarchy AS (
        -- 基础案例：目标类型
        SELECT 
            vt.path_level as level_num,
            vt.type_code,
            vt.display_name_cn,
            vt.parent_code
        FROM sys_vehicle_type_new vt
        WHERE vt.type_code = target_code
        
        UNION ALL
        
        -- 递归案例：查找父级类型
        SELECT 
            vt.path_level as level_num,
            vt.type_code,
            vt.display_name_cn,
            vt.parent_code
        FROM sys_vehicle_type_new vt
        INNER JOIN type_hierarchy th ON vt.type_code = th.parent_code
    )
    SELECT th.level_num, th.type_code, th.display_name_cn
    FROM type_hierarchy th
    ORDER BY th.level_num;
END;
$$;

-- Name: is_special_vehicle(character varying); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.is_special_vehicle(type_code character varying) RETURNS boolean
    LANGUAGE plpgsql
    AS $$
BEGIN
    RETURN get_top_level_type(type_code) = 'SP';
END;
$$;

-- Name: is_unmanned_vehicle(character varying); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.is_unmanned_vehicle(type_code character varying) RETURNS boolean
    LANGUAGE plpgsql
    AS $$
BEGIN
    RETURN get_top_level_type(type_code) = 'UV';
END;
$$;

-- Name: show_migration_plan(); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.show_migration_plan() RETURNS TABLE(vehicle_id bigint, license_plate character varying, old_type_id bigint, old_type_name character varying, new_type_code character varying, new_type_id bigint, new_display_name character varying)
    LANGUAGE plpgsql
    AS $$
BEGIN
    RETURN QUERY
    SELECT 
        vi.vehicle_id,
        vi.license_plate,
        vi.type_id as old_type_id,
        vt_old.type_name as old_type_name,
        vm.new_type_code,
        vtn.id as new_type_id,
        vtn.display_name_cn as new_display_name
    FROM sys_vehicle_info vi
    LEFT JOIN sys_vehicle_type vt_old ON vi.type_id = vt_old.type_id
    LEFT JOIN vehicle_type_migration_mapping vm ON vi.type_id = vm.old_type_id
    LEFT JOIN sys_vehicle_type_new vtn ON vm.new_type_code = vtn.type_code
    ORDER BY vi.vehicle_id;
END;
$$;

-- Name: substring_index(character varying, character varying, integer); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.substring_index(character varying, character varying, integer) RETURNS character varying
    LANGUAGE plpgsql IMMUTABLE STRICT
    AS $_$
DECLARE
tokens varchar[];
length integer ;
indexnum integer;
BEGIN
tokens := pg_catalog.string_to_array($1, $2);
length := pg_catalog.array_upper(tokens, 1);
indexnum := length - ($3 * -1) + 1;
IF $3 >= 0 THEN
RETURN pg_catalog.array_to_string(tokens[1:$3], $2);
ELSE
RETURN pg_catalog.array_to_string(tokens[indexnum:length], $2);
END IF;
END;
$_$;

-- Name: update_sys_vehicle_id(); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.update_sys_vehicle_id() RETURNS void
    LANGUAGE plpgsql
    AS $$
BEGIN
    -- 更新vehicle_locations表
    UPDATE vehicle_locations vl
    SET sys_vehicle_id = vi.vehicle_id
    FROM sys_vehicle_info vi
    WHERE vl.license_plate = vi.license_plate_number
    AND vl.sys_vehicle_id IS NULL;
    
    -- 更新vehicle_trajectories表
    UPDATE vehicle_trajectories vt
    SET sys_vehicle_id = vi.vehicle_id
    FROM sys_vehicle_info vi
    WHERE vt.license_plate = vi.license_plate_number
    AND vt.sys_vehicle_id IS NULL;
    
    -- 更新vehicle_commands表
    UPDATE vehicle_commands vc
    SET sys_vehicle_id = vi.vehicle_id
    FROM sys_vehicle_info vi
    WHERE vc.license_plate = vi.license_plate_number
    AND vc.sys_vehicle_id IS NULL;
    
    -- 更新rule_violation_events表
    UPDATE rule_violation_events rve
    SET sys_vehicle_id = vi.vehicle_id
    FROM sys_vehicle_info vi
    WHERE rve.license_plate = vi.license_plate_number
    AND rve.sys_vehicle_id IS NULL
    AND rve.subject_type = 'VEHICLE';
    
    RAISE NOTICE '车辆ID同步完成（包含vehicle_commands表）';
END;
$$;

-- Name: update_timestamp_column(); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.update_timestamp_column() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
    NEW.updated_at = CURRENT_TIMESTAMP;
    RETURN NEW;
END;
$$;

-- Name: update_updated_at_column(); Type: FUNCTION; Schema: public; Owner: 
CREATE FUNCTION public.update_updated_at_column() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
    NEW.updated_at = CURRENT_TIMESTAMP;
    RETURN NEW;
END;
$$;


SET default_tablespace = '';

SET default_table_access_method = heap;
-- Name: airport_areas; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.airport_areas (
    id bigint NOT NULL,
    area_id character varying(50) NOT NULL,
    name character varying(100) NOT NULL,
    type character varying(30) NOT NULL,
    boundary public.geometry(Polygon,4326) NOT NULL,
    description character varying(500),
    active_time timestamp with time zone,
    expiry_time timestamp with time zone,
    enabled boolean DEFAULT true,
    priority integer DEFAULT 1,
    area_sqm double precision,
    functional_category character varying(50),
    parent_area_id character varying(50),
    created_at timestamp(6) without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp(6) without time zone DEFAULT CURRENT_TIMESTAMP,
    version bigint DEFAULT 0
);

-- Name: TABLE airport_areas; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.airport_areas IS '机场区域信息表 - 支持电子围栏功能';

-- Name: COLUMN airport_areas.id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.id IS '主键ID';

-- Name: COLUMN airport_areas.area_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.area_id IS '区域标识符';

-- Name: COLUMN airport_areas.name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.name IS '区域名称';

-- Name: COLUMN airport_areas.type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.type IS '区域类型（RUNWAY、TAXIWAY、APRON等）';

-- Name: COLUMN airport_areas.boundary; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.boundary IS '区域几何边界（PostGIS多边形）';

-- Name: COLUMN airport_areas.description; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.description IS '区域描述';

-- Name: COLUMN airport_areas.active_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.active_time IS '生效时间（用于临时区域）';

-- Name: COLUMN airport_areas.expiry_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.expiry_time IS '失效时间（用于临时区域）';

-- Name: COLUMN airport_areas.enabled; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.enabled IS '是否启用';

-- Name: COLUMN airport_areas.priority; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.priority IS '优先级（数值越高优先级越高）';

-- Name: COLUMN airport_areas.area_sqm; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.area_sqm IS '区域面积（平方米）';

-- Name: COLUMN airport_areas.functional_category; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.functional_category IS '功能分类';

-- Name: COLUMN airport_areas.parent_area_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.parent_area_id IS '父区域ID';

-- Name: COLUMN airport_areas.version; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.airport_areas.version IS '数据版本号（用于乐观锁）';

-- Name: airport_areas_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.airport_areas_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: airport_areas_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.airport_areas_id_seq OWNED BY public.airport_areas.id;

-- Name: conflict_alert_logs; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.conflict_alert_logs (
    id bigint NOT NULL,
    alert_type character varying(20) NOT NULL,
    alert_level character varying(20) NOT NULL,
    alert_message text NOT NULL,
    object1_distance double precision,
    object2_distance double precision,
    minimum_distance double precision,
    alert_time timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT conflict_alert_logs_alert_level_check CHECK (((alert_level)::text = ANY ((ARRAY['WARNING'::character varying, 'CRITICAL'::character varying, 'EMERGENCY'::character varying])::text[]))),
    CONSTRAINT conflict_alert_logs_alert_type_check CHECK (((alert_type)::text = ANY ((ARRAY['CONFLICT_WARNING'::character varying, 'CONFLICT_ALERT'::character varying])::text[])))
);

-- Name: TABLE conflict_alert_logs; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.conflict_alert_logs IS '冲突预警告警记录表 - 记录发送的所有预警和告警消息';

-- Name: conflict_alert_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.conflict_alert_logs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: conflict_alert_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.conflict_alert_logs_id_seq OWNED BY public.conflict_alert_logs.id;

-- Name: flyway_schema_history; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.flyway_schema_history (
    installed_rank integer NOT NULL,
    version character varying(50),
    description character varying(200) NOT NULL,
    type character varying(20) NOT NULL,
    script character varying(1000) NOT NULL,
    checksum integer,
    installed_by character varying(100) NOT NULL,
    installed_on timestamp without time zone DEFAULT now() NOT NULL,
    execution_time integer NOT NULL,
    success boolean NOT NULL
);

-- Name: gen_table; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.gen_table (
    table_id bigint NOT NULL,
    table_name character varying(200),
    table_comment character varying(500),
    sub_table_name character varying(64),
    sub_table_fk_name character varying(64),
    class_name character varying(100),
    tpl_category character varying(200),
    tpl_web_type character varying(30),
    package_name character varying(100),
    module_name character varying(30),
    business_name character varying(30),
    function_name character varying(50),
    function_author character varying(50),
    gen_type character(1),
    gen_path character varying(200),
    options character varying(1000),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE gen_table; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.gen_table IS '代码生成业务表';

-- Name: COLUMN gen_table.table_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.table_id IS '编号';

-- Name: COLUMN gen_table.table_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.table_name IS '表名称';

-- Name: COLUMN gen_table.table_comment; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.table_comment IS '表描述';

-- Name: COLUMN gen_table.sub_table_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.sub_table_name IS '关联子表的表名';

-- Name: COLUMN gen_table.sub_table_fk_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.sub_table_fk_name IS '子表关联的外键名';

-- Name: COLUMN gen_table.class_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.class_name IS '实体类名称';

-- Name: COLUMN gen_table.tpl_category; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.tpl_category IS '使用的模板（crud单表操作 tree树表操作）';

-- Name: COLUMN gen_table.tpl_web_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.tpl_web_type IS '前端模板类型（element-ui模版 element-plus模版）';

-- Name: COLUMN gen_table.package_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.package_name IS '生成包路径';

-- Name: COLUMN gen_table.module_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.module_name IS '生成模块名';

-- Name: COLUMN gen_table.business_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.business_name IS '生成业务名';

-- Name: COLUMN gen_table.function_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.function_name IS '生成功能名';

-- Name: COLUMN gen_table.function_author; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.function_author IS '生成功能作者';

-- Name: COLUMN gen_table.gen_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.gen_type IS '生成代码方式（0zip压缩包 1自定义路径）';

-- Name: COLUMN gen_table.gen_path; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.gen_path IS '生成路径（不填默认项目路径）';

-- Name: COLUMN gen_table.options; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.options IS '其它生成选项';

-- Name: COLUMN gen_table.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.create_by IS '创建者';

-- Name: COLUMN gen_table.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.create_time IS '创建时间';

-- Name: COLUMN gen_table.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.update_by IS '更新者';

-- Name: COLUMN gen_table.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.update_time IS '更新时间';

-- Name: COLUMN gen_table.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table.remark IS '备注';

-- Name: gen_table_column; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.gen_table_column (
    column_id bigint NOT NULL,
    table_id character varying(64),
    column_name character varying(200),
    column_comment character varying(500),
    column_type character varying(100),
    java_type character varying(500),
    java_field character varying(200),
    is_pk character(1),
    is_increment character(1),
    is_required character(1),
    is_insert character(1),
    is_edit character(1),
    is_list character(1),
    is_query character(1),
    query_type character varying(200),
    html_type character varying(200),
    dict_type character varying(200) DEFAULT ''::character varying,
    sort integer,
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone
);

-- Name: TABLE gen_table_column; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.gen_table_column IS '代码生成业务表字段';

-- Name: COLUMN gen_table_column.column_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.column_id IS '编号';

-- Name: COLUMN gen_table_column.table_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.table_id IS '归属表编号';

-- Name: COLUMN gen_table_column.column_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.column_name IS '列名称';

-- Name: COLUMN gen_table_column.column_comment; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.column_comment IS '列描述';

-- Name: COLUMN gen_table_column.column_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.column_type IS '列类型';

-- Name: COLUMN gen_table_column.java_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.java_type IS 'JAVA类型';

-- Name: COLUMN gen_table_column.java_field; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.java_field IS 'JAVA字段名';

-- Name: COLUMN gen_table_column.is_pk; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.is_pk IS '是否主键（1是）';

-- Name: COLUMN gen_table_column.is_increment; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.is_increment IS '是否自增（1是）';

-- Name: COLUMN gen_table_column.is_required; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.is_required IS '是否必填（1是）';

-- Name: COLUMN gen_table_column.is_insert; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.is_insert IS '是否为插入字段（1是）';

-- Name: COLUMN gen_table_column.is_edit; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.is_edit IS '是否编辑字段（1是）';

-- Name: COLUMN gen_table_column.is_list; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.is_list IS '是否列表字段（1是）';

-- Name: COLUMN gen_table_column.is_query; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.is_query IS '是否查询字段（1是）';

-- Name: COLUMN gen_table_column.query_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.query_type IS '查询方式（等于、不等于、大于、小于、范围）';

-- Name: COLUMN gen_table_column.html_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.html_type IS '显示类型（文本框、文本域、下拉框、复选框、单选框、日期控件）';

-- Name: COLUMN gen_table_column.dict_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.dict_type IS '字典类型';

-- Name: COLUMN gen_table_column.sort; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.sort IS '排序';

-- Name: COLUMN gen_table_column.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.create_by IS '创建者';

-- Name: COLUMN gen_table_column.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.create_time IS '创建时间';

-- Name: COLUMN gen_table_column.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.update_by IS '更新者';

-- Name: COLUMN gen_table_column.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.gen_table_column.update_time IS '更新时间';

-- Name: gen_table_column_column_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.gen_table_column_column_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: gen_table_column_column_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.gen_table_column_column_id_seq OWNED BY public.gen_table_column.column_id;

-- Name: gen_table_table_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.gen_table_table_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: gen_table_table_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.gen_table_table_id_seq OWNED BY public.gen_table.table_id;

-- Name: geofence_events; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.geofence_events (
    id bigint NOT NULL,
    alert_level character varying(20) NOT NULL,
    created_at timestamp(6) with time zone NOT NULL,
    event_attributes jsonb,
    event_id character varying(50) NOT NULL,
    event_location public.geometry(Point,4326) NOT NULL,
    event_message character varying(500),
    event_time timestamp(6) with time zone NOT NULL,
    event_type character varying(20) NOT NULL,
    fence_id character varying(50) NOT NULL,
    license_plate character varying(50) NOT NULL,
    processed boolean NOT NULL,
    processed_at timestamp(6) with time zone,
    processed_by character varying(100),
    response_action character varying(30),
    response_result character varying(100),
    response_sent boolean NOT NULL,
    response_time timestamp(6) with time zone,
    rule_id character varying(50),
    vehicle_heading double precision,
    vehicle_id bigint NOT NULL,
    vehicle_speed double precision,
    CONSTRAINT geofence_events_alert_level_check CHECK (((alert_level)::text = ANY ((ARRAY['INFO'::character varying, 'WARNING'::character varying, 'CRITICAL'::character varying, 'EMERGENCY'::character varying])::text[]))),
    CONSTRAINT geofence_events_event_type_check CHECK (((event_type)::text = ANY ((ARRAY['ENTER'::character varying, 'EXIT'::character varying, 'VIOLATION'::character varying, 'DWELL_ALERT'::character varying, 'SPEED_ALERT'::character varying])::text[])))
);

-- Name: geofence_events_id_seq; Type: SEQUENCE; Schema: public; Owner: 
ALTER TABLE public.geofence_events ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME public.geofence_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);

-- Name: list_column; Type: VIEW; Schema: public; Owner: 
CREATE VIEW public.list_column AS
 SELECT c.relname AS table_name,
    a.attname AS column_name,
    d.description AS column_comment,
        CASE
            WHEN (a.attnotnull AND (con.conname IS NULL)) THEN 1
            ELSE 0
        END AS is_required,
        CASE
            WHEN (con.conname IS NOT NULL) THEN 1
            ELSE 0
        END AS is_pk,
    a.attnum AS sort,
        CASE
            WHEN ("position"(pg_get_expr(ad.adbin, ad.adrelid), ((((c.relname)::text || '_'::text) || (a.attname)::text) || '_seq'::text)) > 0) THEN 1
            ELSE 0
        END AS is_increment,
    btrim(
        CASE
            WHEN ((t.typelem <> (0)::oid) AND (t.typlen = '-1'::integer)) THEN 'ARRAY'::text
            ELSE
            CASE
                WHEN (t.typtype = 'd'::"char") THEN format_type(t.typbasetype, NULL::integer)
                ELSE format_type(a.atttypid, NULL::integer)
            END
        END, '"'::text) AS column_type
   FROM (((((pg_attribute a
     JOIN (pg_class c
     JOIN pg_namespace n ON ((c.relnamespace = n.oid))) ON ((a.attrelid = c.oid)))
     LEFT JOIN pg_description d ON (((d.objoid = c.oid) AND (a.attnum = d.objsubid))))
     LEFT JOIN pg_constraint con ON (((con.conrelid = c.oid) AND (a.attnum = ANY (con.conkey)))))
     LEFT JOIN pg_attrdef ad ON (((a.attrelid = ad.adrelid) AND (a.attnum = ad.adnum))))
     LEFT JOIN pg_type t ON ((a.atttypid = t.oid)))
  WHERE ((c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (a.attnum > 0) AND (n.nspname = 'public'::name) AND (NOT a.attisdropped))
  ORDER BY c.relname, a.attnum;

-- Name: list_table; Type: VIEW; Schema: public; Owner: 
CREATE VIEW public.list_table AS
 SELECT c.relname AS table_name,
    obj_description(c.oid) AS table_comment,
    CURRENT_TIMESTAMP AS create_time,
    CURRENT_TIMESTAMP AS update_time
   FROM (pg_class c
     LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace)))
  WHERE ((c.relkind = ANY (ARRAY['r'::"char", 'p'::"char"])) AND (c.relname !~~ 'spatial_%'::text) AND (n.nspname = 'public'::name) AND (n.nspname <> ''::name));

-- Name: object_route_assignments; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.object_route_assignments (
    id bigint NOT NULL,
    object_type character varying(20) NOT NULL,
    object_name character varying(100) NOT NULL,
    assigned_route_id bigint NOT NULL,
    assigned_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT object_route_assignments_object_type_check CHECK (((object_type)::text = ANY ((ARRAY['UNMANNED_VEHICLE'::character varying, 'AIRCRAFT'::character varying, 'SPECIAL_VEHICLE'::character varying, 'NORMAL_VEHICLE'::character varying])::text[])))
);

-- Name: TABLE object_route_assignments; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.object_route_assignments IS '实时对象路径分配表 - 跟踪对象当前使用的路径';

-- Name: object_route_assignments_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.object_route_assignments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: object_route_assignments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.object_route_assignments_id_seq OWNED BY public.object_route_assignments.id;

-- Name: qrtz_blob_triggers; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_blob_triggers (
    sched_name character varying(120) NOT NULL,
    trigger_name character varying(200) NOT NULL,
    trigger_group character varying(200) NOT NULL,
    blob_data bytea
);

-- Name: qrtz_calendars; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_calendars (
    sched_name character varying(120) NOT NULL,
    calendar_name character varying(200) NOT NULL,
    calendar bytea NOT NULL
);

-- Name: qrtz_cron_triggers; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_cron_triggers (
    sched_name character varying(120) NOT NULL,
    trigger_name character varying(200) NOT NULL,
    trigger_group character varying(200) NOT NULL,
    cron_expression character varying(200) NOT NULL,
    time_zone_id character varying(80)
);

-- Name: qrtz_fired_triggers; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_fired_triggers (
    sched_name character varying(120) NOT NULL,
    entry_id character varying(95) NOT NULL,
    trigger_name character varying(200) NOT NULL,
    trigger_group character varying(200) NOT NULL,
    instance_name character varying(200) NOT NULL,
    fired_time bigint NOT NULL,
    sched_time bigint NOT NULL,
    priority integer NOT NULL,
    state character varying(16) NOT NULL,
    job_name character varying(200),
    job_group character varying(200),
    is_nonconcurrent character varying(20),
    requests_recovery character varying(20)
);

-- Name: qrtz_job_details; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_job_details (
    sched_name character varying(120) NOT NULL,
    job_name character varying(200) NOT NULL,
    job_group character varying(200) NOT NULL,
    description character varying(250),
    job_class_name character varying(250) NOT NULL,
    is_durable character varying(50) NOT NULL,
    is_nonconcurrent character varying(50) NOT NULL,
    is_update_data character varying(50) NOT NULL,
    requests_recovery character varying(50) NOT NULL,
    job_data bytea
);

-- Name: qrtz_locks; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_locks (
    sched_name character varying(120) NOT NULL,
    lock_name character varying(40) NOT NULL
);

-- Name: qrtz_paused_trigger_grps; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_paused_trigger_grps (
    sched_name character varying(120) NOT NULL,
    trigger_group character varying(200) NOT NULL
);

-- Name: qrtz_scheduler_state; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_scheduler_state (
    sched_name character varying(120) NOT NULL,
    instance_name character varying(200) NOT NULL,
    last_checkin_time bigint NOT NULL,
    checkin_interval bigint NOT NULL
);

-- Name: qrtz_simple_triggers; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_simple_triggers (
    sched_name character varying(120) NOT NULL,
    trigger_name character varying(200) NOT NULL,
    trigger_group character varying(200) NOT NULL,
    repeat_count bigint NOT NULL,
    repeat_interval bigint NOT NULL,
    times_triggered bigint NOT NULL
);

-- Name: qrtz_simprop_triggers; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_simprop_triggers (
    sched_name character varying(120) NOT NULL,
    trigger_name character varying(200) NOT NULL,
    trigger_group character varying(200) NOT NULL,
    str_prop_1 character varying(512),
    str_prop_2 character varying(512),
    str_prop_3 character varying(512),
    int_prop_1 integer,
    int_prop_2 integer,
    long_prop_1 bigint,
    long_prop_2 bigint,
    dec_prop_1 numeric(13,4),
    dec_prop_2 numeric(13,4),
    bool_prop_1 character varying(2),
    bool_prop_2 character varying(2)
);

-- Name: qrtz_triggers; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.qrtz_triggers (
    sched_name character varying(120) NOT NULL,
    trigger_name character varying(200) NOT NULL,
    trigger_group character varying(200) NOT NULL,
    job_name character varying(200) NOT NULL,
    job_group character varying(200) NOT NULL,
    description character varying(250),
    next_fire_time bigint,
    prev_fire_time bigint,
    priority integer,
    trigger_state character varying(16) NOT NULL,
    trigger_type character varying(8) NOT NULL,
    start_time bigint NOT NULL,
    end_time bigint,
    calendar_name character varying(200),
    misfire_instr smallint,
    job_data bytea
);

-- Name: spatial_rule_vehicle_types; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.spatial_rule_vehicle_types (
    rule_id character varying(50) NOT NULL,
    vehicle_type character varying(30) NOT NULL
);

-- Name: TABLE spatial_rule_vehicle_types; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.spatial_rule_vehicle_types IS '空间规则允许的车辆类型表';

-- Name: spatial_rules; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.spatial_rules (
    rule_id character varying(50) NOT NULL,
    rule_name character varying(200) NOT NULL,
    description text,
    rule_category character varying(50) NOT NULL,
    status character varying(20) NOT NULL,
    priority integer NOT NULL,
    spatial_object_type character varying(30) NOT NULL,
    spatial_object_id character varying(50),
    rule_parameters jsonb,
    alert_level character varying(20) NOT NULL,
    alert_message character varying(500),
    effective_start_time timestamp(6) without time zone,
    effective_end_time timestamp(6) without time zone,
    daily_start_time time without time zone,
    daily_end_time time without time zone,
    weekday_pattern integer,
    time_patterns jsonb,
    created_at timestamp(6) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    updated_at timestamp(6) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    created_by character varying(100),
    updated_by character varying(100),
    version bigint DEFAULT 0,
    custom_geometry public.geometry
);

-- Name: TABLE spatial_rules; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.spatial_rules IS '空间安全规则表';

-- Name: speed_limit_areas; Type: VIEW; Schema: public; Owner: 
CREATE VIEW public.speed_limit_areas AS
 SELECT aa.area_id,
    aa.name AS area_name,
    aa.type AS area_type,
    aa.boundary,
    sr.rule_id,
    sr.rule_name,
    ((sr.rule_parameters ->> 'maxSpeed'::text))::double precision AS max_speed_kmh,
    ((sr.rule_parameters ->> 'warningThreshold'::text))::double precision AS warning_threshold,
    sr.alert_level,
    array_agg(DISTINCT vt.vehicle_type) AS applicable_vehicle_types
   FROM ((public.airport_areas aa
     JOIN public.spatial_rules sr ON (((aa.area_id)::text = (sr.spatial_object_id)::text)))
     JOIN public.spatial_rule_vehicle_types vt ON (((sr.rule_id)::text = (vt.rule_id)::text)))
  WHERE (((sr.rule_category)::text = 'SPEED_LIMIT'::text) AND ((sr.status)::text = 'ACTIVE'::text) AND (aa.enabled = true))
  GROUP BY aa.area_id, aa.name, aa.type, aa.boundary, sr.rule_id, sr.rule_name, sr.rule_parameters, sr.alert_level;

-- Name: sys_config; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_config (
    config_id bigint NOT NULL,
    config_name character varying(100),
    config_key character varying(100),
    config_value character varying(500),
    config_type character(1),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_config; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_config IS '参数配置表';

-- Name: COLUMN sys_config.config_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.config_id IS '参数主键';

-- Name: COLUMN sys_config.config_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.config_name IS '参数名称';

-- Name: COLUMN sys_config.config_key; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.config_key IS '参数键名';

-- Name: COLUMN sys_config.config_value; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.config_value IS '参数键值';

-- Name: COLUMN sys_config.config_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.config_type IS '系统内置（Y是 N否）';

-- Name: COLUMN sys_config.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.create_by IS '创建者';

-- Name: COLUMN sys_config.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.create_time IS '创建时间';

-- Name: COLUMN sys_config.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.update_by IS '更新者';

-- Name: COLUMN sys_config.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.update_time IS '更新时间';

-- Name: COLUMN sys_config.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_config.remark IS '备注';

-- Name: sys_config_config_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_config_config_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_config_config_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_config_config_id_seq OWNED BY public.sys_config.config_id;

-- Name: sys_dept; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_dept (
    dept_id bigint NOT NULL,
    parent_id bigint DEFAULT 0,
    ancestors character varying(50),
    dept_name character varying(30),
    order_num integer,
    leader character varying(20),
    phone character varying(11),
    email character varying(50),
    status character(1),
    del_flag character(1) DEFAULT 0,
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone
);

-- Name: TABLE sys_dept; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_dept IS '部门表';

-- Name: COLUMN sys_dept.dept_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.dept_id IS '部门id';

-- Name: COLUMN sys_dept.parent_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.parent_id IS '父部门id';

-- Name: COLUMN sys_dept.ancestors; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.ancestors IS '祖级列表';

-- Name: COLUMN sys_dept.dept_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.dept_name IS '部门名称';

-- Name: COLUMN sys_dept.order_num; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.order_num IS '显示顺序';

-- Name: COLUMN sys_dept.leader; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.leader IS '负责人';

-- Name: COLUMN sys_dept.phone; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.phone IS '联系电话';

-- Name: COLUMN sys_dept.email; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.email IS '邮箱';

-- Name: COLUMN sys_dept.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.status IS '部门状态（0正常 1停用）';

-- Name: COLUMN sys_dept.del_flag; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.del_flag IS '删除标志（0代表存在 2代表删除）';

-- Name: COLUMN sys_dept.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.create_by IS '创建者';

-- Name: COLUMN sys_dept.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.create_time IS '创建时间';

-- Name: COLUMN sys_dept.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.update_by IS '更新者';

-- Name: COLUMN sys_dept.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dept.update_time IS '更新时间';

-- Name: sys_dept_dept_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_dept_dept_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_dept_dept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_dept_dept_id_seq OWNED BY public.sys_dept.dept_id;

-- Name: sys_dict_data; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_dict_data (
    dict_code bigint NOT NULL,
    dict_sort integer,
    dict_label character varying(100),
    dict_value character varying(100),
    dict_type character varying(100),
    css_class character varying(100),
    list_class character varying(100),
    is_default character(1),
    status character(1),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_dict_data; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_dict_data IS '字典数据表';

-- Name: COLUMN sys_dict_data.dict_code; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.dict_code IS '字典编码';

-- Name: COLUMN sys_dict_data.dict_sort; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.dict_sort IS '字典排序';

-- Name: COLUMN sys_dict_data.dict_label; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.dict_label IS '字典标签';

-- Name: COLUMN sys_dict_data.dict_value; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.dict_value IS '字典键值';

-- Name: COLUMN sys_dict_data.dict_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.dict_type IS '字典类型';

-- Name: COLUMN sys_dict_data.css_class; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.css_class IS '样式属性（其他样式扩展）';

-- Name: COLUMN sys_dict_data.list_class; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.list_class IS '表格回显样式';

-- Name: COLUMN sys_dict_data.is_default; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.is_default IS '是否默认（Y是 N否）';

-- Name: COLUMN sys_dict_data.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.status IS '状态（0正常 1停用）';

-- Name: COLUMN sys_dict_data.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.create_by IS '创建者';

-- Name: COLUMN sys_dict_data.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.create_time IS '创建时间';

-- Name: COLUMN sys_dict_data.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.update_by IS '更新者';

-- Name: COLUMN sys_dict_data.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.update_time IS '更新时间';

-- Name: COLUMN sys_dict_data.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_data.remark IS '备注';

-- Name: sys_dict_data_dict_code_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_dict_data_dict_code_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_dict_data_dict_code_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_dict_data_dict_code_seq OWNED BY public.sys_dict_data.dict_code;

-- Name: sys_dict_type; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_dict_type (
    dict_id bigint NOT NULL,
    dict_name character varying(100),
    dict_type character varying(100),
    status character(1),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_dict_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_dict_type IS '字典类型表';

-- Name: COLUMN sys_dict_type.dict_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.dict_id IS '字典主键';

-- Name: COLUMN sys_dict_type.dict_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.dict_name IS '字典名称';

-- Name: COLUMN sys_dict_type.dict_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.dict_type IS '字典类型';

-- Name: COLUMN sys_dict_type.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.status IS '状态（0正常 1停用）';

-- Name: COLUMN sys_dict_type.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.create_by IS '创建者';

-- Name: COLUMN sys_dict_type.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.create_time IS '创建时间';

-- Name: COLUMN sys_dict_type.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.update_by IS '更新者';

-- Name: COLUMN sys_dict_type.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.update_time IS '更新时间';

-- Name: COLUMN sys_dict_type.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_dict_type.remark IS '备注';

-- Name: sys_dict_type_dict_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_dict_type_dict_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_dict_type_dict_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_dict_type_dict_id_seq OWNED BY public.sys_dict_type.dict_id;

-- Name: sys_driver_info; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_driver_info (
    user_id bigint NOT NULL,
    license_type character varying(50) NOT NULL,
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_driver_info; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_driver_info IS '驾驶员信息表';

-- Name: COLUMN sys_driver_info.user_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_driver_info.user_id IS '用户ID';

-- Name: COLUMN sys_driver_info.license_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_driver_info.license_type IS '驾驶证类型';

-- Name: COLUMN sys_driver_info.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_driver_info.create_by IS '创建者';

-- Name: COLUMN sys_driver_info.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_driver_info.create_time IS '创建时间';

-- Name: COLUMN sys_driver_info.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_driver_info.update_by IS '更新者';

-- Name: COLUMN sys_driver_info.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_driver_info.update_time IS '更新时间';

-- Name: COLUMN sys_driver_info.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_driver_info.remark IS '备注';

-- Name: sys_job; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_job (
    job_id bigint NOT NULL,
    job_name character varying(64) NOT NULL,
    job_group character varying(64) NOT NULL,
    invoke_target character varying(500) NOT NULL,
    cron_expression character varying(255),
    misfire_policy character varying(20),
    concurrent character(1),
    status character(1),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_job; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_job IS '定时任务调度表';

-- Name: COLUMN sys_job.job_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.job_id IS '任务ID';

-- Name: COLUMN sys_job.job_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.job_name IS '任务名称';

-- Name: COLUMN sys_job.job_group; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.job_group IS '任务组名';

-- Name: COLUMN sys_job.invoke_target; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.invoke_target IS '调用目标字符串';

-- Name: COLUMN sys_job.cron_expression; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.cron_expression IS 'cron执行表达式';

-- Name: COLUMN sys_job.misfire_policy; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.misfire_policy IS '计划执行错误策略（1立即执行 2执行一次 3放弃执行）';

-- Name: COLUMN sys_job.concurrent; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.concurrent IS '是否并发执行（0允许 1禁止）';

-- Name: COLUMN sys_job.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.status IS '状态（0正常 1暂停）';

-- Name: COLUMN sys_job.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.create_by IS '创建者';

-- Name: COLUMN sys_job.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.create_time IS '创建时间';

-- Name: COLUMN sys_job.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.update_by IS '更新者';

-- Name: COLUMN sys_job.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.update_time IS '更新时间';

-- Name: COLUMN sys_job.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job.remark IS '备注信息';

-- Name: sys_job_job_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_job_job_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_job_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_job_job_id_seq OWNED BY public.sys_job.job_id;

-- Name: sys_job_log; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_job_log (
    job_log_id bigint NOT NULL,
    job_name character varying(64) NOT NULL,
    job_group character varying(64) NOT NULL,
    invoke_target character varying(500) NOT NULL,
    job_message character varying(500),
    status character(1),
    exception_info character varying(2000),
    create_time timestamp(6) without time zone
);

-- Name: TABLE sys_job_log; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_job_log IS '定时任务调度日志表';

-- Name: COLUMN sys_job_log.job_log_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.job_log_id IS '任务日志ID';

-- Name: COLUMN sys_job_log.job_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.job_name IS '任务名称';

-- Name: COLUMN sys_job_log.job_group; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.job_group IS '任务组名';

-- Name: COLUMN sys_job_log.invoke_target; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.invoke_target IS '调用目标字符串';

-- Name: COLUMN sys_job_log.job_message; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.job_message IS '日志信息';

-- Name: COLUMN sys_job_log.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.status IS '执行状态（0正常 1失败）';

-- Name: COLUMN sys_job_log.exception_info; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.exception_info IS '异常信息';

-- Name: COLUMN sys_job_log.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_job_log.create_time IS '创建时间';

-- Name: sys_job_log_job_log_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_job_log_job_log_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_job_log_job_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_job_log_job_log_id_seq OWNED BY public.sys_job_log.job_log_id;

-- Name: sys_logininfor; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_logininfor (
    info_id bigint NOT NULL,
    user_name character varying(50),
    ipaddr character varying(128),
    login_location character varying(255),
    browser character varying(50),
    os character varying(50),
    status character(1),
    msg character varying(255),
    login_time timestamp(6) without time zone
);

-- Name: TABLE sys_logininfor; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_logininfor IS '系统访问记录';

-- Name: COLUMN sys_logininfor.info_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.info_id IS '访问ID';

-- Name: COLUMN sys_logininfor.user_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.user_name IS '用户账号';

-- Name: COLUMN sys_logininfor.ipaddr; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.ipaddr IS '登录IP地址';

-- Name: COLUMN sys_logininfor.login_location; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.login_location IS '登录地点';

-- Name: COLUMN sys_logininfor.browser; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.browser IS '浏览器类型';

-- Name: COLUMN sys_logininfor.os; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.os IS '操作系统';

-- Name: COLUMN sys_logininfor.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.status IS '登录状态（0成功 1失败）';

-- Name: COLUMN sys_logininfor.msg; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.msg IS '提示消息';

-- Name: COLUMN sys_logininfor.login_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_logininfor.login_time IS '访问时间';

-- Name: sys_logininfor_info_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_logininfor_info_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_logininfor_info_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_logininfor_info_id_seq OWNED BY public.sys_logininfor.info_id;

-- Name: sys_menu; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_menu (
    menu_id bigint NOT NULL,
    menu_name character varying(50) NOT NULL,
    parent_id bigint DEFAULT 0,
    order_num integer,
    path character varying(200),
    component character varying(255),
    query character varying(255),
    route_name character varying(50) DEFAULT ''::character varying,
    is_frame integer,
    is_cache integer DEFAULT 0,
    menu_type character(1),
    visible character(1),
    status smallint,
    perms character varying(100),
    icon character varying(100),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_menu; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_menu IS '菜单权限表';

-- Name: COLUMN sys_menu.menu_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.menu_id IS '菜单ID';

-- Name: COLUMN sys_menu.menu_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.menu_name IS '菜单名称';

-- Name: COLUMN sys_menu.parent_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.parent_id IS '父菜单ID';

-- Name: COLUMN sys_menu.order_num; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.order_num IS '显示顺序';

-- Name: COLUMN sys_menu.path; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.path IS '路由地址';

-- Name: COLUMN sys_menu.component; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.component IS '组件路径';

-- Name: COLUMN sys_menu.query; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.query IS '路由参数';

-- Name: COLUMN sys_menu.route_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.route_name IS '路由名称';

-- Name: COLUMN sys_menu.is_frame; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.is_frame IS '是否为外链（0是 1否）';

-- Name: COLUMN sys_menu.is_cache; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.is_cache IS '是否缓存（0缓存 1不缓存）';

-- Name: COLUMN sys_menu.menu_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.menu_type IS '菜单类型（M目录 C菜单 F按钮）';

-- Name: COLUMN sys_menu.visible; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.visible IS '菜单状态（0显示 1隐藏）';

-- Name: COLUMN sys_menu.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.status IS '菜单状态（0正常 1停用）';

-- Name: COLUMN sys_menu.perms; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.perms IS '权限标识';

-- Name: COLUMN sys_menu.icon; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.icon IS '菜单图标';

-- Name: COLUMN sys_menu.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.create_by IS '创建者';

-- Name: COLUMN sys_menu.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.create_time IS '创建时间';

-- Name: COLUMN sys_menu.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.update_by IS '更新者';

-- Name: COLUMN sys_menu.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.update_time IS '更新时间';

-- Name: COLUMN sys_menu.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_menu.remark IS '备注';

-- Name: sys_menu_menu_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_menu_menu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_menu_menu_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_menu_menu_id_seq OWNED BY public.sys_menu.menu_id;

-- Name: sys_notice; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_notice (
    notice_id bigint NOT NULL,
    notice_title character varying(50) NOT NULL,
    notice_type character(1) NOT NULL,
    notice_content text,
    status character(1),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(255)
);

-- Name: TABLE sys_notice; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_notice IS '通知公告表';

-- Name: COLUMN sys_notice.notice_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.notice_id IS '公告ID';

-- Name: COLUMN sys_notice.notice_title; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.notice_title IS '公告标题';

-- Name: COLUMN sys_notice.notice_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.notice_type IS '公告类型（1通知 2公告）';

-- Name: COLUMN sys_notice.notice_content; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.notice_content IS '公告内容';

-- Name: COLUMN sys_notice.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.status IS '公告状态（0正常 1关闭）';

-- Name: COLUMN sys_notice.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.create_by IS '创建者';

-- Name: COLUMN sys_notice.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.create_time IS '创建时间';

-- Name: COLUMN sys_notice.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.update_by IS '更新者';

-- Name: COLUMN sys_notice.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.update_time IS '更新时间';

-- Name: COLUMN sys_notice.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_notice.remark IS '备注';

-- Name: sys_notice_notice_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_notice_notice_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_notice_notice_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_notice_notice_id_seq OWNED BY public.sys_notice.notice_id;

-- Name: sys_oper_log; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_oper_log (
    oper_id bigint NOT NULL,
    title character varying(50),
    business_type integer,
    method character varying(100),
    request_method character varying(10),
    operator_type integer,
    oper_name character varying(50),
    dept_name character varying(50),
    oper_url character varying(255),
    oper_ip character varying(128),
    oper_location character varying(255),
    oper_param character varying(2000),
    json_result character varying(2000),
    status integer,
    error_msg character varying(2000),
    oper_time timestamp(6) without time zone,
    cost_time bigint DEFAULT 0
);

-- Name: TABLE sys_oper_log; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_oper_log IS '操作日志记录';

-- Name: COLUMN sys_oper_log.oper_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.oper_id IS '日志主键';

-- Name: COLUMN sys_oper_log.title; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.title IS '模块标题';

-- Name: COLUMN sys_oper_log.business_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.business_type IS '业务类型（0其它 1新增 2修改 3删除）';

-- Name: COLUMN sys_oper_log.method; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.method IS '方法名称';

-- Name: COLUMN sys_oper_log.request_method; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.request_method IS '请求方式';

-- Name: COLUMN sys_oper_log.operator_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.operator_type IS '操作类别（0其它 1后台用户 2手机端用户）';

-- Name: COLUMN sys_oper_log.oper_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.oper_name IS '操作人员';

-- Name: COLUMN sys_oper_log.dept_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.dept_name IS '部门名称';

-- Name: COLUMN sys_oper_log.oper_url; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.oper_url IS '请求URL';

-- Name: COLUMN sys_oper_log.oper_ip; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.oper_ip IS '主机地址';

-- Name: COLUMN sys_oper_log.oper_location; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.oper_location IS '操作地点';

-- Name: COLUMN sys_oper_log.oper_param; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.oper_param IS '请求参数';

-- Name: COLUMN sys_oper_log.json_result; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.json_result IS '返回参数';

-- Name: COLUMN sys_oper_log.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.status IS '操作状态（0正常 1异常）';

-- Name: COLUMN sys_oper_log.error_msg; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.error_msg IS '错误消息';

-- Name: COLUMN sys_oper_log.oper_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_oper_log.oper_time IS '操作时间';

-- Name: sys_oper_log_oper_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_oper_log_oper_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_oper_log_oper_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_oper_log_oper_id_seq OWNED BY public.sys_oper_log.oper_id;

-- Name: sys_post; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_post (
    post_id bigint NOT NULL,
    post_code character varying(64) NOT NULL,
    post_name character varying(50) NOT NULL,
    post_sort integer NOT NULL,
    status character(1) NOT NULL,
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_post; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_post IS '岗位信息表';

-- Name: COLUMN sys_post.post_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.post_id IS '岗位ID';

-- Name: COLUMN sys_post.post_code; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.post_code IS '岗位编码';

-- Name: COLUMN sys_post.post_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.post_name IS '岗位名称';

-- Name: COLUMN sys_post.post_sort; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.post_sort IS '显示顺序';

-- Name: COLUMN sys_post.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.status IS '状态（0正常 1停用）';

-- Name: COLUMN sys_post.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.create_by IS '创建者';

-- Name: COLUMN sys_post.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.create_time IS '创建时间';

-- Name: COLUMN sys_post.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.update_by IS '更新者';

-- Name: COLUMN sys_post.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.update_time IS '更新时间';

-- Name: COLUMN sys_post.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_post.remark IS '备注';

-- Name: sys_post_post_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_post_post_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_post_post_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_post_post_id_seq OWNED BY public.sys_post.post_id;

-- Name: sys_role; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_role (
    role_id bigint NOT NULL,
    role_name character varying(30) NOT NULL,
    role_key character varying(100) NOT NULL,
    role_sort integer NOT NULL,
    data_scope character(1),
    menu_check_strictly boolean,
    dept_check_strictly boolean,
    status character(1) NOT NULL,
    del_flag character(1) DEFAULT 0,
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_role; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_role IS '角色信息表';

-- Name: COLUMN sys_role.role_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.role_id IS '角色ID';

-- Name: COLUMN sys_role.role_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.role_name IS '角色名称';

-- Name: COLUMN sys_role.role_key; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.role_key IS '角色权限字符串';

-- Name: COLUMN sys_role.role_sort; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.role_sort IS '显示顺序';

-- Name: COLUMN sys_role.data_scope; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.data_scope IS '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）';

-- Name: COLUMN sys_role.menu_check_strictly; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.menu_check_strictly IS '菜单树选择项是否关联显示';

-- Name: COLUMN sys_role.dept_check_strictly; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.dept_check_strictly IS '部门树选择项是否关联显示';

-- Name: COLUMN sys_role.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.status IS '角色状态（0正常 1停用）';

-- Name: COLUMN sys_role.del_flag; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.del_flag IS '删除标志（0代表存在 2代表删除）';

-- Name: COLUMN sys_role.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.create_by IS '创建者';

-- Name: COLUMN sys_role.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.create_time IS '创建时间';

-- Name: COLUMN sys_role.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.update_by IS '更新者';

-- Name: COLUMN sys_role.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.update_time IS '更新时间';

-- Name: COLUMN sys_role.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role.remark IS '备注';

-- Name: sys_role_dept; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_role_dept (
    role_id bigint NOT NULL,
    dept_id bigint NOT NULL
);

-- Name: TABLE sys_role_dept; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_role_dept IS '角色和部门关联表';

-- Name: COLUMN sys_role_dept.role_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role_dept.role_id IS '角色ID';

-- Name: COLUMN sys_role_dept.dept_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role_dept.dept_id IS '部门ID';

-- Name: sys_role_menu; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_role_menu (
    role_id bigint NOT NULL,
    menu_id bigint NOT NULL
);

-- Name: TABLE sys_role_menu; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_role_menu IS '角色和菜单关联表';

-- Name: COLUMN sys_role_menu.role_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role_menu.role_id IS '角色ID';

-- Name: COLUMN sys_role_menu.menu_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_role_menu.menu_id IS '菜单ID';

-- Name: sys_role_role_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_role_role_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_role_role_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_role_role_id_seq OWNED BY public.sys_role.role_id;

-- Name: sys_user; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_user (
    user_id bigint NOT NULL,
    dept_id bigint,
    user_name character varying(30) NOT NULL,
    user_type character varying(2),
    email character varying(50),
    phonenumber character varying(11),
    sex character(1),
    avatar character varying(100),
    password character varying(100),
    status character(1),
    del_flag character(1) DEFAULT '0'::bpchar,
    login_ip character varying(128),
    login_date timestamp(6) without time zone,
    pwd_update_date timestamp(6) without time zone,
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500)
);

-- Name: TABLE sys_user; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_user IS '用户信息表';

-- Name: COLUMN sys_user.user_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.user_id IS '用户ID';

-- Name: COLUMN sys_user.dept_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.dept_id IS '部门ID';

-- Name: COLUMN sys_user.user_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.user_name IS '用户账号';

-- Name: COLUMN sys_user.user_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.user_type IS '用户类型（00系统用户）';

-- Name: COLUMN sys_user.email; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.email IS '用户邮箱';

-- Name: COLUMN sys_user.phonenumber; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.phonenumber IS '手机号码';

-- Name: COLUMN sys_user.sex; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.sex IS '用户性别（0男 1女 2未知）';

-- Name: COLUMN sys_user.avatar; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.avatar IS '头像地址';

-- Name: COLUMN sys_user.password; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.password IS '密码';

-- Name: COLUMN sys_user.status; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.status IS '帐号状态（0正常 1停用）';

-- Name: COLUMN sys_user.del_flag; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.del_flag IS '删除标志（0代表存在 2代表删除）';

-- Name: COLUMN sys_user.login_ip; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.login_ip IS '最后登录IP';

-- Name: COLUMN sys_user.login_date; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.login_date IS '最后登录时间';

-- Name: COLUMN sys_user.pwd_update_date; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.pwd_update_date IS '密码最后更新时间';

-- Name: COLUMN sys_user.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.create_by IS '创建者';

-- Name: COLUMN sys_user.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.create_time IS '创建时间';

-- Name: COLUMN sys_user.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.update_by IS '更新者';

-- Name: COLUMN sys_user.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.update_time IS '更新时间';

-- Name: COLUMN sys_user.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user.remark IS '备注';

-- Name: sys_user_post; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_user_post (
    user_id bigint NOT NULL,
    post_id bigint NOT NULL
);

-- Name: TABLE sys_user_post; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_user_post IS '用户与岗位关联表';

-- Name: COLUMN sys_user_post.user_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user_post.user_id IS '用户ID';

-- Name: COLUMN sys_user_post.post_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user_post.post_id IS '岗位ID';

-- Name: sys_user_role; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_user_role (
    user_id bigint NOT NULL,
    role_id bigint NOT NULL
);

-- Name: TABLE sys_user_role; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_user_role IS '用户和角色关联表';

-- Name: COLUMN sys_user_role.user_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user_role.user_id IS '用户ID';

-- Name: COLUMN sys_user_role.role_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_user_role.role_id IS '角色ID';

-- Name: sys_user_user_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_user_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_user_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_user_user_id_seq OWNED BY public.sys_user.user_id;

-- Name: sys_vehicle_info; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_vehicle_info (
    vehicle_id bigint NOT NULL,
    license_plate character varying(50) NOT NULL,
    vin_number character varying(50),
    brand character varying(100),
    owning_unit character varying(255),
    contact_person character varying(100),
    phone_number character varying(20),
    image_url character varying(255),
    create_by character varying(64),
    create_time timestamp(6) without time zone,
    update_by character varying(64),
    update_time timestamp(6) without time zone,
    remark character varying(500),
    type_code character varying(30)
);

-- Name: TABLE sys_vehicle_info; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_vehicle_info IS '车辆信息表';

-- Name: COLUMN sys_vehicle_info.vehicle_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.vehicle_id IS '车辆ID';

-- Name: COLUMN sys_vehicle_info.license_plate; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.license_plate IS '车牌号';

-- Name: COLUMN sys_vehicle_info.vin_number; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.vin_number IS 'VIN码';

-- Name: COLUMN sys_vehicle_info.brand; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.brand IS '品牌';

-- Name: COLUMN sys_vehicle_info.owning_unit; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.owning_unit IS '所属单位';

-- Name: COLUMN sys_vehicle_info.contact_person; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.contact_person IS '联系人';

-- Name: COLUMN sys_vehicle_info.phone_number; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.phone_number IS '电话';

-- Name: COLUMN sys_vehicle_info.image_url; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.image_url IS '图片URL';

-- Name: COLUMN sys_vehicle_info.create_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.create_by IS '创建者';

-- Name: COLUMN sys_vehicle_info.create_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.create_time IS '创建时间';

-- Name: COLUMN sys_vehicle_info.update_by; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.update_by IS '更新者';

-- Name: COLUMN sys_vehicle_info.update_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.update_time IS '更新时间';

-- Name: COLUMN sys_vehicle_info.remark; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_info.remark IS '备注';

-- Name: sys_vehicle_info_vehicle_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_vehicle_info_vehicle_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_vehicle_info_vehicle_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_vehicle_info_vehicle_id_seq OWNED BY public.sys_vehicle_info.vehicle_id;

-- Name: sys_vehicle_type; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.sys_vehicle_type (
    id bigint NOT NULL,
    type_code character varying(30) NOT NULL,
    type_name character varying(100) NOT NULL,
    display_name_cn character varying(100) NOT NULL,
    display_name_en character varying(100),
    path_level integer NOT NULL,
    parent_code character varying(30),
    full_path character varying(200) NOT NULL,
    is_leaf boolean DEFAULT false,
    sort_order integer DEFAULT 0,
    enabled boolean DEFAULT true,
    description character varying(500),
    attributes jsonb,
    create_by character varying(64),
    create_time timestamp(6) without time zone DEFAULT CURRENT_TIMESTAMP,
    update_by character varying(64),
    update_time timestamp(6) without time zone DEFAULT CURRENT_TIMESTAMP,
    version bigint DEFAULT 0
);

-- Name: TABLE sys_vehicle_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.sys_vehicle_type IS '车辆类型表（路径编码模式）';

-- Name: COLUMN sys_vehicle_type.id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.id IS '代理主键ID';

-- Name: COLUMN sys_vehicle_type.type_code; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.type_code IS '路径编码（如UV.PT表示无人车.巡逻车）';

-- Name: COLUMN sys_vehicle_type.type_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.type_name IS '类型名称';

-- Name: COLUMN sys_vehicle_type.display_name_cn; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.display_name_cn IS '中文显示名称';

-- Name: COLUMN sys_vehicle_type.display_name_en; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.display_name_en IS '英文显示名称';

-- Name: COLUMN sys_vehicle_type.path_level; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.path_level IS '路径层级（1=一级分类，2=二级分类）';

-- Name: COLUMN sys_vehicle_type.parent_code; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.parent_code IS '父路径编码';

-- Name: COLUMN sys_vehicle_type.full_path; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.full_path IS '完整路径描述';

-- Name: COLUMN sys_vehicle_type.is_leaf; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.is_leaf IS '是否叶子节点';

-- Name: COLUMN sys_vehicle_type.attributes; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.sys_vehicle_type.attributes IS '扩展属性JSON（权限、速度限制等）';

-- Name: sys_vehicle_type_compatible; Type: VIEW; Schema: public; Owner: 
CREATE VIEW public.sys_vehicle_type_compatible AS
 SELECT id AS type_id,
        CASE
            WHEN (parent_code IS NULL) THEN NULL::bigint
            ELSE ( SELECT sys_vehicle_type.id
               FROM public.sys_vehicle_type
              WHERE ((sys_vehicle_type.type_code)::text = (vt.parent_code)::text))
        END AS parent_id,
    display_name_cn AS type_name,
    path_level AS level,
    create_by,
    create_time,
    update_by,
    update_time,
    description AS remark,
    type_code,
    full_path
   FROM public.sys_vehicle_type vt
  WHERE (enabled = true);

-- Name: sys_vehicle_type_new_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.sys_vehicle_type_new_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: sys_vehicle_type_new_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.sys_vehicle_type_new_id_seq OWNED BY public.sys_vehicle_type.id;

-- Name: transport_routes; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.transport_routes (
    id bigint NOT NULL,
    route_name character varying(100) NOT NULL,
    route_type character varying(20) NOT NULL,
    description character varying(500),
    route_geometry public.geometry(LineString,4326) NOT NULL,
    max_speed_kph double precision,
    typical_speed_kph double precision,
    active_time_start time without time zone,
    active_time_end time without time zone,
    status character varying(20) DEFAULT 'ACTIVE'::character varying,
    is_bidirectional boolean DEFAULT false,
    created_by character varying(50),
    updated_by character varying(50),
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT transport_routes_max_speed_kph_check CHECK ((max_speed_kph > (0)::double precision)),
    CONSTRAINT transport_routes_route_type_check CHECK (((route_type)::text = ANY ((ARRAY['AIRCRAFT'::character varying, 'UNMANNED_VEHICLE'::character varying, 'SPECIAL_VEHICLE'::character varying, 'NORMAL_VEHICLE'::character varying])::text[]))),
    CONSTRAINT transport_routes_status_check CHECK (((status)::text = ANY ((ARRAY['ACTIVE'::character varying, 'INACTIVE'::character varying, 'MAINTENANCE'::character varying])::text[]))),
    CONSTRAINT transport_routes_typical_speed_kph_check CHECK ((typical_speed_kph > (0)::double precision))
);

-- Name: TABLE transport_routes; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.transport_routes IS '交通路径定义表 - 存储航空器和无人车的预定路径';

-- Name: transport_routes_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.transport_routes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: transport_routes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.transport_routes_id_seq OWNED BY public.transport_routes.id;

-- Name: uv_violation_events; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.uv_violation_events (
    id bigint NOT NULL,
    vehicle_id bigint NOT NULL,
    vehicle_license character varying(50),
    rule_name character varying(100) NOT NULL,
    violation_type character varying(50) NOT NULL,
    alert_level character varying(50) NOT NULL,
    description character varying(150),
    location public.geometry(Point,4326),
    actual_value double precision,
    limit_value double precision,
    violation_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    CONSTRAINT uv_violation_events_alert_level_check CHECK (((alert_level)::text = ANY ((ARRAY['INFO'::character varying, 'WARNING'::character varying, 'CRITICAL'::character varying, 'EMERGENCY'::character varying])::text[]))),
    CONSTRAINT uv_violation_events_violation_type_check CHECK (((violation_type)::text = ANY ((ARRAY['SPEED'::character varying, 'ACCESS'::character varying, 'HEIGHT'::character varying, 'WEIGHT'::character varying, 'OTHER'::character varying])::text[])))
);

-- Name: TABLE uv_violation_events; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.uv_violation_events IS '无人车违规事件表 - 专门记录机场无人车的各种违规行为';

-- Name: COLUMN uv_violation_events.id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.id IS '主键ID，自增';

-- Name: COLUMN uv_violation_events.vehicle_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.vehicle_id IS '车辆ID，关联sys_vehicle_info.vehicle_id，用于内部处理和查询优化';

-- Name: COLUMN uv_violation_events.vehicle_license; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.vehicle_license IS '无人车车牌号，用于显示和业务标识，可为空';

-- Name: COLUMN uv_violation_events.rule_name; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.rule_name IS '违规的规则名称';

-- Name: COLUMN uv_violation_events.violation_type; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.violation_type IS '违规类型：SPEED超速/ACCESS未授权进入/HEIGHT超高/WEIGHT超重';

-- Name: COLUMN uv_violation_events.alert_level; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.alert_level IS '告警级别：INFO信息/WARNING警告/CRITICAL严重/EMERGENCY紧急';

-- Name: COLUMN uv_violation_events.description; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.description IS '违规描述，如"超速: 19.8km/h"';

-- Name: COLUMN uv_violation_events.location; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.location IS '违规发生的地理位置（PostGIS Point）';

-- Name: COLUMN uv_violation_events.actual_value; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.actual_value IS '实际测量值，如实际速度19.8';

-- Name: COLUMN uv_violation_events.limit_value; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.limit_value IS '规则限制值，如限速5.0';

-- Name: COLUMN uv_violation_events.violation_time; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.violation_time IS '违规发生的时间';

-- Name: COLUMN uv_violation_events.created_at; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.uv_violation_events.created_at IS '记录创建时间';

-- Name: uv_violation_events_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.uv_violation_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: uv_violation_events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.uv_violation_events_id_seq OWNED BY public.uv_violation_events.id;

-- Name: vehicle_commands; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.vehicle_commands (
    id bigint NOT NULL,
    trans_id character varying(100) NOT NULL,
    "timestamp" timestamp without time zone NOT NULL,
    command_type character varying(20) NOT NULL,
    command_reason character varying(30) NOT NULL,
    signal_state character varying(10),
    intersection_id character varying(50),
    target_location public.geometry(Point,4326) NOT NULL,
    relative_speed double precision,
    relative_motion_x double precision,
    relative_motion_y double precision,
    min_distance double precision,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    vehicle_id bigint,
    CONSTRAINT vehicle_commands_command_reason_check CHECK (((command_reason)::text = ANY ((ARRAY['TRAFFIC_LIGHT'::character varying, 'AIRCRAFT_CROSSING'::character varying, 'SPECIAL_VEHICLE'::character varying, 'AIRCRAFT_PUSH'::character varying, 'RESUME_TRAFFIC'::character varying, 'PARKING_SIDE'::character varying])::text[]))),
    CONSTRAINT vehicle_commands_command_type_check CHECK (((command_type)::text = ANY ((ARRAY['ALERT'::character varying, 'SIGNAL'::character varying, 'WARNING'::character varying, 'RESUME'::character varying, 'PARKING'::character varying])::text[]))),
    CONSTRAINT vehicle_commands_signal_state_check CHECK (((signal_state)::text = ANY ((ARRAY['RED'::character varying, 'YELLOW'::character varying, 'GREEN'::character varying])::text[])))
);

-- Name: TABLE vehicle_commands; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.vehicle_commands IS '无人车控制指令表，用于存储发送给无人车的控制指令，支持轨迹回放和日志审计';

-- Name: COLUMN vehicle_commands.vehicle_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.vehicle_commands.vehicle_id IS '系统车辆ID，对应sys_vehicle_info.vehicle_id';

-- Name: vehicle_commands_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.vehicle_commands_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: vehicle_commands_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.vehicle_commands_id_seq OWNED BY public.vehicle_commands.id;

-- Name: vehicle_locations; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.vehicle_locations (
    id bigint NOT NULL,
    location public.geometry(Point,4326) NOT NULL,
    altitude double precision,
    heading double precision,
    speed double precision,
    "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    data_quality character varying(20),
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    vehicle_id bigint,
    CONSTRAINT vehicle_locations_heading_check CHECK (((heading >= (0)::double precision) AND (heading < (360)::double precision))),
    CONSTRAINT vehicle_locations_speed_check CHECK ((speed >= (0)::double precision))
);

-- Name: TABLE vehicle_locations; Type: COMMENT; Schema: public; Owner: 
COMMENT ON TABLE public.vehicle_locations IS '车辆位置信息表（规范化版本）- 只存储位置相关数据，车辆基础信息通过关联查询获取';

-- Name: COLUMN vehicle_locations.vehicle_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.vehicle_locations.vehicle_id IS '系统车辆ID，对应sys_vehicle_info.vehicle_id';

-- Name: vehicle_complete_info; Type: VIEW; Schema: public; Owner: 
CREATE VIEW public.vehicle_complete_info AS
 SELECT vi.vehicle_id,
    vi.license_plate,
    vi.vin_number,
    vi.type_code,
    vt.display_name_cn AS type_name,
    vt.type_name AS type_code_name,
    vi.brand,
    vi.owning_unit,
    vi.contact_person,
    vi.phone_number,
    vi.image_url,
    vl.location,
    vl.altitude,
    vl.heading,
    vl.speed,
    vl."timestamp" AS last_location_time,
    vl.data_quality,
    vi.create_time,
    vi.update_time
   FROM ((public.sys_vehicle_info vi
     LEFT JOIN public.sys_vehicle_type vt ON (((vi.type_code)::text = (vt.type_code)::text)))
     LEFT JOIN LATERAL ( SELECT vehicle_locations.id,
            vehicle_locations.location,
            vehicle_locations.altitude,
            vehicle_locations.heading,
            vehicle_locations.speed,
            vehicle_locations."timestamp",
            vehicle_locations.data_quality,
            vehicle_locations.created_at,
            vehicle_locations.updated_at,
            vehicle_locations.vehicle_id
           FROM public.vehicle_locations
          WHERE (vehicle_locations.vehicle_id = vi.vehicle_id)
          ORDER BY vehicle_locations."timestamp" DESC
         LIMIT 1) vl ON (true));

-- Name: vehicle_info_with_location; Type: VIEW; Schema: public; Owner: 
CREATE VIEW public.vehicle_info_with_location AS
 SELECT vi.vehicle_id,
    vi.license_plate,
    vi.type_code,
    vt.display_name_cn AS type_name,
    vi.brand,
    vl.location,
    vl.speed,
    vl."timestamp" AS last_update
   FROM ((public.sys_vehicle_info vi
     LEFT JOIN public.sys_vehicle_type vt ON (((vi.type_code)::text = (vt.type_code)::text)))
     LEFT JOIN LATERAL ( SELECT vehicle_locations.location,
            vehicle_locations.speed,
            vehicle_locations."timestamp",
            vehicle_locations.vehicle_id
           FROM public.vehicle_locations
          WHERE (vehicle_locations.vehicle_id = vi.vehicle_id)
          ORDER BY vehicle_locations."timestamp" DESC
         LIMIT 1) vl ON (true));

-- Name: vehicle_locations_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.vehicle_locations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: vehicle_locations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.vehicle_locations_id_seq OWNED BY public.vehicle_locations.id;

-- Name: vehicle_status_summary; Type: VIEW; Schema: public; Owner: 
CREATE VIEW public.vehicle_status_summary AS
 SELECT count(*) AS total_vehicles,
    count(
        CASE
            WHEN (last_location_time > (now() - '00:05:00'::interval)) THEN 1
            ELSE NULL::integer
        END) AS active_vehicles,
    count(
        CASE
            WHEN ((last_location_time > (now() - '00:30:00'::interval)) AND (last_location_time <= (now() - '00:05:00'::interval))) THEN 1
            ELSE NULL::integer
        END) AS inactive_vehicles,
    count(
        CASE
            WHEN ((last_location_time IS NULL) OR (last_location_time <= (now() - '00:30:00'::interval))) THEN 1
            ELSE NULL::integer
        END) AS offline_vehicles,
    avg(speed) AS avg_speed,
    max(speed) AS max_speed
   FROM public.vehicle_complete_info;

-- Name: vehicle_trajectories; Type: TABLE; Schema: public; Owner: 
CREATE TABLE public.vehicle_trajectories (
    id bigint NOT NULL,
    trajectory_date date NOT NULL,
    trajectory_line public.geometry(LineString,4326),
    total_distance double precision,
    max_speed double precision,
    avg_speed double precision,
    duration_seconds integer,
    point_count integer,
    start_time timestamp with time zone NOT NULL,
    end_time timestamp with time zone NOT NULL,
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    vehicle_id bigint
);

-- Name: COLUMN vehicle_trajectories.vehicle_id; Type: COMMENT; Schema: public; Owner: 
COMMENT ON COLUMN public.vehicle_trajectories.vehicle_id IS '系统车辆ID，对应sys_vehicle_info.vehicle_id';

-- Name: vehicle_trajectories_id_seq; Type: SEQUENCE; Schema: public; Owner: 
CREATE SEQUENCE public.vehicle_trajectories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

-- Name: vehicle_trajectories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 
ALTER SEQUENCE public.vehicle_trajectories_id_seq OWNED BY public.vehicle_trajectories.id;

-- Name: airport_areas id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.airport_areas ALTER COLUMN id SET DEFAULT nextval('public.airport_areas_id_seq'::regclass);

-- Name: conflict_alert_logs id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.conflict_alert_logs ALTER COLUMN id SET DEFAULT nextval('public.conflict_alert_logs_id_seq'::regclass);

-- Name: gen_table table_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.gen_table ALTER COLUMN table_id SET DEFAULT nextval('public.gen_table_table_id_seq'::regclass);

-- Name: gen_table_column column_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.gen_table_column ALTER COLUMN column_id SET DEFAULT nextval('public.gen_table_column_column_id_seq'::regclass);

-- Name: object_route_assignments id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.object_route_assignments ALTER COLUMN id SET DEFAULT nextval('public.object_route_assignments_id_seq'::regclass);

-- Name: sys_config config_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_config ALTER COLUMN config_id SET DEFAULT nextval('public.sys_config_config_id_seq'::regclass);

-- Name: sys_dept dept_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_dept ALTER COLUMN dept_id SET DEFAULT nextval('public.sys_dept_dept_id_seq'::regclass);

-- Name: sys_dict_data dict_code; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_dict_data ALTER COLUMN dict_code SET DEFAULT nextval('public.sys_dict_data_dict_code_seq'::regclass);

-- Name: sys_dict_type dict_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_dict_type ALTER COLUMN dict_id SET DEFAULT nextval('public.sys_dict_type_dict_id_seq'::regclass);

-- Name: sys_job job_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_job ALTER COLUMN job_id SET DEFAULT nextval('public.sys_job_job_id_seq'::regclass);

-- Name: sys_job_log job_log_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_job_log ALTER COLUMN job_log_id SET DEFAULT nextval('public.sys_job_log_job_log_id_seq'::regclass);

-- Name: sys_logininfor info_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_logininfor ALTER COLUMN info_id SET DEFAULT nextval('public.sys_logininfor_info_id_seq'::regclass);

-- Name: sys_menu menu_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_menu ALTER COLUMN menu_id SET DEFAULT nextval('public.sys_menu_menu_id_seq'::regclass);

-- Name: sys_notice notice_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_notice ALTER COLUMN notice_id SET DEFAULT nextval('public.sys_notice_notice_id_seq'::regclass);

-- Name: sys_oper_log oper_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_oper_log ALTER COLUMN oper_id SET DEFAULT nextval('public.sys_oper_log_oper_id_seq'::regclass);

-- Name: sys_post post_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_post ALTER COLUMN post_id SET DEFAULT nextval('public.sys_post_post_id_seq'::regclass);

-- Name: sys_role role_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_role ALTER COLUMN role_id SET DEFAULT nextval('public.sys_role_role_id_seq'::regclass);

-- Name: sys_user user_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_user ALTER COLUMN user_id SET DEFAULT nextval('public.sys_user_user_id_seq'::regclass);

-- Name: sys_vehicle_info vehicle_id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_vehicle_info ALTER COLUMN vehicle_id SET DEFAULT nextval('public.sys_vehicle_info_vehicle_id_seq'::regclass);

-- Name: sys_vehicle_type id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_vehicle_type ALTER COLUMN id SET DEFAULT nextval('public.sys_vehicle_type_new_id_seq'::regclass);

-- Name: transport_routes id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.transport_routes ALTER COLUMN id SET DEFAULT nextval('public.transport_routes_id_seq'::regclass);

-- Name: uv_violation_events id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.uv_violation_events ALTER COLUMN id SET DEFAULT nextval('public.uv_violation_events_id_seq'::regclass);

-- Name: vehicle_commands id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.vehicle_commands ALTER COLUMN id SET DEFAULT nextval('public.vehicle_commands_id_seq'::regclass);

-- Name: vehicle_locations id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.vehicle_locations ALTER COLUMN id SET DEFAULT nextval('public.vehicle_locations_id_seq'::regclass);

-- Name: vehicle_trajectories id; Type: DEFAULT; Schema: public; Owner: 
ALTER TABLE ONLY public.vehicle_trajectories ALTER COLUMN id SET DEFAULT nextval('public.vehicle_trajectories_id_seq'::regclass);

-- Name: qrtz_blob_triggers QRTZ_BLOB_TRIGGERS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_blob_triggers
    ADD CONSTRAINT "QRTZ_BLOB_TRIGGERS_pkey" PRIMARY KEY (sched_name, trigger_name, trigger_group);

-- Name: qrtz_calendars QRTZ_CALENDARS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_calendars
    ADD CONSTRAINT "QRTZ_CALENDARS_pkey" PRIMARY KEY (sched_name, calendar_name);

-- Name: qrtz_cron_triggers QRTZ_CRON_TRIGGERS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_cron_triggers
    ADD CONSTRAINT "QRTZ_CRON_TRIGGERS_pkey" PRIMARY KEY (sched_name, trigger_name, trigger_group);

-- Name: qrtz_fired_triggers QRTZ_FIRED_TRIGGERS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_fired_triggers
    ADD CONSTRAINT "QRTZ_FIRED_TRIGGERS_pkey" PRIMARY KEY (sched_name, entry_id);

-- Name: qrtz_job_details QRTZ_JOB_DETAILS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_job_details
    ADD CONSTRAINT "QRTZ_JOB_DETAILS_pkey" PRIMARY KEY (sched_name, job_name, job_group);

-- Name: qrtz_locks QRTZ_LOCKS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_locks
    ADD CONSTRAINT "QRTZ_LOCKS_pkey" PRIMARY KEY (sched_name, lock_name);

-- Name: qrtz_paused_trigger_grps QRTZ_PAUSED_TRIGGER_GRPS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_paused_trigger_grps
    ADD CONSTRAINT "QRTZ_PAUSED_TRIGGER_GRPS_pkey" PRIMARY KEY (sched_name, trigger_group);

-- Name: qrtz_scheduler_state QRTZ_SCHEDULER_STATE_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_scheduler_state
    ADD CONSTRAINT "QRTZ_SCHEDULER_STATE_pkey" PRIMARY KEY (sched_name, instance_name);

-- Name: qrtz_simple_triggers QRTZ_SIMPLE_TRIGGERS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_simple_triggers
    ADD CONSTRAINT "QRTZ_SIMPLE_TRIGGERS_pkey" PRIMARY KEY (sched_name, trigger_name, trigger_group);

-- Name: qrtz_simprop_triggers QRTZ_SIMPROP_TRIGGERS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_simprop_triggers
    ADD CONSTRAINT "QRTZ_SIMPROP_TRIGGERS_pkey" PRIMARY KEY (sched_name, trigger_name, trigger_group);

-- Name: qrtz_triggers QRTZ_TRIGGERS_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_triggers
    ADD CONSTRAINT "QRTZ_TRIGGERS_pkey" PRIMARY KEY (sched_name, trigger_name, trigger_group);

-- Name: airport_areas airport_areas_area_id_key; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.airport_areas
    ADD CONSTRAINT airport_areas_area_id_key UNIQUE (area_id);

-- Name: airport_areas airport_areas_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.airport_areas
    ADD CONSTRAINT airport_areas_pkey PRIMARY KEY (id);

-- Name: conflict_alert_logs conflict_alert_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.conflict_alert_logs
    ADD CONSTRAINT conflict_alert_logs_pkey PRIMARY KEY (id);

-- Name: flyway_schema_history flyway_schema_history_pk; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.flyway_schema_history
    ADD CONSTRAINT flyway_schema_history_pk PRIMARY KEY (installed_rank);

-- Name: gen_table_column gen_table_column_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.gen_table_column
    ADD CONSTRAINT gen_table_column_pkey PRIMARY KEY (column_id);

-- Name: gen_table gen_table_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.gen_table
    ADD CONSTRAINT gen_table_pkey PRIMARY KEY (table_id);

-- Name: geofence_events geofence_events_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.geofence_events
    ADD CONSTRAINT geofence_events_pkey PRIMARY KEY (id);

-- Name: object_route_assignments object_route_assignments_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.object_route_assignments
    ADD CONSTRAINT object_route_assignments_pkey PRIMARY KEY (id);

-- Name: spatial_rule_vehicle_types spatial_rule_vehicle_types_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.spatial_rule_vehicle_types
    ADD CONSTRAINT spatial_rule_vehicle_types_pkey PRIMARY KEY (rule_id, vehicle_type);

-- Name: spatial_rules spatial_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.spatial_rules
    ADD CONSTRAINT spatial_rules_pkey PRIMARY KEY (rule_id);

-- Name: sys_config sys_config_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_config
    ADD CONSTRAINT sys_config_pkey PRIMARY KEY (config_id);

-- Name: sys_dept sys_dept_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_dept
    ADD CONSTRAINT sys_dept_pkey PRIMARY KEY (dept_id);

-- Name: sys_dict_data sys_dict_data_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_dict_data
    ADD CONSTRAINT sys_dict_data_pkey PRIMARY KEY (dict_code);

-- Name: sys_dict_type sys_dict_type_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_dict_type
    ADD CONSTRAINT sys_dict_type_pkey PRIMARY KEY (dict_id);

-- Name: sys_driver_info sys_driver_info_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_driver_info
    ADD CONSTRAINT sys_driver_info_pkey PRIMARY KEY (user_id);

-- Name: sys_job_log sys_job_log_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_job_log
    ADD CONSTRAINT sys_job_log_pkey PRIMARY KEY (job_log_id);

-- Name: sys_job sys_job_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_job
    ADD CONSTRAINT sys_job_pkey PRIMARY KEY (job_id, job_name, job_group);

-- Name: sys_logininfor sys_logininfor_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_logininfor
    ADD CONSTRAINT sys_logininfor_pkey PRIMARY KEY (info_id);

-- Name: sys_menu sys_menu_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_menu
    ADD CONSTRAINT sys_menu_pkey PRIMARY KEY (menu_id);

-- Name: sys_notice sys_notice_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_notice
    ADD CONSTRAINT sys_notice_pkey PRIMARY KEY (notice_id);

-- Name: sys_oper_log sys_oper_log_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_oper_log
    ADD CONSTRAINT sys_oper_log_pkey PRIMARY KEY (oper_id);

-- Name: sys_post sys_post_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_post
    ADD CONSTRAINT sys_post_pkey PRIMARY KEY (post_id);

-- Name: sys_role_dept sys_role_dept_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_role_dept
    ADD CONSTRAINT sys_role_dept_pkey PRIMARY KEY (role_id, dept_id);

-- Name: sys_role_menu sys_role_menu_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_role_menu
    ADD CONSTRAINT sys_role_menu_pkey PRIMARY KEY (role_id, menu_id);

-- Name: sys_role sys_role_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_role
    ADD CONSTRAINT sys_role_pkey PRIMARY KEY (role_id);

-- Name: sys_user sys_user_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_user
    ADD CONSTRAINT sys_user_pkey PRIMARY KEY (user_id);

-- Name: sys_user_post sys_user_post_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_user_post
    ADD CONSTRAINT sys_user_post_pkey PRIMARY KEY (user_id, post_id);

-- Name: sys_user_role sys_user_role_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_user_role
    ADD CONSTRAINT sys_user_role_pkey PRIMARY KEY (user_id, role_id);

-- Name: sys_vehicle_info sys_vehicle_info_license_plate_number_key; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_vehicle_info
    ADD CONSTRAINT sys_vehicle_info_license_plate_number_key UNIQUE (license_plate);

-- Name: sys_vehicle_info sys_vehicle_info_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_vehicle_info
    ADD CONSTRAINT sys_vehicle_info_pkey PRIMARY KEY (vehicle_id);

-- Name: sys_vehicle_info sys_vehicle_info_vin_number_key; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_vehicle_info
    ADD CONSTRAINT sys_vehicle_info_vin_number_key UNIQUE (vin_number);

-- Name: sys_vehicle_type sys_vehicle_type_new_code_unique; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_vehicle_type
    ADD CONSTRAINT sys_vehicle_type_new_code_unique UNIQUE (type_code);

-- Name: sys_vehicle_type sys_vehicle_type_new_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_vehicle_type
    ADD CONSTRAINT sys_vehicle_type_new_pkey PRIMARY KEY (id);

-- Name: transport_routes transport_routes_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.transport_routes
    ADD CONSTRAINT transport_routes_pkey PRIMARY KEY (id);

-- Name: geofence_events ukaxyk98nttupuc7nuten8s5aad; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.geofence_events
    ADD CONSTRAINT ukaxyk98nttupuc7nuten8s5aad UNIQUE (event_id);

-- Name: uv_violation_events uv_violation_events_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.uv_violation_events
    ADD CONSTRAINT uv_violation_events_pkey PRIMARY KEY (id);

-- Name: vehicle_commands vehicle_commands_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.vehicle_commands
    ADD CONSTRAINT vehicle_commands_pkey PRIMARY KEY (id);

-- Name: vehicle_locations vehicle_locations_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.vehicle_locations
    ADD CONSTRAINT vehicle_locations_pkey PRIMARY KEY (id);

-- Name: vehicle_trajectories vehicle_trajectories_pkey; Type: CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.vehicle_trajectories
    ADD CONSTRAINT vehicle_trajectories_pkey PRIMARY KEY (id);

-- Name: dict_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX dict_type ON public.sys_dict_type USING btree (dict_type);

-- Name: flyway_schema_history_s_idx; Type: INDEX; Schema: public; Owner: 
CREATE INDEX flyway_schema_history_s_idx ON public.flyway_schema_history USING btree (success);

-- Name: idx_airport_areas_area_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_airport_areas_area_id ON public.airport_areas USING btree (area_id);

-- Name: idx_airport_areas_enabled; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_airport_areas_enabled ON public.airport_areas USING btree (enabled);

-- Name: idx_airport_areas_functional_category; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_airport_areas_functional_category ON public.airport_areas USING btree (functional_category);

-- Name: idx_airport_areas_geom; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_airport_areas_geom ON public.airport_areas USING gist (boundary);

-- Name: idx_airport_areas_parent_area_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_airport_areas_parent_area_id ON public.airport_areas USING btree (parent_area_id);

-- Name: idx_airport_areas_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_airport_areas_type ON public.airport_areas USING btree (type);

-- Name: idx_conflict_alerts_level; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_conflict_alerts_level ON public.conflict_alert_logs USING btree (alert_level);

-- Name: idx_conflict_alerts_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_conflict_alerts_time ON public.conflict_alert_logs USING btree (alert_time DESC);

-- Name: idx_conflict_alerts_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_conflict_alerts_type ON public.conflict_alert_logs USING btree (alert_type);

-- Name: idx_geofence_events_alert_level; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_geofence_events_alert_level ON public.geofence_events USING btree (alert_level);

-- Name: idx_geofence_events_event_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_geofence_events_event_id ON public.geofence_events USING btree (event_id);

-- Name: idx_geofence_events_fence_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_geofence_events_fence_id ON public.geofence_events USING btree (fence_id);

-- Name: idx_geofence_events_processed; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_geofence_events_processed ON public.geofence_events USING btree (processed);

-- Name: idx_geofence_events_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_geofence_events_time ON public.geofence_events USING btree (event_time);

-- Name: idx_geofence_events_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_geofence_events_type ON public.geofence_events USING btree (event_type);

-- Name: idx_geofence_events_vehicle_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_geofence_events_vehicle_id ON public.geofence_events USING btree (vehicle_id);

-- Name: idx_object_route_assignments_assigned_at; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_object_route_assignments_assigned_at ON public.object_route_assignments USING btree (assigned_at DESC);

-- Name: idx_object_route_assignments_object_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_object_route_assignments_object_type ON public.object_route_assignments USING btree (object_type);

-- Name: idx_object_route_assignments_route; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_object_route_assignments_route ON public.object_route_assignments USING btree (assigned_route_id);

-- Name: idx_spatial_rules_category; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_spatial_rules_category ON public.spatial_rules USING btree (rule_category);

-- Name: idx_spatial_rules_object_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_spatial_rules_object_id ON public.spatial_rules USING btree (spatial_object_id);

-- Name: idx_spatial_rules_object_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_spatial_rules_object_type ON public.spatial_rules USING btree (spatial_object_type);

-- Name: idx_spatial_rules_priority; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_spatial_rules_priority ON public.spatial_rules USING btree (priority);

-- Name: idx_spatial_rules_status; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_spatial_rules_status ON public.spatial_rules USING btree (status);

-- Name: idx_sys_vehicle_type_new_enabled; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_sys_vehicle_type_new_enabled ON public.sys_vehicle_type USING btree (enabled);

-- Name: idx_sys_vehicle_type_new_parent_code; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_sys_vehicle_type_new_parent_code ON public.sys_vehicle_type USING btree (parent_code);

-- Name: idx_sys_vehicle_type_new_path_level; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_sys_vehicle_type_new_path_level ON public.sys_vehicle_type USING btree (path_level);

-- Name: idx_sys_vehicle_type_new_sort_order; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_sys_vehicle_type_new_sort_order ON public.sys_vehicle_type USING btree (sort_order);

-- Name: idx_sys_vehicle_type_new_type_code; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_sys_vehicle_type_new_type_code ON public.sys_vehicle_type USING btree (type_code);

-- Name: idx_transport_routes_geometry_gist; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_transport_routes_geometry_gist ON public.transport_routes USING gist (route_geometry);

-- Name: idx_transport_routes_status; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_transport_routes_status ON public.transport_routes USING btree (status);

-- Name: idx_transport_routes_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_transport_routes_type ON public.transport_routes USING btree (route_type);

-- Name: idx_uv_violations_alert_level; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_alert_level ON public.uv_violation_events USING btree (alert_level);

-- Name: idx_uv_violations_location; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_location ON public.uv_violation_events USING gist (location);

-- Name: idx_uv_violations_rule; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_rule ON public.uv_violation_events USING btree (rule_name);

-- Name: idx_uv_violations_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_time ON public.uv_violation_events USING btree (violation_time);

-- Name: idx_uv_violations_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_type ON public.uv_violation_events USING btree (violation_type);

-- Name: idx_uv_violations_type_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_type_time ON public.uv_violation_events USING btree (violation_type, violation_time DESC);

-- Name: idx_uv_violations_vehicle_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_vehicle_id ON public.uv_violation_events USING btree (vehicle_id);

-- Name: idx_uv_violations_vehicle_id_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_vehicle_id_time ON public.uv_violation_events USING btree (vehicle_id, violation_time DESC);

-- Name: idx_uv_violations_vehicle_license; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_vehicle_license ON public.uv_violation_events USING btree (vehicle_license);

-- Name: idx_uv_violations_vehicle_license_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_uv_violations_vehicle_license_time ON public.uv_violation_events USING btree (vehicle_license, violation_time DESC);

-- Name: idx_vehicle_commands_command_type; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_commands_command_type ON public.vehicle_commands USING btree (command_type);

-- Name: idx_vehicle_commands_created_at; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_commands_created_at ON public.vehicle_commands USING btree (created_at);

-- Name: idx_vehicle_commands_location_gist; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_commands_location_gist ON public.vehicle_commands USING gist (target_location);

-- Name: idx_vehicle_commands_timestamp; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_commands_timestamp ON public.vehicle_commands USING btree ("timestamp" DESC);

-- Name: idx_vehicle_commands_trans_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_commands_trans_id ON public.vehicle_commands USING btree (trans_id);

-- Name: idx_vehicle_commands_type_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_commands_type_time ON public.vehicle_commands USING btree (command_type, "timestamp" DESC);

-- Name: idx_vehicle_commands_vehicle_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_commands_vehicle_id ON public.vehicle_commands USING btree (vehicle_id);

-- Name: idx_vehicle_locations_location_gist; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_locations_location_gist ON public.vehicle_locations USING gist (location);

-- Name: idx_vehicle_locations_sys_vehicle_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_locations_sys_vehicle_id ON public.vehicle_locations USING btree (vehicle_id);

-- Name: idx_vehicle_locations_timestamp; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_locations_timestamp ON public.vehicle_locations USING btree ("timestamp" DESC);

-- Name: idx_vehicle_locations_vehicle_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_locations_vehicle_id ON public.vehicle_locations USING btree (vehicle_id);

-- Name: idx_vehicle_locations_vehicle_time; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_locations_vehicle_time ON public.vehicle_locations USING btree (vehicle_id, "timestamp" DESC);

-- Name: idx_vehicle_trajectories_date; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_trajectories_date ON public.vehicle_trajectories USING btree (trajectory_date DESC);

-- Name: idx_vehicle_trajectories_line_gist; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_trajectories_line_gist ON public.vehicle_trajectories USING gist (trajectory_line);

-- Name: idx_vehicle_trajectories_vehicle_id; Type: INDEX; Schema: public; Owner: 
CREATE INDEX idx_vehicle_trajectories_vehicle_id ON public.vehicle_trajectories USING btree (vehicle_id);

-- Name: sched_name; Type: INDEX; Schema: public; Owner: 
CREATE INDEX sched_name ON public.qrtz_triggers USING btree (sched_name, job_name, job_group);

-- Name: transport_routes trigger_transport_routes_updated_at; Type: TRIGGER; Schema: public; Owner: 
CREATE TRIGGER trigger_transport_routes_updated_at BEFORE UPDATE ON public.transport_routes FOR EACH ROW EXECUTE FUNCTION public.update_timestamp_column();

-- Name: vehicle_locations trigger_vehicle_locations_updated_at; Type: TRIGGER; Schema: public; Owner: 
CREATE TRIGGER trigger_vehicle_locations_updated_at BEFORE UPDATE ON public.vehicle_locations FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column();

-- Name: qrtz_blob_triggers QRTZ_BLOB_TRIGGERS_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_blob_triggers
    ADD CONSTRAINT "QRTZ_BLOB_TRIGGERS_ibfk_1" FOREIGN KEY (sched_name, trigger_name, trigger_group) REFERENCES public.qrtz_triggers(sched_name, trigger_name, trigger_group);

-- Name: qrtz_cron_triggers QRTZ_CRON_TRIGGERS_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_cron_triggers
    ADD CONSTRAINT "QRTZ_CRON_TRIGGERS_ibfk_1" FOREIGN KEY (sched_name, trigger_name, trigger_group) REFERENCES public.qrtz_triggers(sched_name, trigger_name, trigger_group);

-- Name: qrtz_simple_triggers QRTZ_SIMPLE_TRIGGERS_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_simple_triggers
    ADD CONSTRAINT "QRTZ_SIMPLE_TRIGGERS_ibfk_1" FOREIGN KEY (sched_name, trigger_name, trigger_group) REFERENCES public.qrtz_triggers(sched_name, trigger_name, trigger_group);

-- Name: qrtz_simprop_triggers QRTZ_SIMPROP_TRIGGERS_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_simprop_triggers
    ADD CONSTRAINT "QRTZ_SIMPROP_TRIGGERS_ibfk_1" FOREIGN KEY (sched_name, trigger_name, trigger_group) REFERENCES public.qrtz_triggers(sched_name, trigger_name, trigger_group);

-- Name: qrtz_triggers QRTZ_TRIGGERS_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.qrtz_triggers
    ADD CONSTRAINT "QRTZ_TRIGGERS_ibfk_1" FOREIGN KEY (sched_name, job_name, job_group) REFERENCES public.qrtz_job_details(sched_name, job_name, job_group);

-- Name: spatial_rule_vehicle_types fk_spatial_rule_vehicle_types_rule; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.spatial_rule_vehicle_types
    ADD CONSTRAINT fk_spatial_rule_vehicle_types_rule FOREIGN KEY (rule_id) REFERENCES public.spatial_rules(rule_id) ON DELETE CASCADE;

-- Name: object_route_assignments object_route_assignments_assigned_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.object_route_assignments
    ADD CONSTRAINT object_route_assignments_assigned_route_id_fkey FOREIGN KEY (assigned_route_id) REFERENCES public.transport_routes(id);

-- Name: sys_driver_info sys_driver_info_fk1; Type: FK CONSTRAINT; Schema: public; Owner: 
ALTER TABLE ONLY public.sys_driver_info
    ADD CONSTRAINT sys_driver_info_fk1 FOREIGN KEY (user_id) REFERENCES public.sys_user(user_id);


--
-- PostgreSQL database dump complete
--

