此文章是vip文章,如何查看?  

1,点击链接获取密钥 http://nicethemes.cn/product/view29882.html

2,在下方输入文章查看密钥即可立即查看当前vip文章


省市二级联动数据库生成代码(JAVA)

  • 时间:
  • 浏览:
  • 来源:互联网

最近在给一客户做网站,用的是php,现在需要有一个下拉框选择省市,并且需要保存省市的简拼,如“河北 HB”。我在网上找了半天,发现基本没有符合要求的代码,于是自己顶着浪费巨大时间的风险,动手写了一个自动生成省市二级联动insert语句的代码。由于时间仓促,自己的水平也有限,所以写的代码基本谈不上是合理的,可维护,可扩展的。我在此仅提供一个具体的思路,想把它写的漂亮点,还请广大朋友们跟据自己的需要进行重构。^o^ 还有,最后结果直接输出到了控制台,请大家直接复制到一个文本文件中,并把扩展名改为.sql。在源代码里,我用到了LinkedHashMap这个集合类,目的是为了保持集合元素的顺序。

所用工具:Eclipse,汉字转拼音工具包:pinyin4j 2.5 可点击下载,也可在我的源代码包里找到

所用语言:java

相关文件:CSDN博客不能上传附件,所以我传到百度网盘了,请大家费些心下载,不能下载的请留言告知。

数据来源于谷歌地图

省市列表(无省、市、区字样)

省市列表(带省、市、区)

源代码

注意:由于我不想把省、市、区这样的字也转换成拼音,如河北省转换为HBS,北京市转换为BJS,我把省、市、区相关字样已删除,但我也保留了原文件,有需要的可以下载。

表结构:

CREATE TABLE IF NOT EXISTS `city` (
  `id` varchar(50) NOT NULL,
  `type` varchar(50) NOT NULL,
  `parent_id` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `short` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

具体实现请看以下代码:

package com.zxq.pinyin;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;

public class Covert {
	
	/**
	 * 汉字转拼音,并将结果保存到省或市的map中
	 * @param words 需要转换的字符串
	 * @param provinceOrCity 省或市的Map
	 */
	public static void wordToPinYinSZM(String words, Map<String, String> provinceOrCity) {
		//调用Pinyin4J的方法
		
		//定义拼音输出格式
		HanyuPinyinOutputFormat hof = new HanyuPinyinOutputFormat();
		//大写
		hof.setCaseType(HanyuPinyinCaseType.UPPERCASE);
		//不包含声调
		hof.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
		//u用V表示
		hof.setVCharType(HanyuPinyinVCharType.WITH_V);
		
		//由于只能对单字转换,所以需要把字符串转换为字符数组
		char[] characters = words.toCharArray();
		try {
			//StringBuilder存放结果
			StringBuilder sb = new StringBuilder();
			for(int i = 0; i < characters.length; i++) {
				//调用汉字转拼音核心方法,大家可以看到返回的是一个数组,因为有的汉字有多音字,所以可能返回多个
				//拼音结果,对此,我只取第一个,pinyinArray[0],这样做不好的地方就是可能有的简拼不准确,例如
				//“重庆”我得到的是ZQ,zhong qing,这一点有待完善
				String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(characters[i], hof);
				//substring(0, 1)则表示只取首字母
				sb.append(pinyinArray[0].substring(0, 1));
			}
			//放入省或市的Map中
			provinceOrCity.put(words, sb.toString());
		} catch (BadHanyuPinyinOutputFormatCombination e) {
			e.printStackTrace();
		}
	}
	

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		//读取事先定义好的省市文本文件,第一行为省/直辖市,第二行为各地级市
		File provinceFile = new File("F:\\province_city\\province.txt");
		
		//定义保存省、市数据的数据结构。从里向外看,Map<String, String>保存的是 “省=>简拼” 这样的数据
		//如“河北=>HB”。List里面的Map<String, String>则保存着“市=>简拼”的数据,如“保定=>BD”,而list集合
		//保存该省下所有市的集合。最外层的Map就是“省=>各市集合”的关联集合,这样省市关系就确定了。
		Map<Map<String, String>, List<Map<String, String>>> provinceCity = new LinkedHashMap<Map<String, String>, List<Map<String, String>>>();
		try {
			//定义输入流,可以使用readline()读取一行
			BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(provinceFile), "UTF-8"));
			String provinceName = "";
			while ((provinceName = br.readLine()) != null) { //先读第一行,省的名字
				//定义保存“省=>简拼”的Map
				Map<String, String> province = new LinkedHashMap<String, String>(); 
				//定义保存“市=>简拼”Map的List集合,结构为[{保定=>BD}, {沧州=>CZ},……]
				List<Map<String, String>> citiesArray = new ArrayList<Map<String, String>>();
				
				//调用汉字转拼音方法
				wordToPinYinSZM(provinceName.trim(), province);
				//读取第二行,该省下的所有市区
				String cityNames = br.readLine();
				//文件中的每个市区用两个空格格开,所以以两个空格分隔成市区的数组
				String[] cities = cityNames.split("  ");
				for(int j = 0; j < cities.length; j++) {
					//定义保存“市=>简拼”Map
					Map<String, String> city = new LinkedHashMap<String, String>();
					String cityName = cities[j].trim();
					//调用汉字转拼音方法
					wordToPinYinSZM(cityName, city);
					//添加到list集合中
					citiesArray.add(city);
				}
				//添加到“省=>市的集合”的Map中
				provinceCity.put(province, citiesArray);
			}
			//调用转换为sql语句的代码
			convertMapToSql(provinceCity);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
	
	/**
	 * 把“省=>市的集合”Map转换为SQL语句
	 * @param provinceCity
	 */
	public static void convertMapToSql(Map<Map<String, String>, List<Map<String, String>>> provinceCity) {
		//获取最外层Map的EntrySet 结构为[{河北=>HB, [{保定=>BD}, {石家庄=>sjz},{……}]},{……}]
		Set<Entry<Map<String, String>, List<Map<String, String>>>> provinceEnties = provinceCity.entrySet();
		//获取迭代器
		Iterator<Entry<Map<String, String>, List<Map<String, String>>>> itPE = provinceEnties.iterator();
		//定义数据库中,省的ID从1000000开始
		long provinceId = 1000000;
		while(itPE.hasNext()) {
			//获取一个Entry键-值对
			Entry<Map<String, String>, List<Map<String, String>>> proviceEntry = itPE.next();
			//Key为省,Value为市的List集合
			Map<String, String> provinces = proviceEntry.getKey();
			
			//获取省份的Entry,结构为[{河北=>HB}, {北京=>BJ}] key为中文,value为简拼
			Set<Entry<String, String>> proEntries = provinces.entrySet();
			Iterator<Entry<String, String>> proIt = proEntries.iterator();
			while(proIt.hasNext()) {
				Entry<String, String> proEntry = proIt.next();
				String provinceName = proEntry.getKey();
				String provincePinYin = proEntry.getValue();
				
				//组合sql语句
				StringBuilder sb = new StringBuilder();
				//定义的表结构为:id, type, name, short,分别为id,类型(1为1级,如省,2为2级,如市),父ID即市的所属省份, 名字, 简拼
				sb.append("insert into city values ('");
				sb.append(provinceId).append("','").append("1','','").append(provinceName).append("', '").append(provincePinYin).append("');");
				//我没有生成sql文件,而是直接显示在console里面,大家可以直接从里面复制
				System.out.println(sb.toString());
			}
			
			
			//获取当前省下所有市区,迭代方法与上面类似,请注意这里面的循环比较多,请大家注意分辨。
			List<Map<String, String>> cities = proviceEntry.getValue();
			
			Iterator<Map<String, String>> citiesIt = cities.iterator();
			long cityId = provinceId;//市的ID直接从省的ID开始递增,每次递增50
			while (citiesIt.hasNext()) {
				Map<String, String> city = citiesIt.next();
				Set<Entry<String, String>> cityEntries = city.entrySet();
				Iterator<Entry<String, String>> cityIt = cityEntries.iterator();
				cityId += 50;//市的ID,先递增50,避免与省份ID相同
				while(cityIt.hasNext()) {
					Entry<String, String> cityEntry = cityIt.next();
					String cityName = cityEntry.getKey();
					String cityPinYin = cityEntry.getValue();
					
					StringBuilder sb = new StringBuilder();
					sb.append("insert into city values ('");
					sb.append(cityId).append("','").append("2','").append(provinceId).append("','").append(cityName).append("', '").append(cityPinYin).append("');");
					System.out.println(sb.toString());
				}
			}
			//省份ID以10000递增
			provinceId += 10000;
		}
		
	}

}
生成的sql语句为:

