--升级 历史数据
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_BEBANK')
update t_bd_bebank as a set fcitytxt = isnull((select fname from t_bd_admindivision_l as b where b.fid = a.fcityid and b.flocaleid = 'zh_CN'),' ') where fcitytxt = ' ' and fcityid > 0;

IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_BEBANK')
update t_bd_bebank as a set fprovincetxt = isnull((select fname from t_bd_admindivision_l as b where b.fid = a.fprovinceid  and b.flocaleid = 'zh_CN'),' ') where fprovincetxt = ' ' and fprovinceid > 0 ;

IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_BEBANK')
update t_bd_bebank as a set fisfromcloud = '1' where fcitytxt <> ' ' and fprovincetxt <> ' ' and fnumber = funioncode;