Commit f5d90be2 by 杨林龙
2 parents 6afa2bb0 9aa9b359
......@@ -95,7 +95,7 @@ create table t_device_power
constraint sn_uindex
unique (sn)
)
comment '新e盾|设备里程表';
comment '新e盾|设备电量表';
ALTER TABLE `t_device_power`
ADD INDEX idx_sn (`sn`);
ALTER TABLE `t_device_power`
......@@ -167,9 +167,8 @@ where tvd.del_flag = 0
and tvd.bind_status = 1
and tdj.id < 500000 and tdj.id>= 0;
# 更新总里程
INSERT INTO t_device_journey_overview (sn, vd_id, total_journey_count, distance)
select sn, vd_id, count(1), sum(mileage)
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
group by sn, vd_id;
\ 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!