insert into city values ('1000000','1','','北京', 'BJ');
insert into city values ('1000050','2','1000000','东城', 'DC');
insert into city values ('1000100','2','1000000','西城', 'XC');
insert into city values ('1000150','2','1000000','朝阳', 'CY');
insert into city values ('1000200','2','1000000','丰台', 'FT');
insert into city values ('1000250','2','1000000','石景山', 'SJS');
insert into city values ('1000300','2','1000000','海淀', 'HD');
insert into city values ('1000350','2','1000000','门头沟', 'MTG');
insert into city values ('1000400','2','1000000','房山', 'FS');
insert into city values ('1000450','2','1000000','通州', 'TZ');
insert into city values ('1000500','2','1000000','顺义', 'SY');
insert into city values ('1000550','2','1000000','昌平', 'CP');
insert into city values ('1000600','2','1000000','大兴', 'DX');
insert into city values ('1000650','2','1000000','怀柔', 'HR');
insert into city values ('1000700','2','1000000','平谷', 'PG');
insert into city values ('1000750','2','1000000','密云县', 'MYX');
insert into city values ('1000800','2','1000000','延庆县', 'YQX');
insert into city values ('1010000','1','','天津', 'TJ');
insert into city values ('1010050','2','1010000','和平', 'HP');
insert into city values ('1010100','2','1010000','河东', 'HD');
insert into city values ('1010150','2','1010000','河西', 'HX');
insert into city values ('1010200','2','1010000','南开', 'NK');
insert into city values ('1010250','2','1010000','河北', 'HB');
insert into city values ('1010300','2','1010000','红桥', 'HQ');
insert into city values ('1010350','2','1010000','东丽', 'DL');
insert into city values ('1010400','2','1010000','西青', 'XQ');
insert into city values ('1010450','2','1010000','津南', 'JN');
insert into city values ('1010500','2','1010000','北辰', 'BC');
insert into city values ('1010550','2','1010000','武清', 'WQ');
insert into city values ('1010600','2','1010000','宝坻', 'BC');
insert into city values ('1010650','2','1010000','滨海', 'BH');
insert into city values ('1010700','2','1010000','宁河县', 'NHX');
insert into city values ('1010750','2','1010000','静海县', 'JHX');
insert into city values ('1010800','2','1010000','蓟县', 'JX');
insert into city values ('1020000','1','','河北', 'HB');
insert into city values ('1020050','2','1020000','石家庄', 'SJZ');
insert into city values ('1020100','2','1020000','唐山', 'TS');
insert into city values ('1020150','2','1020000','秦皇岛', 'QHD');
insert into city values ('1020200','2','1020000','邯郸', 'HD');
insert into city values ('1020250','2','1020000','邢台', 'XT');
insert into city values ('1020300','2','1020000','保定', 'BD');
insert into city values ('1020350','2','1020000','张家口', 'ZJK');
insert into city values ('1020400','2','1020000','承德', 'CD');
insert into city values ('1020450','2','1020000','沧州', 'CZ');
insert into city values ('1020500','2','1020000','廊坊', 'LF');
insert into city values ('1020550','2','1020000','衡水', 'HS');
insert into city values ('1030000','1','','山西', 'SX');
insert into city values ('1030050','2','1030000','太原', 'TY');
insert into city values ('1030100','2','1030000','大同', 'DT');
insert into city values ('1030150','2','1030000','阳泉', 'YQ');
insert into city values ('1030200','2','1030000','长治', 'ZZ');
insert into city values ('1030250','2','1030000','晋城', 'JC');
insert into city values ('1030300','2','1030000','朔州', 'SZ');
insert into city values ('1030350','2','1030000','晋中', 'JZ');
insert into city values ('1030400','2','1030000','运城', 'YC');
insert into city values ('1030450','2','1030000','忻州', 'XZ');
insert into city values ('1030500','2','1030000','临汾', 'LF');
insert into city values ('1030550','2','1030000','吕梁', 'LL');
insert into city values ('1040000','1','','内蒙古', 'NMG');
insert into city values ('1040050','2','1040000','呼和浩特', 'HHHT');
insert into city values ('1040100','2','1040000','包头', 'BT');
insert into city values ('1040150','2','1040000','乌海', 'WH');
insert into city values ('1040200','2','1040000','赤峰', 'CF');
insert into city values ('1040250','2','1040000','通辽', 'TL');
insert into city values ('1040300','2','1040000','鄂尔多斯', 'EEDS');
insert into city values ('1040350','2','1040000','呼伦贝尔', 'HLBE');
insert into city values ('1040400','2','1040000','巴彦淖尔', 'BYNE');
insert into city values ('1040450','2','1040000','乌兰察布', 'WLCB');
insert into city values ('1040500','2','1040000','兴安', 'XA');
insert into city values ('1040550','2','1040000','锡林郭勒', 'XLGL');
insert into city values ('1040600','2','1040000','阿拉善', 'ALS');
insert into city values ('1050000','1','','辽宁', 'LN');
insert into city values ('1050050','2','1050000','沈阳', 'SY');
insert into city values ('1050100','2','1050000','大连', 'DL');
insert into city values ('1050150','2','1050000','鞍山', 'AS');
insert into city values ('1050200','2','1050000','抚顺', 'FS');
insert into city values ('1050250','2','1050000','本溪', 'BX');
insert into city values ('1050300','2','1050000','丹东', 'DD');
insert into city values ('1050350','2','1050000','锦州', 'JZ');
insert into city values ('1050400','2','1050000','营口', 'YK');
insert into city values ('1050450','2','1050000','阜新', 'FX');
insert into city values ('1050500','2','1050000','辽阳', 'LY');
insert into city values ('1050550','2','1050000','盘锦', 'PJ');
insert into city values ('1050600','2','1050000','铁岭', 'TL');
insert into city values ('1050650','2','1050000','朝阳', 'CY');
insert into city values ('1050700','2','1050000','葫芦岛', 'HLD');
insert into city values ('1060000','1','','吉林', 'JL');
insert into city values ('1060050','2','1060000','长春', 'ZC');
insert into city values ('1060100','2','1060000','吉林', 'JL');
insert into city values ('1060150','2','1060000','四平', 'SP');
insert into city values ('1060200','2','1060000','辽源', 'LY');
insert into city values ('1060250','2','1060000','通化', 'TH');
insert into city values ('1060300','2','1060000','白山', 'BS');
insert into city values ('1060350','2','1060000','松原', 'SY');
insert into city values ('1060400','2','1060000','白城', 'BC');
insert into city values ('1060450','2','1060000','延边', 'YB');
insert into city values ('1070000','1','','黑龙江', 'HLJ');
insert into city values ('1070050','2','1070000','哈尔滨', 'HEB');
insert into city values ('1070100','2','1070000','齐齐哈尔', 'QQHE');
insert into city values ('1070150','2','1070000','鸡西', 'JX');
insert into city values ('1070200','2','1070000','鹤岗', 'HG');
insert into city values ('1070250','2','1070000','双鸭山', 'SYS');
insert into city values ('1070300','2','1070000','大庆', 'DQ');
insert into city values ('1070350','2','1070000','伊春', 'YC');
insert into city values ('1070400','2','1070000','佳木斯', 'JMS');
insert into city values ('1070450','2','1070000','七台河', 'QTH');
insert into city values ('1070500','2','1070000','牡丹江', 'MDJ');
insert into city values ('1070550','2','1070000','黑河', 'HH');
insert into city values ('1070600','2','1070000','绥化', 'SH');
insert into city values ('1070650','2','1070000','大兴安岭', 'DXAL');
insert into city values ('1080000','1','','上海', 'SH');
insert into city values ('1080050','2','1080000','黄浦', 'HP');
insert into city values ('1080100','2','1080000','卢湾', 'LW');
insert into city values ('1080150','2','1080000','徐汇', 'XH');
insert into city values ('1080200','2','1080000','长宁', 'ZN');
insert into city values ('1080250','2','1080000','静安', 'JA');
insert into city values ('1080300','2','1080000','普陀', 'PT');
insert into city values ('1080350','2','1080000','闸北', 'ZB');
insert into city values ('1080400','2','1080000','虹口', 'HK');
insert into city values ('1080450','2','1080000','杨浦', 'YP');
insert into city values ('1080500','2','1080000','闵行', 'MX');
insert into city values ('1080550','2','1080000','宝山', 'BS');
insert into city values ('1080600','2','1080000','嘉定', 'JD');
insert into city values ('1080650','2','1080000','浦东', 'PD');
insert into city values ('1080700','2','1080000','金山', 'JS');
insert into city values ('1080750','2','1080000','松江', 'SJ');
insert into city values ('1080800','2','1080000','青浦', 'QP');
insert into city values ('1080850','2','1080000','奉贤', 'FX');
insert into city values ('1080900','2','1080000','崇明县', 'CMX');
insert into city values ('1090000','1','','江苏', 'JS');
insert into city values ('1090050','2','1090000','南京', 'NJ');
insert into city values ('1090100','2','1090000','无锡', 'WX');
insert into city values ('1090150','2','1090000','徐州', 'XZ');
insert into city values ('1090200','2','1090000','常州', 'CZ');
insert into city values ('1090250','2','1090000','苏州', 'SZ');
insert into city values ('1090300','2','1090000','南通', 'NT');
insert into city values ('1090350','2','1090000','连云港', 'LYG');
insert into city values ('1090400','2','1090000','淮安', 'HA');
insert into city values ('1090450','2','1090000','盐城', 'YC');
insert into city values ('1090500','2','1090000','扬州', 'YZ');
insert into city values ('1090550','2','1090000','镇江', 'ZJ');
insert into city values ('1090600','2','1090000','泰州', 'TZ');
insert into city values ('1090650','2','1090000','宿迁', 'SQ');
insert into city values ('1100000','1','','浙江', 'ZJ');
insert into city values ('1100050','2','1100000','杭州', 'HZ');
insert into city values ('1100100','2','1100000','宁波', 'NB');
insert into city values ('1100150','2','1100000','温州', 'WZ');
insert into city values ('1100200','2','1100000','嘉兴', 'JX');
insert into city values ('1100250','2','1100000','湖州', 'HZ');
insert into city values ('1100300','2','1100000','绍兴', 'SX');
insert into city values ('1100350','2','1100000','金华', 'JH');
insert into city values ('1100400','2','1100000','衢州', 'QZ');
insert into city values ('1100450','2','1100000','舟山', 'ZS');
insert into city values ('1100500','2','1100000','台州', 'TZ');
insert into city values ('1100550','2','1100000','丽水', 'LS');
insert into city values ('1110000','1','','安徽', 'AH');
insert into city values ('1110050','2','1110000','合肥', 'HF');
insert into city values ('1110100','2','1110000','芜湖', 'WH');
insert into city values ('1110150','2','1110000','蚌埠', 'BB');
insert into city values ('1110200','2','1110000','淮南', 'HN');
insert into city values ('1110250','2','1110000','马鞍山', 'MAS');
insert into city values ('1110300','2','1110000','淮北', 'HB');
insert into city values ('1110350','2','1110000','铜陵', 'TL');
insert into city values ('1110400','2','1110000','安庆', 'AQ');
insert into city values ('1110450','2','1110000','黄山', 'HS');
insert into city values ('1110500','2','1110000','滁州', 'CZ');
insert into city values ('1110550','2','1110000','阜阳', 'FY');
insert into city values ('1110600','2','1110000','宿州', 'SZ');
insert into city values ('1110650','2','1110000','巢湖', 'CH');
insert into city values ('1110700','2','1110000','六安', 'LA');
insert into city values ('1110750','2','1110000','亳州', 'BZ');
insert into city values ('1110800','2','1110000','池州', 'CZ');
insert into city values ('1110850','2','1110000','宣城', 'XC');
insert into city values ('1120000','1','','福建', 'FJ');
insert into city values ('1120050','2','1120000','福州', 'FZ');
insert into city values ('1120100','2','1120000','厦门', 'SM');
insert into city values ('1120150','2','1120000','莆田', 'PT');
insert into city values ('1120200','2','1120000','三明', 'SM');
insert into city values ('1120250','2','1120000','泉州', 'QZ');
insert into city values ('1120300','2','1120000','漳州', 'ZZ');
insert into city values ('1120350','2','1120000','南平', 'NP');
insert into city values ('1120400','2','1120000','龙岩', 'LY');
insert into city values ('1120450','2','1120000','宁德', 'ND');
insert into city values ('1130000','1','','江西', 'JX');
insert into city values ('1130050','2','1130000','南昌', 'NC');
insert into city values ('1130100','2','1130000','景德镇', 'JDZ');
insert into city values ('1130150','2','1130000','萍乡', 'PX');
insert into city values ('1130200','2','1130000','九江', 'JJ');
insert into city values ('1130250','2','1130000','新余', 'XY');
insert into city values ('1130300','2','1130000','鹰潭', 'YT');
insert into city values ('1130350','2','1130000','赣州', 'GZ');
insert into city values ('1130400','2','1130000','吉安', 'JA');
insert into city values ('1130450','2','1130000','宜春', 'YC');
insert into city values ('1130500','2','1130000','抚州', 'FZ');
insert into city values ('1130550','2','1130000','上饶', 'SR');
insert into city values ('1140000','1','','山东', 'SD');
insert into city values ('1140050','2','1140000','济南', 'JN');
insert into city values ('1140100','2','1140000','青岛', 'QD');
insert into city values ('1140150','2','1140000','淄博', 'ZB');
insert into city values ('1140200','2','1140000','枣庄', 'ZZ');
insert into city values ('1140250','2','1140000','东营', 'DY');
insert into city values ('1140300','2','1140000','烟台', 'YT');
insert into city values ('1140350','2','1140000','潍坊', 'WF');
insert into city values ('1140400','2','1140000','济宁', 'JN');
insert into city values ('1140450','2','1140000','泰安', 'TA');
insert into city values ('1140500','2','1140000','威海', 'WH');
insert into city values ('1140550','2','1140000','日照', 'RZ');
insert into city values ('1140600','2','1140000','莱芜', 'LW');
insert into city values ('1140650','2','1140000','临沂', 'LY');
insert into city values ('1140700','2','1140000','德州', 'DZ');
insert into city values ('1140750','2','1140000','聊城', 'LC');
insert into city values ('1140800','2','1140000','滨州', 'BZ');
insert into city values ('1140850','2','1140000','菏泽', 'HZ');
insert into city values ('1150000','1','','河南', 'HN');
insert into city values ('1150050','2','1150000','郑州', 'ZZ');
insert into city values ('1150100','2','1150000','开封', 'KF');
insert into city values ('1150150','2','1150000','洛阳', 'LY');
insert into city values ('1150200','2','1150000','平顶山', 'PDS');
insert into city values ('1150250','2','1150000','安阳', 'AY');
insert into city values ('1150300','2','1150000','鹤壁', 'HB');
insert into city values ('1150350','2','1150000','新乡', 'XX');
insert into city values ('1150400','2','1150000','焦作', 'JZ');
insert into city values ('1150450','2','1150000','濮阳', 'PY');
insert into city values ('1150500','2','1150000','许昌', 'XC');
insert into city values ('1150550','2','1150000','漯河', 'LH');
insert into city values ('1150600','2','1150000','三门峡', 'SMX');
insert into city values ('1150650','2','1150000','南阳', 'NY');
insert into city values ('1150700','2','1150000','商丘', 'SQ');
insert into city values ('1150750','2','1150000','信阳', 'XY');
insert into city values ('1150800','2','1150000','周口', 'ZK');
insert into city values ('1150850','2','1150000','驻马店', 'ZMD');
insert into city values ('1150900','2','1150000','济源', 'JY');
insert into city values ('1160000','1','','湖北', 'HB');
insert into city values ('1160050','2','1160000','武汉', 'WH');
insert into city values ('1160100','2','1160000','黄石', 'HS');
insert into city values ('1160150','2','1160000','十堰', 'SY');
insert into city values ('1160200','2','1160000','宜昌', 'YC');
insert into city values ('1160250','2','1160000','襄阳', 'XY');
insert into city values ('1160300','2','1160000','鄂州', 'EZ');
insert into city values ('1160350','2','1160000','荆门', 'JM');
insert into city values ('1160400','2','1160000','孝感', 'XG');
insert into city values ('1160450','2','1160000','荆州', 'JZ');
insert into city values ('1160500','2','1160000','黄冈', 'HG');
insert into city values ('1160550','2','1160000','咸宁', 'XN');
insert into city values ('1160600','2','1160000','随州', 'SZ');
insert into city values ('1160650','2','1160000','恩施', 'ES');
insert into city values ('1160700','2','1160000','潜江', 'QJ');
insert into city values ('1160750','2','1160000','仙桃', 'XT');
insert into city values ('1160800','2','1160000','天门', 'TM');
insert into city values ('1160850','2','1160000','神农架', 'SNJ');
insert into city values ('1170000','1','','湖南', 'HN');
insert into city values ('1170050','2','1170000','长沙', 'ZS');
insert into city values ('1170100','2','1170000','株洲', 'ZZ');
insert into city values ('1170150','2','1170000','湘潭', 'XT');
insert into city values ('1170200','2','1170000','衡阳', 'HY');
insert into city values ('1170250','2','1170000','邵阳', 'SY');
insert into city values ('1170300','2','1170000','岳阳', 'YY');
insert into city values ('1170350','2','1170000','常德', 'CD');
insert into city values ('1170400','2','1170000','张家界', 'ZJJ');
insert into city values ('1170450','2','1170000','益阳', 'YY');
insert into city values ('1170500','2','1170000','郴州', 'CZ');
insert into city values ('1170550','2','1170000','永州', 'YZ');
insert into city values ('1170600','2','1170000','怀化', 'HH');
insert into city values ('1170650','2','1170000','娄底', 'LD');
insert into city values ('1170700','2','1170000','湘西', 'XX');
insert into city values ('1180000','1','','广东', 'GD');
insert into city values ('1180050','2','1180000','广州', 'GZ');
insert into city values ('1180100','2','1180000','韶关', 'SG');
insert into city values ('1180150','2','1180000','深圳', 'SZ');
insert into city values ('1180200','2','1180000','珠海', 'ZH');
insert into city values ('1180250','2','1180000','汕头', 'ST');
insert into city values ('1180300','2','1180000','佛山', 'FS');
insert into city values ('1180350','2','1180000','江门', 'JM');
insert into city values ('1180400','2','1180000','湛江', 'ZJ');
insert into city values ('1180450','2','1180000','茂名', 'MM');
insert into city values ('1180500','2','1180000','肇庆', 'ZQ');
insert into city values ('1180550','2','1180000','惠州', 'HZ');
insert into city values ('1180600','2','1180000','梅州', 'MZ');
insert into city values ('1180650','2','1180000','汕尾', 'SW');
insert into city values ('1180700','2','1180000','河源', 'HY');
insert into city values ('1180750','2','1180000','阳江', 'YJ');
insert into city values ('1180800','2','1180000','清远', 'QY');
insert into city values ('1180850','2','1180000','东莞', 'DG');
insert into city values ('1180900','2','1180000','中山', 'ZS');
insert into city values ('1180950','2','1180000','东沙群岛', 'DSQD');
insert into city values ('1181000','2','1180000','潮州', 'CZ');
insert into city values ('1181050','2','1180000','揭阳', 'JY');
insert into city values ('1181100','2','1180000','云浮', 'YF');
insert into city values ('1190000','1','','广西', 'GX');
insert into city values ('1190050','2','1190000','南宁', 'NN');
insert into city values ('1190100','2','1190000','柳州', 'LZ');
insert into city values ('1190150','2','1190000','桂林', 'GL');
insert into city values ('1190200','2','1190000','梧州', 'WZ');
insert into city values ('1190250','2','1190000','北海', 'BH');
insert into city values ('1190300','2','1190000','防城港', 'FCG');
insert into city values ('1190350','2','1190000','钦州', 'QZ');
insert into city values ('1190400','2','1190000','贵港', 'GG');
insert into city values ('1190450','2','1190000','玉林', 'YL');
insert into city values ('1190500','2','1190000','百色', 'BS');
insert into city values ('1190550','2','1190000','贺州', 'HZ');
insert into city values ('1190600','2','1190000','河池', 'HC');
insert into city values ('1190650','2','1190000','来宾', 'LB');
insert into city values ('1190700','2','1190000','崇左', 'CZ');
insert into city values ('1200000','1','','海南', 'HN');
insert into city values ('1200050','2','1200000','海口', 'HK');
insert into city values ('1200100','2','1200000','三亚', 'SY');
insert into city values ('1200150','2','1200000','临高县', 'LGX');
insert into city values ('1200200','2','1200000','儋州', 'DZ');
insert into city values ('1200250','2','1200000','屯昌县', 'TCX');
insert into city values ('1200300','2','1200000','定安县', 'DAX');
insert into city values ('1200350','2','1200000','澄迈县', 'CMX');
insert into city values ('1200400','2','1200000','文昌', 'WC');
insert into city values ('1200450','2','1200000','琼海', 'QH');
insert into city values ('1200500','2','1200000','万宁', 'WN');
insert into city values ('1200550','2','1200000','琼中县', 'QZX');
insert into city values ('1200600','2','1200000','保亭县', 'BTX');
insert into city values ('1200650','2','1200000','五指山', 'WZS');
insert into city values ('1200700','2','1200000','白沙县', 'BSX');
insert into city values ('1200750','2','1200000','东方', 'DF');
insert into city values ('1200800','2','1200000','昌江县', 'CJX');
insert into city values ('1200850','2','1200000','乐东县', 'LDX');
insert into city values ('1200900','2','1200000','陵水县', 'LSX');
insert into city values ('1200950','2','1200000','西沙群岛', 'XSQD');
insert into city values ('1201000','2','1200000','南沙群岛', 'NSQD');
insert into city values ('1210000','1','','重庆', 'ZQ');
insert into city values ('1210050','2','1210000','万州', 'WZ');
insert into city values ('1210100','2','1210000','涪陵', 'FL');
insert into city values ('1210150','2','1210000','渝中', 'YZ');
insert into city values ('1210200','2','1210000','大渡口', 'DDK');
insert into city values ('1210250','2','1210000','江北', 'JB');
insert into city values ('1210300','2','1210000','沙坪坝', 'SPB');
insert into city values ('1210350','2','1210000','九龙坡', 'JLP');
insert into city values ('1210400','2','1210000','南岸', 'NA');
insert into city values ('1210450','2','1210000','北碚', 'BB');
insert into city values ('1210500','2','1210000','万盛', 'WS');
insert into city values ('1210550','2','1210000','双桥', 'SQ');
insert into city values ('1210600','2','1210000','渝北', 'YB');
insert into city values ('1210650','2','1210000','巴南', 'BN');
insert into city values ('1210700','2','1210000','黔江', 'QJ');
insert into city values ('1210750','2','1210000','长寿', 'ZS');
insert into city values ('1210800','2','1210000','江津', 'JJ');
insert into city values ('1210850','2','1210000','合川', 'HC');
insert into city values ('1210900','2','1210000','永川', 'YC');
insert into city values ('1210950','2','1210000','南川', 'NC');
insert into city values ('1211000','2','1210000','綦江', 'QJ');
insert into city values ('1211050','2','1210000','潼南', 'TN');
insert into city values ('1211100','2','1210000','铜梁', 'TL');
insert into city values ('1211150','2','1210000','大足', 'DZ');
insert into city values ('1211200','2','1210000','荣昌', 'RC');
insert into city values ('1211250','2','1210000','璧山', 'BS');
insert into city values ('1211300','2','1210000','梁平', 'LP');
insert into city values ('1211350','2','1210000','城口', 'CK');
insert into city values ('1211400','2','1210000','丰都', 'FD');
insert into city values ('1211450','2','1210000','垫江', 'DJ');
insert into city values ('1211500','2','1210000','武隆', 'WL');
insert into city values ('1211550','2','1210000','忠县', 'ZX');
insert into city values ('1211600','2','1210000','开县', 'KX');
insert into city values ('1211650','2','1210000','云阳', 'YY');
insert into city values ('1211700','2','1210000','奉节', 'FJ');
insert into city values ('1211750','2','1210000','巫山', 'WS');
insert into city values ('1211800','2','1210000','巫溪', 'WX');
insert into city values ('1211850','2','1210000','石柱', 'SZ');
insert into city values ('1211900','2','1210000','秀山', 'XS');
insert into city values ('1211950','2','1210000','酉阳', 'YY');
insert into city values ('1212000','2','1210000','彭水', 'PS');
insert into city values ('1220000','1','','四川', 'SC');
insert into city values ('1220050','2','1220000','成都', 'CD');
insert into city values ('1220100','2','1220000','自贡', 'ZG');
insert into city values ('1220150','2','1220000','攀枝花', 'PZH');
insert into city values ('1220200','2','1220000','泸州', 'LZ');
insert into city values ('1220250','2','1220000','德阳', 'DY');
insert into city values ('1220300','2','1220000','绵阳', 'MY');
insert into city values ('1220350','2','1220000','广元', 'GY');
insert into city values ('1220400','2','1220000','遂宁', 'SN');
insert into city values ('1220450','2','1220000','内江', 'NJ');
insert into city values ('1220500','2','1220000','乐山', 'LS');
insert into city values ('1220550','2','1220000','南充', 'NC');
insert into city values ('1220600','2','1220000','眉山', 'MS');
insert into city values ('1220650','2','1220000','宜宾', 'YB');
insert into city values ('1220700','2','1220000','广安', 'GA');
insert into city values ('1220750','2','1220000','达州', 'DZ');
insert into city values ('1220800','2','1220000','雅安', 'YA');
insert into city values ('1220850','2','1220000','巴中', 'BZ');
insert into city values ('1220900','2','1220000','资阳', 'ZY');
insert into city values ('1220950','2','1220000','阿坝', 'AB');
insert into city values ('1221000','2','1220000','甘孜', 'GZ');
insert into city values ('1221050','2','1220000','凉山', 'LS');
insert into city values ('1230000','1','','贵州', 'GZ');
insert into city values ('1230050','2','1230000','贵阳', 'GY');
insert into city values ('1230100','2','1230000','六盘水', 'LPS');
insert into city values ('1230150','2','1230000','遵义', 'ZY');
insert into city values ('1230200','2','1230000','安顺', 'AS');
insert into city values ('1230250','2','1230000','铜仁', 'TR');
insert into city values ('1230300','2','1230000','黔西', 'QX');
insert into city values ('1230350','2','1230000','毕节', 'BJ');
insert into city values ('1230400','2','1230000','黔东', 'QD');
insert into city values ('1230450','2','1230000','黔南', 'QN');
insert into city values ('1240000','1','','云南', 'YN');
insert into city values ('1240050','2','1240000','昆明', 'KM');
insert into city values ('1240100','2','1240000','曲靖', 'QJ');
insert into city values ('1240150','2','1240000','玉溪', 'YX');
insert into city values ('1240200','2','1240000','保山', 'BS');
insert into city values ('1240250','2','1240000','昭通', 'ZT');
insert into city values ('1240300','2','1240000','丽江', 'LJ');
insert into city values ('1240350','2','1240000','普洱', 'PE');
insert into city values ('1240400','2','1240000','临沧', 'LC');
insert into city values ('1240450','2','1240000','楚雄', 'CX');
insert into city values ('1240500','2','1240000','红河', 'HH');
insert into city values ('1240550','2','1240000','文山', 'WS');
insert into city values ('1240600','2','1240000','西双版纳', 'XSBN');
insert into city values ('1240650','2','1240000','大理', 'DL');
insert into city values ('1240700','2','1240000','德宏', 'DH');
insert into city values ('1240750','2','1240000','怒江', 'NJ');
insert into city values ('1240800','2','1240000','迪庆', 'DQ');
insert into city values ('1250000','1','','西藏', 'XZ');
insert into city values ('1250050','2','1250000','拉萨', 'LS');
insert into city values ('1250100','2','1250000','昌都', 'CD');
insert into city values ('1250150','2','1250000','山南', 'SN');
insert into city values ('1250200','2','1250000','日喀则', 'RKZ');
insert into city values ('1250250','2','1250000','那曲', 'NQ');
insert into city values ('1250300','2','1250000','阿里', 'AL');
insert into city values ('1250350','2','1250000','林芝', 'LZ');
insert into city values ('1260000','1','','陕西', 'SX');
insert into city values ('1260050','2','1260000','西安', 'XA');
insert into city values ('1260100','2','1260000','铜川', 'TC');
insert into city values ('1260150','2','1260000','宝鸡', 'BJ');
insert into city values ('1260200','2','1260000','咸阳', 'XY');
insert into city values ('1260250','2','1260000','渭南', 'WN');
insert into city values ('1260300','2','1260000','延安', 'YA');
insert into city values ('1260350','2','1260000','汉中', 'HZ');
insert into city values ('1260400','2','1260000','榆林', 'YL');
insert into city values ('1260450','2','1260000','安康', 'AK');
insert into city values ('1260500','2','1260000','商洛', 'SL');
insert into city values ('1270000','1','','甘肃', 'GS');
insert into city values ('1270050','2','1270000','兰州', 'LZ');
insert into city values ('1270100','2','1270000','嘉峪关', 'JYG');
insert into city values ('1270150','2','1270000','金昌', 'JC');
insert into city values ('1270200','2','1270000','白银', 'BY');
insert into city values ('1270250','2','1270000','天水', 'TS');
insert into city values ('1270300','2','1270000','武威', 'WW');
insert into city values ('1270350','2','1270000','张掖', 'ZY');
insert into city values ('1270400','2','1270000','平凉', 'PL');
insert into city values ('1270450','2','1270000','酒泉', 'JQ');
insert into city values ('1270500','2','1270000','庆阳', 'QY');
insert into city values ('1270550','2','1270000','定西', 'DX');
insert into city values ('1270600','2','1270000','陇南', 'LN');
insert into city values ('1270650','2','1270000','临夏', 'LX');
insert into city values ('1270700','2','1270000','甘南', 'GN');
insert into city values ('1280000','1','','青海', 'QH');
insert into city values ('1280050','2','1280000','西宁', 'XN');
insert into city values ('1280100','2','1280000','海东', 'HD');
insert into city values ('1280150','2','1280000','海北', 'HB');
insert into city values ('1280200','2','1280000','黄南', 'HN');
insert into city values ('1280250','2','1280000','海南', 'HN');
insert into city values ('1280300','2','1280000','果洛', 'GL');
insert into city values ('1280350','2','1280000','玉树', 'YS');
insert into city values ('1280400','2','1280000','海西', 'HX');
insert into city values ('1290000','1','','宁夏', 'NX');
insert into city values ('1290050','2','1290000','银川', 'YC');
insert into city values ('1290100','2','1290000','石嘴山', 'SZS');
insert into city values ('1290150','2','1290000','吴忠', 'WZ');
insert into city values ('1290200','2','1290000','固原', 'GY');
insert into city values ('1290250','2','1290000','中卫', 'ZW');
insert into city values ('1300000','1','','新疆', 'XJ');
insert into city values ('1300050','2','1300000','乌鲁木齐', 'WLMQ');
insert into city values ('1300100','2','1300000','克拉玛依', 'KLMY');
insert into city values ('1300150','2','1300000','吐鲁番', 'TLF');
insert into city values ('1300200','2','1300000','哈密', 'HM');
insert into city values ('1300250','2','1300000','昌吉', 'CJ');
insert into city values ('1300300','2','1300000','博尔塔拉', 'BETL');
insert into city values ('1300350','2','1300000','巴音郭楞', 'BYGL');
insert into city values ('1300400','2','1300000','阿克苏', 'AKS');
insert into city values ('1300450','2','1300000','克孜勒苏', 'KZLS');
insert into city values ('1300500','2','1300000','喀什', 'KS');
insert into city values ('1300550','2','1300000','和田', 'HT');
insert into city values ('1300600','2','1300000','伊犁', 'YL');
insert into city values ('1300650','2','1300000','塔城', 'TC');
insert into city values ('1300700','2','1300000','阿勒泰', 'ALT');
insert into city values ('1300750','2','1300000','石河子', 'SHZ');
insert into city values ('1300800','2','1300000','阿拉尔', 'ALE');
insert into city values ('1300850','2','1300000','图木舒克', 'TMSK');
insert into city values ('1300900','2','1300000','五家渠', 'WJQ');
有什么不懂或者疏漏的地方请大家指正,欢迎拍砖!



本文链接http://element-ui.cn/news/show-576990.aspx