update `bus_line` t inner join sys_dept t1 on t.dept_name = t1.dept_name
    set t.dept_id = t1.dept_id  where t.dept_name = t1.dept_name ;


update `bus_station` t inner join sys_dept t1 on t.dept_name = t1.dept_name
    set t.dept_id = t1.dept_id  where t.dept_name = t1.dept_name ;


update `bus_station` t inner join bus_line t1 on t.line_name = t1.line_name
    set t.line_id = t1.line_id  where t.line_name = t1.line_name  ;


update `bus_substation` t inner join sys_dept t1 on t.dept_name = t1.dept_name
    set t.dept_id = t1.dept_id  where t.dept_name = t1.dept_name ;

update `bus_zzdzxx` t inner join bus_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  where t.qj = t1.station_name  ;

update `bus_zzdzxx` t inner join bus_line t1 on t.xb = t1.line_name
    set t.xb = t1.line_id  where t.xb =  t1.line_name  ;

update `bus_zzdzxx` t inner join sys_dept t1 on t.bm = t1.dept_name
    set t.bm = t1.dept_id  where t.bm = t1.dept_name   ;


-- 地面磁感应器
update bus_dmcgyq t inner join bus_line t1 on t.xb = t1.line_name
    set t.line_id = t1.line_id  ;

update bus_dmcgyq t inner join bus_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  ;

-- 交叉线岔
update bus_jcxc t inner join bus_line t1 on t.xb = t1.line_name
    set t.line_id = t1.line_id  ;

update bus_jcxc t inner join bus_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  ;

-- 无交叉线岔
update bus_wjcxc t inner join bus_line t1 on t.xb = t1.line_name
    set t.line_id = t1.line_id  ;

update bus_wjcxc t inner join bus_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  ;