Commit 620b0181 by 向延琳

二押警情数据库

1 parent a89f1bef
...@@ -82,3 +82,48 @@ create table t_device_speeding ...@@ -82,3 +82,48 @@ create table t_device_speeding
unique key `uk_sn_vd` (`sn`, `vd_id`, `del_flag`) unique key `uk_sn_vd` (`sn`, `vd_id`, `del_flag`)
) )
comment '设备超速记录表'; comment '设备超速记录表';
-- 二押警情数据表
create table t_alarm_second_data
(
id int auto_increment comment 'id'
primary key,
sn varchar(32) null comment '设备号',
vd_id int(11) default 0 null comment '车辆、设备关系id',
type varchar(32) null comment '二押区域规则类型(二押地停留)',
name varchar(32) null comment '二押区域规则名称(二押地停留)',
alarm_time datetime null comment '二押区域报警时间',
alarm_address varchar(128) null comment '二押区域报警位置',
leave_time datetime null comment '离开二押区域时间(当前还未动身的数据不记录到数据库)',
stay_time int(8) null comment '二押区域停留时长',
lng varchar(20) null comment '二押区域停留经度',
lat varchar(20) null comment '二押区域停留纬度',
event_time datetime null comment '事件时间,写入事件',
unique_flag varchar(64) null comment '唯一标识 设备号加上报警时间',
del_flag tinyint default 0 null comment '是否删除 0=正常 -1=删除',
created_date datetime null comment '创建时间|入库时间',
created_by int(11) null comment '创建人用户id',
updated_date datetime null comment '更新时间',
updated_by int(11) null comment '更新人用户id',
KEY `idx_sn` (`sn`),
KEY `idx_unique_flag` (`unique_flag`, `del_flag`)
)
comment '二押警情数据表' charset = utf8mb4;
-- 二押警情和二手车关系表
create table t_alarm_second_data_near_rel
(
id int auto_increment comment 'id'
primary key,
second_data_id int null comment '二押kafka数据表 `d_alarm_second_data`的id',
near_second_id int null comment '300米二手车行id',
del_flag tinyint default 0 null comment '是否删除 0=正常 -1=删除',
created_date datetime null comment '创建时间|入库时间',
created_by int(11) null comment '创建人用户id',
updated_date datetime null comment '更新时间',
updated_by int(11) null comment '更新人用户id',
KEY `idx_second_data_id` (`second_data_id`),
KEY `idx_near_second_id` (`near_second_id`)
)
comment '二押警情和二手车关系表' charset = utf8mb4;
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!