Commit b511ce25 by levphon

围栏设备vdid更新

1 parent 7ecfeb5d
...@@ -176,4 +176,16 @@ where vd_id is not null ...@@ -176,4 +176,16 @@ where vd_id is not null
group by sn, vd_id; group by sn, vd_id;
alter table t_electric_fence_sns add vd_id int null comment '车辆设备绑定关系' after sn; alter table t_electric_fence_sns add vd_id int null comment '车辆设备绑定关系' after sn;
alter table t_electric_fence_sns_copy add vd_id int null comment '车辆设备绑定关系' after sn;
\ No newline at end of file \ No newline at end of file
alter table t_electric_fence_sns_copy add vd_id int null comment '车辆设备绑定关系' after sn;
alter table t_electric_fence_sns_copy add index idx_sn(sn);
update t_electric_fence_sns_copy tefs ,t_vehicle_device tvd,t_vehicle tv
set tefs.vd_id = tvd.id
where tvd.sn = tefs.sn
and tv.id = tvd.vehicle_id;
update t_electric_fence_sns tefs ,t_vehicle_device tvd,t_vehicle tv
set tefs.vd_id = tvd.id
where tvd.sn = tefs.sn
and tv.id = tvd.vehicle_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!