update `base_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 `base_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 `base_station` t inner join base_line t1 on t.line_name = t1.line_name
    set t.line_id = t1.line_id  where t.line_name = t1.line_name  ;


update `base_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 `base_pillar` t inner join base_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  where t.qj = t1.station_name  ;

update `base_pillar` t inner join base_line t1 on t.xb = t1.line_name
    set t.xb = t1.line_id  where t.xb =  t1.line_name  ;

update `base_pillar` 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 base_dmcgyq t inner join base_line t1 on t.xb = t1.line_name
    set t.line_id = t1.line_id  ;

update base_dmcgyq t inner join base_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  ;

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

update base_jcxc t inner join base_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  ;

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

update base_wjcxc t inner join base_station t1 on t.qj = t1.station_name
    set t.station_id = t1.station_id  ;