Pārlūkot izejas kodu

提交建表语句

17608069186 3 mēneši atpakaļ
vecāks
revīzija
e2e31536a4

+ 180 - 0
sql/2025/11/create_cxf_20251107.sql

@@ -0,0 +1,180 @@
+create table iot_device
+(
+    id          bigint unsigned auto_increment primary key,
+    tenant_id   varchar(128)                 not null default ''  comment '租户id',
+    company_id  bigint unsigned              not null default  0  comment '所属客户id',
+    guid        varchar(255)                 not null default ''  comment '唯一标识[暂时保留]',
+    device_code varchar(255)                 not null default ''  comment '设备编号',
+    sn          varchar(255)                 not null default ''  comment 'sn通常是:IMEI',
+    mod_code    varchar(255)                 not null default ''  comment '物联网模型码值',
+    device_name varchar(255)                 not null default ''  comment '设备名称[旧系统的title]',
+    brand       varchar(255)                 not null default ''  comment '设备品牌名称',
+    model_code  varchar(255)                 not null default ''  comment '型号',
+    description varchar(1024)                not null default ''  comment '最后一次设备更新信息值[旧系统的desc]',
+    remarks     varchar(255) charset utf8mb4 not null default ''  comment '备注',
+    status      tinyint unsigned             not null default 1   comment '1在线2离线3异常',
+    longitude   varchar(40)                  not null default ''  comment '经度[lng]',
+    latitude    varchar(40)                  not null default ''  comment '纬度[lat]',
+    high        varchar(40)                  not null default ''  comment '高度',
+    create_time datetime                     not null default current_timestamp comment '创建时间',
+    update_time datetime                     not null default current_timestamp on update CURRENT_TIMESTAMP comment '更新时间',
+    create_user varchar(255)                 not null default '' comment '创建人',
+    update_user varchar(255)                 not null default '' comment '更新人',
+    del_flag    tinyint                      not null default 0 comment '0-未删除,1-删除',
+    eg_id       bigint                       not null default -1  comment '设备类别',
+    constraint guid unique (guid)
+) comment '设备表';
+
+
+
+
+create table iot_device_group
+(
+    id          bigint unsigned auto_increment  primary key,
+    device_group_code  varchar(255)           not null default '' comment '设备分组码值',
+    tenant_id    varchar(255)                 not null default '' comment '租户id',
+    company_id   bigint                       not null default 0  comment '所属客户id',
+    title       varchar(255)                  not null default '' comment '设备分组名称',
+    large_type  tinyint unsigned              not null default 0  comment '[有点晕?]1-12(车辆、装载机、矿卡、人员、水表、电表、边坡监控、视频监控、皮带称重、环境监测、无人地磅、排放监测)',
+    del_flag    tinyint                       not null default 0  comment '0-未删除,1-删除',
+    create_time datetime                      not null default CURRENT_TIMESTAMP comment '创建时间',
+    update_time datetime                      not null default current_timestamp on update CURRENT_TIMESTAMP comment '更新时间',
+    create_user varchar(255)              not null default '' comment '创建人',
+    update_user varchar(255)                  not null default '' comment '更新人'
+) comment '设备分组表';
+
+
+create table iot_mod_group
+(
+    id          bigint unsigned auto_increment primary key,
+    company_id  bigint unsigned             not null default 0 comment '所属客户id',
+    tenant_id    varchar(255)                 not null default '' comment '租户id',
+    mode_group_code  varchar(255)           not null default '' comment '物理模型分组码值唯一标识',
+    name        varchar(255)                not null default '' comment '物模型分组名称',
+    create_time datetime                    not null default CURRENT_TIMESTAMP comment '创建时间',
+    update_time datetime                    not null default current_timestamp on update CURRENT_TIMESTAMP,
+    del_flag    tinyint                     not null default 0 comment '0-未删除,1-删除',
+    create_user varchar(255)                not null default '' comment '创建人',
+    update_user varchar(255)                not null default '' comment '修改人',
+    constraint name unique (mode_group_code)
+) comment '物理模型分组表';
+
+
+
+create table iot_mod
+(
+    id          bigint unsigned auto_increment primary key,
+    mod_code    varchar(255)                            not null default '' comment '物理模型码值',
+    company_id  bigint unsigned                         not null default 0  comment '所属客户id',
+    mode_group_code  varchar(255)                       not null default '' comment '物模型分组码值',
+    guid        varchar(255) collate utf8mb4_general_ci not null default '' comment '唯一标识',
+    name        varchar(255)                            not null default '' comment '物模型名称',
+    description      varchar(255)                            not null default '' comment '最后一次更新值[原来字段 desc]',
+    remarks     varchar(255)                            not null default '' comment '备注',
+    tsl_json    text                                    null                comment '包含JSON',
+    version     int unsigned                            not null default 1  comment '版本[原来字段 tsl_ver]',
+    num         int unsigned                            not null default 0  comment '设备数',
+    del_flag    tinyint                                 not null default 0  comment '0-未删除,1-删除',
+    create_user varchar(255)                            not null default '' comment '创建人',
+    update_user varchar(255)                            not null default '' comment '更新人',
+    create_time datetime                                not null default current_timestamp comment '创建时间',
+    update_time datetime                                not null default current_timestamp on update CURRENT_TIMESTAMP comment '更新时间'
+)comment '物模型lot表' ;
+
+create table iot_device_error
+(
+    id          bigint unsigned auto_increment primary key,
+    device_code varchar(255)                 not null default ''  comment '设备编号',
+    guid        varchar(255)                 not null default ''  comment '唯一标识[暂时保留]',
+    error_reason   text                      null                  comment '设备异常原因',
+    create_time datetime                     not null default current_timestamp comment '创建时间',
+    update_time datetime                     not null default current_timestamp on update CURRENT_TIMESTAMP comment '更新时间',
+    create_user varchar(255)                 not null default '' comment '创建人',
+    update_user varchar(255)                 not null default '' comment '更新人',
+    del_flag    tinyint                      not null default 0 comment '0-未删除,1-删除'
+
+)comment '设备异常记录表';
+
+create table iot_mod_error
+(
+    id          bigint unsigned auto_increment
+        primary key,
+    mod_code varchar(255)                    not null default ''  comment '物理模型编号',
+    error_reason   text                      null                 comment '设备异常原因',
+    create_time datetime                     not null default current_timestamp comment '创建时间',
+    update_time datetime                     not null default current_timestamp on update CURRENT_TIMESTAMP comment '更新时间',
+    create_user varchar(255)                 not null default '' comment '创建人',
+    update_user varchar(255)                 not null default '' comment '更新人',
+    del_flag    tinyint                      not null default 0 comment '0-未删除,1-删除'
+
+)comment '物理模型设备异常记录表';
+
+
+
+create table iot_td_rutting
+(
+    id          bigint unsigned auto_increment
+        primary key,
+    table_name varchar(255)                  not null default ''  comment 'td数据库表名',
+    tenant_id   varchar(128)                 not null default ''  comment '租户id',
+    guid        varchar(255)                 not null default ''  comment '设备唯一id',
+    create_time datetime                     not null default current_timestamp comment '创建时间'
+
+)comment 'td数据库路由表';
+--    create table iot_device_history
+--    (
+--        id          int unsigned auto_increment
+--            primary key,
+--        guid        varchar(255) not null default '' comment '设备guid标识',
+--        sn          varchar(255) not null default '' comment '设备唯一sn码标识',
+--        value       varchar(20)  not null default '' comment '某天最后一条值',
+--        large_type  tinyint      not null default -1 comment '1-12(车辆、装载机、矿卡、人员、水表、电表、边坡监控、视频监控、皮带称重、环境监测、无人地磅、排放监测)',
+--        unit        varchar(10)  not null default '' comment '单位',
+--        create_time datetime     not null default current_timestamp comment '对应某天时间'
+--    )comment '设备归档表';
+--
+--
+--
+--
+--
+--
+--
+--
+--
+--    create table saas_point_position_device
+--    (
+--        id          bigint unsigned auto_increment
+--            primary key,
+--        p_id        bigint                       not null default -1 comment '点位表id',
+--        guid        varchar(120)                 not null default '' comment '设备id',
+--        device_group_code varchar(255)        not null default '' comment '物联网设备的分组id或摄像头设备的标签id',
+--        category    tinyint unsigned             not null default 2  comment '1-iot ,2-device',
+--        create_time datetime                     not null default current_timestamp comment '创建时间',
+--        update_time datetime                     not null default current_timestamp on update CURRENT_TIMESTAMP comment '更新时间',
+--        del_flag    tinyint                      not null default 0  comment '0-未删除,1-删除',
+--        status      tinyint unsigned             not null default 1 comment '1启用,2禁用',
+--        constraint p_id_2
+--            unique (p_id, guid, category)
+--    ) comment '大屏点位设备关系表';
+--
+--    create index guid
+--        on saas_point_position_device (guid);
+--
+--    create index p_id
+--        on saas_point_position_device (p_id);
+--
+--
+--
+--
+--
+--    create index guid
+--        on iot_device_history (guid);
+--
+--    create index guid_2
+--        on iot_device_history (guid, create_time);
+
+
+
+
+
+

