Commit 42f68af2 by 向延琳

去掉概览信息

1 parent 553e980a
...@@ -33,27 +33,6 @@ CREATE TABLE `t_alarm_electric_fence` ...@@ -33,27 +33,6 @@ CREATE TABLE `t_alarm_electric_fence`
COMMENT ='新e盾|围栏报警数据表'; COMMENT ='新e盾|围栏报警数据表';
-- 设备里程概览信息表
create table t_device_journey_overview
(
id int(11) auto_increment comment '里程主键ID'
primary key,
sn varchar(32) null comment '设备序列号',
vd_id int(11) default 0 null comment '车辆、设备关系id',
total_journey_count int(11) null comment '总行驶次数',
distance int(11) null comment '总里程m',
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'
)
comment '新e盾|里程概览信息表';
ALTER TABLE `t_device_journey_overview`
ADD INDEX idx_sn (`sn`);
ALTER TABLE `t_device_journey_overview`
ADD INDEX idx_vd_id (`vd_id`);
ALTER TABLE `t_device_journey` ALTER TABLE `t_device_journey`
ADD INDEX idx_begin_time (`begin_time`); ADD INDEX idx_begin_time (`begin_time`);
...@@ -157,9 +136,3 @@ set tefs.vd_id = tvd.id ...@@ -157,9 +136,3 @@ set tefs.vd_id = tvd.id
where tvd.sn = tefs.sn where tvd.sn = tefs.sn
and tv.id = tvd.vehicle_id; and tv.id = tvd.vehicle_id;
-- 里程初始化
INSERT INTO t_device_journey_overview (sn, vd_id, total_journey_count, distance, created_by, created_date, updated_date)
select sn, vd_id, count(1), sum(mileage), created_by, created_date, updated_date
from t_device_journey
where vd_id is not null
group by sn, vd_id;
\ 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!