UPDATE T_BD_ADMINDIVISION SET FLONGNUMBER = FNUMBER WHERE FLEVEL = '1' AND (FLONGNUMBER IS NULL OR FLONGNUMBER = ' ');
UPDATE T_BD_ADMINDIVISION A SET FLONGNUMBER = ( SELECT LONGNUMBER FROM (SELECT CONCAT(P.FLONGNUMBER, CONCAT( '.', C.FNUMBER )) LONGNUMBER, C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '2' AND ( C.FLONGNUMBER IS NULL OR C.FLONGNUMBER = ' ' )) T WHERE T.FID = A.FID) WHERE FID IN ( SELECT FID FROM (SELECT C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '2' AND ( C.FLONGNUMBER IS NULL OR C.FLONGNUMBER = ' ' )) T);
UPDATE T_BD_ADMINDIVISION A SET FLONGNUMBER = ( SELECT LONGNUMBER FROM (SELECT CONCAT(P.FLONGNUMBER, CONCAT( '.', C.FNUMBER )) LONGNUMBER, C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '3' AND ( C.FLONGNUMBER IS NULL OR C.FLONGNUMBER = ' ' )) T WHERE T.FID = A.FID) WHERE FID IN ( SELECT FID FROM (SELECT C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '3' AND ( C.FLONGNUMBER IS NULL OR C.FLONGNUMBER = ' ' )) T);

UPDATE T_BD_ADMINDIVISION SET FFULLNAME = FNAME WHERE FLEVEL = '1' AND (FFULLNAME IS NULL OR FFULLNAME = ' ');
UPDATE T_BD_ADMINDIVISION A SET FFULLNAME = ( SELECT FULLNAME FROM (SELECT CONCAT(P.FFULLNAME, CONCAT( '_', C.FNAME )) FULLNAME, C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '2' AND ( C.FFULLNAME IS NULL OR C.FFULLNAME = ' ' )) T WHERE T.FID = A.FID) WHERE FID IN ( SELECT FID FROM (SELECT C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '2' AND ( C.FFULLNAME IS NULL OR C.FFULLNAME = ' ' )) T);
UPDATE T_BD_ADMINDIVISION A SET FFULLNAME = ( SELECT FULLNAME FROM (SELECT CONCAT(P.FFULLNAME, CONCAT( '_', C.FNAME )) FULLNAME, C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '3' AND ( C.FFULLNAME IS NULL OR C.FFULLNAME = ' ' )) T WHERE T.FID = A.FID) WHERE FID IN ( SELECT FID FROM (SELECT C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '3' AND ( C.FFULLNAME IS NULL OR C.FFULLNAME = ' ' )) T);

UPDATE T_BD_ADMINDIVISION_L L SET FFULLNAME = ( SELECT T.FNAME FROM (SELECT B.FNAME, B.FID FROM T_BD_ADMINDIVISION A JOIN T_BD_ADMINDIVISION_L B ON A.FID = B.FID WHERE A.FLEVEL = '1' AND B.FLOCALEID = 'zh_CN' AND (B.FFULLNAME IS NULL OR B.FFULLNAME = ' ')) T WHERE T.FID = L.FID) WHERE FID IN ( SELECT FID FROM (SELECT B.FID FROM T_BD_ADMINDIVISION A JOIN T_BD_ADMINDIVISION_L B ON A.FID = B.FID WHERE A.FLEVEL = '1' AND B.FLOCALEID = 'zh_CN' AND (B.FFULLNAME IS NULL OR B.FFULLNAME = ' ')) T);
UPDATE T_BD_ADMINDIVISION_L L SET FFULLNAME = ( SELECT FULLNAME FROM (SELECT CONCAT(P.FFULLNAME, CONCAT( '_', C.FNAME )) FULLNAME, C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '2') T WHERE T.FID = L.FID) WHERE FID IN ( SELECT FID FROM (SELECT C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID JOIN T_BD_ADMINDIVISION_L L ON C.FID = L.FID AND C.FLEVEL = '2' AND ( L.FFULLNAME IS NULL OR L.FFULLNAME = ' ' ) AND L.FLOCALEID = 'zh_CN' ) T );
UPDATE T_BD_ADMINDIVISION_L L SET FFULLNAME = ( SELECT FULLNAME FROM (SELECT CONCAT(P.FFULLNAME, CONCAT( '_', C.FNAME )) FULLNAME, C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID AND C.FLEVEL = '3') T WHERE T.FID = L.FID) WHERE FID IN ( SELECT FID FROM (SELECT C.FID FROM T_BD_ADMINDIVISION P JOIN T_BD_ADMINDIVISION C ON P.FID = C.FPARENTID JOIN T_BD_ADMINDIVISION_L L ON C.FID = L.FID AND C.FLEVEL = '3' AND ( L.FFULLNAME IS NULL OR L.FFULLNAME = ' ' ) AND L.FLOCALEID = 'zh_CN' ) T );