+ 371 - 0
sql/2025/11/create_cxf_td_20251107.sql

@@ -0,0 +1,371 @@
+物联网管理TD数据表
+
+1、水表监测超级表
+CREATE STABLE IF NOT EXISTS water_meter (
+  ts TIMESTAMP,               -- 时间戳
+  flow FLOAT,                 -- 瞬时流量
+  pressure FLOAT,             -- 水压
+  total_volume FLOAT,         -- 累计水量
+  battery_level FLOAT,        -- 电池电量
+  signal_strength INT,        -- 信号强度
+  status TINYINT,             -- 设备状态(1=正常,2=异常,3=离线)
+  alarm_type TINYINT          -- 告警类型(0=无,1=流量超限,2=压力异常)
+) TAGS (
+  device_id NCHAR(64),        -- 设备唯一ID
+  device_name NCHAR(100),     -- 设备名称
+  group_id INT,               -- 区域ID
+  group_name NCHAR(100),      -- 区域名称
+  biz_id INT,                 -- 业务ID
+  biz_name NCHAR(100),                 -- 业务名称
+  project_id INT,                 -- 项目ID
+  project_name NCHAR(100),         -- 项目名称
+  location NCHAR(200)         -- 安装位置
+  longitude NCHAR(200)        -- 经度
+  latitude NCHAR(200)         -- 纬度
+  tenant_id                   -- 租户ID
+);
+
+
+2、电表监测超级表
+CREATE STABLE IF NOT EXISTS electric_meter (
+  ts TIMESTAMP,               -- 时间戳
+  current FLOAT,              -- 电流
+  voltage FLOAT,              -- 电压
+  power FLOAT,                -- 功率
+  total_energy FLOAT,         -- 累计电量
+  battery_level FLOAT,        -- 电池电量
+  signal_strength INT,        -- 信号强度
+  status TINYINT,             -- 设备状态(1=正常,2=异常,3=离线)
+  alarm_type TINYINT          -- 告警类型(0=无,1=流量超限,2=压力异常)
+) TAGS (
+  device_id NCHAR(64),        -- 设备唯一ID
+  device_name NCHAR(100),     -- 设备名称
+  group_id INT,               -- 区域ID
+  group_name NCHAR(100),      -- 区域名称
+  biz_id INT,                 -- 业务ID
+  biz_name NCHAR(100),                 -- 业务名称
+  project_id INT,                 -- 项目ID
+  project_name NCHAR(100),         -- 项目名称
+  location NCHAR(200)         -- 安装位置
+  longitude NCHAR(200)        -- 经度
+  latitude NCHAR(200)         -- 纬度
+  tenant_id                   -- 租户ID
+);
+
+
+
+3、边坡监测超级表
+CREATE STABLE IF NOT EXISTS slope_monitor (
+  ts TIMESTAMP,               -- 时间戳
+  displacement FLOAT,         -- 位移
+  vibration FLOAT,            -- 振动值
+  battery_level FLOAT,        -- 电池电量
+  signal_strength INT,        -- 信号强度
+  status TINYINT,             -- 设备状态(1=正常,2=异常,3=离线)
+  alarm_type TINYINT          -- 告警类型(0=无告警,1=位移超限,2=振动超限)
+) TAGS (
+  device_id NCHAR(64),        -- 设备唯一ID
+  device_name NCHAR(100),     -- 设备名称
+  group_id INT,               -- 区域ID
+  group_name NCHAR(100),      -- 区域名称
+  biz_id INT,                 -- 业务ID
+  biz_name NCHAR(100),                 -- 业务名称
+  project_id INT,                 -- 项目ID
+  project_name NCHAR(100),         -- 项目名称
+  location NCHAR(200)         -- 安装位置
+  longitude NCHAR(200)        -- 经度
+  latitude NCHAR(200)         -- 纬度
+  tenant_id                   -- 租户ID
+);
+
+
+
+4、视频监控超级表
+CREATE STABLE IF NOT EXISTS device_monitor (
+  ts TIMESTAMP,               -- 时间戳字段
+  stream_type TINYINT,        -- 码流类型:1=主码流(高清),2=子码流(标清)
+  bitrate FLOAT,              -- 实时码率(Mbps,主码流通常2-8Mbps,子码流0.5-2Mbps)
+  resolution NCHAR(32),       -- 分辨率(如"1920x1080"、"2560x1440")
+  frame_rate INT,             -- 帧率(fps,通常15-30fps)
+  bitrate_fluctuation FLOAT,  -- 码率波动值(Mbps,反映码流稳定性,波动越小越好)
+  encoding_format NCHAR(32),  -- 编码格式(如"H.264"、"H.265"、"AV1")
+  packet_loss_rate FLOAT      -- 码流丢包率(%,网络传输质量指标,0为最佳)
+
+  storage_total FLOAT,        -- 总存储容量(GB)
+  storage_used FLOAT,         -- 已用存储容量(GB)
+  storage_used_rate FLOAT,    -- 存储使用率(%,=storage_used/storage_total*100)
+  record_status TINYINT,      -- 录像状态:1=正常录像,0=录像停止,2=录像异常(丢帧)
+  record_retention_days INT,  -- 录像保留天数(如30天,配置值)
+  remaining_days FLOAT,       -- 剩余可录像天数(=未用容量/(日均存储占用),预测值)
+  disk_health TINYINT         -- 硬盘健康状态:1=正常,2=亚健康(坏道预警),3=故障
+
+  alarm_type TINYINT,         -- 告警类型:1=移动侦测,2=设备遮挡,3=视频断流,4=存储满,5=码流异常
+  alarm_level TINYINT,        -- 告警等级:1=紧急(需立即处理,如断流),2=重要(如遮挡),3=提示(如存储即将满)
+  alarm_desc NCHAR(200),      -- 告警描述(如"设备被遮挡,画面不可见")
+  alarm_duration INT,         -- 告警持续时间(秒,告警恢复时更新,未恢复则为NULL)
+  is_recovered TINYINT,       -- 是否恢复:1=已恢复,0=未恢复
+  recover_ts TIMESTAMP,       -- 恢复时间戳(is_recovered=1时非NULL,否则为NULL)
+  snapshot_url NCHAR(512)     -- 告警快照URL(如"http://storage-server/snap/20240928/cam001_alarm.jpg")
+  battery_level FLOAT,        -- 电池电量
+  signal_strength INT,        -- 信号强度
+  status TINYINT,             -- 设备状态(1=正常,2=异常,3=离线)
+  alarm_type TINYINT          -- 告警类型(0=无告警,1=位移超限,2=振动超限)
+) TAGS (
+  device_id NCHAR(64),        -- 设备唯一ID
+  device_name NCHAR(100),     -- 设备名称
+  device_type TINYINT,        -- 设备类型:1=温度监控,2=人流量监控,3=热力度监控等
+    group_id INT,               -- 区域ID
+    group_name NCHAR(100),      -- 区域名称
+    biz_id INT,                 -- 业务ID
+    biz_name NCHAR(100),                 -- 业务名称
+    project_id INT,                 -- 项目ID
+    project_name NCHAR(100),         -- 项目名称
+    location NCHAR(200)         -- 安装位置
+    longitude NCHAR(200)        -- 经度
+    latitude NCHAR(200)         -- 纬度
+    tenant_id                   -- 租户ID
+);
+
+
+-- 创建矿卡监测超级表
+CREATE STABLE IF NOT EXISTS mine_truck (
+  ts TIMESTAMP,                 -- 时间戳字段
+  running_status TINYINT,       -- 运行状态:1=行驶中,2=空载静止,3=满载静止,4=维修中,5=故障停机
+  engine_status TINYINT,        -- 发动机状态:1=启动,0=关闭,2=怠速
+  speed FLOAT,                  -- 行驶速度(km/h,静止时为0)
+  mileage FLOAT,                -- 累计里程(km,自上次重置起)
+  working_hours FLOAT,          -- 累计工作时长(h,发动机启动状态累计)
+  engine_rpm INT,               -- 发动机转速(r/min)
+  fuel_consumption FLOAT,       -- 瞬时油耗(L/h)
+  oil_pressure FLOAT,           -- 机油压力(kPa,正常范围80-400)
+  coolant_temp FLOAT,           -- 冷却液温度(℃,正常范围80-95)
+  battery_voltage FLOAT,        -- 蓄电池电压(V,正常范围24-28)
+  tire_pressure ARRAY[FLOAT,4], -- 四轮胎压(kPa,数组存储左前/右前/左后/右后)
+  latitude FLOAT,               -- 纬度
+  longitude FLOAT,              -- 经度
+  load_weight FLOAT,            -- 负载重量(t,空载时≈0)
+  load_status TINYINT,          -- 负载状态:1=满载,2=半载,3=空载
+  fault_code NCHAR(64),         -- 故障码(多个用逗号分隔,无故障为'NONE')
+  alarm_level TINYINT,          -- 告警等级:0=无告警,1=提示,2=警告,3=紧急
+) TAGS (
+  truck_id NCHAR(64),           -- 矿卡唯一标识(如'TRUCK-001-SN12345')
+  truck_model NCHAR(64),        -- 矿卡 型号(如'CAT 797F'、'BelAZ 75710')
+  team_id INT,                  -- 所属车队ID(如1=运输一队,2=运输二队)
+  mining_area NCHAR(100),       -- 作业矿区(如'东翼采区'、'主井矿区')
+  driver_id NCHAR(64),          -- 当前司机ID(动态标签,换班时更新)
+  max_load FLOAT                -- 最大载重(t,车型固有属性)
+    device_id NCHAR(64),        -- 设备唯一ID
+    device_name NCHAR(100),     -- 设备名称
+    group_id INT,               -- 区域ID
+    group_name NCHAR(100),      -- 区域名称
+    biz_id INT,                 -- 业务ID
+    biz_name NCHAR(100),                 -- 业务名称
+    project_id INT,                 -- 项目ID
+    project_name NCHAR(100),         -- 项目名称
+    location NCHAR(200)         -- 安装位置
+    tenant_id                   -- 租户ID
+);
+
+
+-- 创建皮带称重数据超级表
+CREATE STABLE IF NOT EXISTS belt_scale_data (
+    ts TIMESTAMP,                -- 时间戳
+    weight FLOAT,                -- 称重值(kg)
+    speed FLOAT,                 -- 皮带速度(m/s)
+    flow_rate FLOAT,             -- 流量(t/h)
+    load_cell_voltage FLOAT,    -- 传感器电压(V)
+    temperature FLOAT,          -- 设备温度(℃)
+    status BINARY(20),          -- 运行状态
+    alarm_code INT              -- 报警代码
+) TAGS (
+   material_type BINARY(30),   -- 物料类型
+   device_id NCHAR(64),        -- 设备唯一ID
+   device_name NCHAR(100),     -- 设备名称
+   group_id INT,               -- 区域ID
+   group_name NCHAR(100),      -- 区域名称
+   biz_id INT,                 -- 业务ID
+   biz_name NCHAR(100),                 -- 业务名称
+   project_id INT,                 -- 项目ID
+   project_name NCHAR(100),         -- 项目名称
+   location NCHAR(200)         -- 安装位置
+   longitude NCHAR(200)        -- 经度
+   latitude NCHAR(200)         -- 纬度
+   tenant_id                   -- 租户ID
+);
+
+
+
+-- 创建环境检查超级表
+CREATE STABLE IF NOT EXISTS environment_check (
+    ts TIMESTAMP,              -- 检查时间戳
+    temperature FLOAT,         -- 环境温度(℃)
+    humidity FLOAT,            -- 环境湿度(%RH)
+    dust_concentration FLOAT,  -- 粉尘浓度(mg/m³)
+    noise_level FLOAT,         -- 噪声水平(dB)
+    vibration_amplitude FLOAT, -- 振动幅度(mm/s)
+    air_pressure FLOAT,        -- 气压(hPa)
+    status BINARY(20),         -- 环境状态(normal/warning/alarm)
+    alarm_code INT             -- 报警代码
+) TAGS (
+  check_type BINARY(30),      -- 检查类型(temperature/humidity/dust等)
+    device_id NCHAR(64),        -- 设备唯一ID
+    device_name NCHAR(100),     -- 设备名称
+    group_id INT,               -- 区域ID
+    group_name NCHAR(100),      -- 区域名称
+    biz_id INT,                 -- 业务ID
+    biz_name NCHAR(100),                 -- 业务名称
+    project_id INT,                 -- 项目ID
+    project_name NCHAR(100),         -- 项目名称
+    location NCHAR(200)         -- 安装位置
+    longitude NCHAR(200)        -- 经度
+    latitude NCHAR(200)         -- 纬度
+    tenant_id                   -- 租户ID
+);
+
+
+
+-- 创建无人地磅数据超级表
+CREATE STABLE IF NOT EXISTS weighbridge_data (
+    ts TIMESTAMP,           -- 称重时间戳
+    gross_weight DOUBLE,    -- 毛重(kg)
+    tare_weight DOUBLE,     -- 皮重(kg)
+    net_weight DOUBLE,      -- 净重(kg)
+    vehicle_plate BINARY(20), -- 车牌号
+    driver_name BINARY(32),   -- 司机姓名
+    material_type BINARY(30), -- 物料类型
+    supplier BINARY(50),      -- 供应商
+    customer BINARY(50),      -- 客户
+    status BINARY(20),        -- 称重状态
+    weighing_type BINARY(20)  -- 称重类型(入库/出库)
+) TAGS (
+  device_id NCHAR(64),        -- 设备唯一ID
+  device_name NCHAR(100),     -- 设备名称
+  group_id INT,               -- 区域ID
+  group_name NCHAR(100),      -- 区域名称
+  biz_id INT,                 -- 业务ID
+  biz_name NCHAR(100),                 -- 业务名称
+  project_id INT,                 -- 项目ID
+  project_name NCHAR(100),         -- 项目名称
+  location NCHAR(200)         -- 安装位置
+  longitude NCHAR(200)        -- 经度
+  latitude NCHAR(200)         -- 纬度
+  tenant_id                   -- 租户ID
+);
+
+
+
+-- 创建排放检测数据超级表
+CREATE STABLE IF NOT EXISTS emission_data (
+    ts TIMESTAMP,              -- 检测时间戳
+    co_concentration DOUBLE,   -- 一氧化碳浓度(mg/m³)
+    co2_concentration DOUBLE,  -- 二氧化碳浓度(%)
+    nox_concentration DOUBLE,  -- 氮氧化物浓度(mg/m³)
+    so2_concentration DOUBLE,  -- 二氧化硫浓度(mg/m³)
+    pm25_concentration DOUBLE, -- PM2.5浓度(μg/m³)
+    pm10_concentration DOUBLE, -- PM10浓度(μg/m³)
+    o2_concentration DOUBLE,   -- 氧气浓度(%)
+    temperature FLOAT,         -- 烟气温度(℃)
+    pressure FLOAT,            -- 烟气压力(Pa)
+    flow_rate DOUBLE,          -- 烟气流量(m³/h)
+    emission_status BINARY(20) -- 排放状态(normal/exceed/alarm)
+) TAGS (
+  device_id NCHAR(64),        -- 设备唯一ID
+  device_name NCHAR(100),     -- 设备名称
+  group_id INT,               -- 区域ID
+  group_name NCHAR(100),      -- 区域名称
+  biz_id INT,                 -- 业务ID
+  biz_name NCHAR(100),                 -- 业务名称
+  project_id INT,                 -- 项目ID
+  project_name NCHAR(100),         -- 项目名称
+  location NCHAR(200)         -- 安装位置
+  longitude NCHAR(200)        -- 经度
+  latitude NCHAR(200)         -- 纬度
+  tenant_id                   -- 租户ID
+);
+
+
+
+-- 创建车辆数据超级表
+CREATE STABLE IF NOT EXISTS vehicle_data (
+    ts TIMESTAMP,              -- 数据时间戳
+    longitude NCHAR(200)       -- 经度
+    latitude NCHAR(200)        -- 纬度
+    speed FLOAT,               -- 车速(km/h)
+    direction INT,             -- 行驶方向(角度)
+    fuel_level FLOAT,          -- 燃油液位(%)
+    mileage DOUBLE,            -- 里程数(km)
+    engine_temp FLOAT,         -- 发动机温度(℃)
+    battery_voltage FLOAT,     -- 电池电压(V)
+    status BINARY(20),         -- 车辆状态(running/stopped/idle)
+    alarm_code INT             -- 报警代码
+) TAGS (
+    fleet_id BINARY(32),        -- 车队ID
+    device_id NCHAR(64),        -- 设备唯一ID
+    device_name NCHAR(100),     -- 设备名称
+    group_id INT,               -- 区域ID
+    group_name NCHAR(100),      -- 区域名称
+    biz_id INT,                 -- 业务ID
+    biz_name NCHAR(100),                 -- 业务名称
+    project_id INT,                 -- 项目ID
+    project_name NCHAR(100),         -- 项目名称
+    tenant_id                   -- 租户ID
+);
+
+-- 创建装载机械数据超级表
+CREATE STABLE IF NOT EXISTS loading_equipment_data (
+    ts TIMESTAMP,              -- 数据时间戳
+    load_capacity DOUBLE,      -- 装载能力(t)
+    operation_count INT,       -- 作业次数
+    hydraulic_pressure FLOAT,  -- 液压压力(MPa)
+    engine_temperature FLOAT,  -- 发动机温度(℃)
+    fuel_level FLOAT,          -- 燃油液位(%)
+    working_hours INT,         -- 工作时长(hour)
+    efficiency_rate FLOAT,     -- 效率比率(%)
+    fault_code INT,            -- 故障代码
+   longitude NCHAR(200)        -- 经度
+   latitude NCHAR(200)         -- 纬度
+   equipment_status BINARY(20) -- 设备状态
+) TAGS (
+  device_id NCHAR(64),        -- 设备唯一ID
+  device_name NCHAR(100),     -- 设备名称
+  group_id INT,               -- 区域ID
+  group_name NCHAR(100),      -- 区域名称
+    device_id NCHAR(64),        -- 设备唯一ID
+    device_name NCHAR(100),     -- 设备名称
+    group_id INT,               -- 区域ID
+    group_name NCHAR(100),      -- 区域名称
+    biz_id INT,                 -- 业务ID
+    biz_name NCHAR(100),         -- 业务名称
+    project_id INT,                 -- 项目ID
+    project_name NCHAR(100),         -- 项目名称
+    tenant_id                   -- 租户ID
+);
+
+-- 矿山人员监测超级表
+CREATE STABLE IF NOT EXISTS mine_personnel (
+  ts TIMESTAMP,                 -- 时间戳字段
+  zone_id INT,                  -- 区域ID(如1=井下采区,2=主巷道,3=地面调度室)
+  zone_name NCHAR(100),         -- 区域名称(冗余存储,如"3号煤层采区")
+  location_x FLOAT,             -- 区域内X坐标(米,基于矿区坐标系)
+  location_y FLOAT,             -- 区域内Y坐标(米)
+  location_z FLOAT,             -- 海拔/深度(米,正数为地面,负数为井下深度)
+  moving_status TINYINT,        -- 移动状态:1=静止,2=移动中,3=快速移动(异常)
+  speed FLOAT,                  -- 移动速度(m/s,静止时≈0)
+
+  safety_device_status TINYINT, -- 安全设备状态:1=正常(定位+通讯正常),2=通讯弱,3=离线
+  vital_signs_status TINYINT,   -- 生命体征状态(仅佩戴监测设备时):1=正常,2=异常
+  gas_alarm TINYINT,            -- 周边气体告警:0=无告警,1=瓦斯超标,2=一氧化碳超标
+  panic_alarm TINYINT,          -- 紧急求救:0=无,1=触发求救信号
+  working_status TINYINT,       -- 工作状态:1=作业中,2=休息,3=巡检中,4=撤离中
+  work_shift TINYINT,           -- 班次:1=早班,2=中班,3=夜班
+  last_checkin_ts TIMESTAMP     -- 最近一次打卡时间(用于考勤统计)
+) TAGS (
+  personnel_id NCHAR(64),       -- 人员唯一ID
+  name NCHAR(32),               -- 姓名
+  job_type TINYINT,             -- 工种:1=矿工,2=安全员,3=技术员,4=管理人员
+  team_id INT,                  -- 所属班组ID(如1=采煤一班)
+  tenant_id NCHAR(64),          -- 租户ID(多矿区隔离,如"MINE-B")
+  safety_card_id NCHAR(64),     -- 安全卡编号(定位设备唯一标识)
+  entry_time TIMESTAMP          -- 入井/进入作业区时间(动态更新)
+  tenant_id                    -- 租户ID
+);