国内省市联动数据库
中国省市区三级联动表
在“省” 列单元格 选中后, 依次选 择,数据 →数据验 证→数据 有效性 (弹出数 据有效性 选择框) 设置→允 许(下拉 列表)→ 序列→在 来源框中 填入 =INDIREC T(a57), 其中括号 内的a57 为国家所 在列的单 元格号
“市”“ 区”列单 元格也做 同样的操 作,仅在 =INDIREC T(这 里),括 号中所对 应的相应 的单元 格,市列 选择省列 单元格, 区列选择 市列单元 格 自此设置 完毕,效 果如下, 如果觉得 国家列不 美观,可 以把国家 列隐藏起 来即可
以上示例 图片为效 果展示图 。为使用 方便。介 绍一个 excel的 函数命令 如下: "=INDIRE CT(I4)" 将文本中 的省, 市,区工 作簿复制 到要实现 省市区三 级联动的 表内 然后就是 实现步 骤,为了 方便学 习,我们 将b列设 为省,c 列设为 市,d列 设为区
为了简化 记忆本次 三级联动 只用了一 个命令就 是上面的 =INDIREC T(I4) 我们将a 列设为国 家,内容 全部填写 中国,这 样方便我 们使用 =INDIREC T(I4)命 令 本表中含 有很多定 义好的名 称,所以 使用时可 以在本表 中建立新 的工作 簿,复制 copy都是 无效的
国家 中国 中国 中国 中国 中国
省 上海 河北
省市区三级联动菜单(附数据库)
省市区三级联动菜单(附数据库)<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><!----------------------------------------------------------------省的字段是:province--市的字段是:city--县的字段是:area---------------------------------------------------------------------------><mce:script type="text/javascript"><!--/*********定义创建XMLHttpRequest对象的⽅法***************************************/var xmlHttp;//声明变量var requestType="";//声明初始类型为空function createXMLHttpRequest()//定义创建⼀个跨浏览器函数的开头{if(window.ActiveXObject)//ActiveXObject对象到找到的时候返回的是真,否则是假{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");//这个是使⽤IE的⽅法创建XmlHttp}else if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();//这个是使⽤⾮IE的⽅法创建XmlHttp}}/****************判断服务器响应的事件,如果返回是4则说明交互完成,判断标⽰头,**************************************************/function handleStateChange(){//判断返回的⼀个函数,来确定执⾏那个的函数if(xmlHttp.readystate==4){//4说明是执⾏交互完毕0 (未初始化)1 (正在装载)2 (装载完毕) 3 (交互中)4 (完成)if(xmlHttp.status==200){//http的⼀个报头说明成功找到if(type=="city"){//判断查询的类型showcity();//返回响应的显⽰}else if(type="area"){//判断响应的查询的类型showarea();//返回响应的显⽰}}}}/**************************城市的⼀个查询函数**********************************************************/function queryCity(citycode){//执⾏程序查询,查询城市的createXMLHttpRequest();//调⽤创建XmlHttp的函数type="city";//表⽰类型,查询城市处理显⽰的时候需要⽤到var url='data.php?provincecode='+citycode+'&n='+Math.random();//设定URL传值⽅法同时防⽌缓存xmlHttp.open("GET",url,true);//建⽴服务器连接,异步传输treexmlHttp.onreadystatechange=handleStateChange;//处理这个响应所需要的函数xmlHttp.send(null);//执⾏程序函数这⾥的中间的参数是因为GET原因}/**********************县区的⼀个查询函数***********************************************************/function queryArea(citycode){//查询程序createXMLHttpRequest();//调⽤创建XmlHttp的函数type="area";//查询县的var url="data.php?citycode="+citycode+'&n='+Math.random();//设定URL传值⽅法同时防⽌缓存xmlHttp.open("GET",url,true);xmlHttp.onreadystatechange=handleStateChange;//处理响应的函数名xmlHttp.send(null);//执⾏程序函数这⾥的中间的参数是因为GET原因}/*********************⼀个显⽰函数**********************************************************/function showcity(){//显⽰函数document.getElementById("city").innerHTML=xmlHttp.responseText;//捕获ID显⽰返回的数据}function showarea(){document.getElementById("area").innerHTML=xmlHttp.responseText;//捕获ID显⽰返回的数据}$conn=mysql_connect("localhost","root","");//链接数据库mysql_select_db("novel");//选择数据库mysql_query("set names 'utf8'");//设定字符集$sql="select * from province";//查询数据库province表也就是省$result=mysql_query($sql);//执⾏语句赋值给变量><from id='form1'><!--输出表单头--><!--输出下拉列表框,并设定onchange响应事件,把省值传递过去--><select id='province' onchange='queryCity(this.options[this.selectedIndex].value)'><!--输出下拉列表项值--><option value='-1' selected>请选择省份</option><?phpwhile($row=mysql_fetch_row($result)){//循环循环查询显⽰省输出数据显⽰echo "<option value='$row[1]'>$row[2]</option>/n";}></select><!--下拉列表项尾数--><span id='city'></span><!--显⽰数据的城市的位置--><span id='area'></span><!--显⽰数据的城市的位置--></form><!--表单项结尾--></body></html><?php$provincecode=$_GET['provincecode'];//接收省键值$citycode=$_GET['citycode'];//接收城市键值$conn=mysql_connect("localhost","root","");//连接主机mysql_select_db("novel");//选择数据库mysql_query("set names 'utf8'");if($provincecode!=""){//如果传递过来的不为空则执⾏$sql="select * from city where provincecode=$provincecode";//查询城市符合属于上边传递过来的省的字段 $result=mysql_query($sql);//执⾏SQL查询语句print_r($row);><select onchange='queryArea(this.options[this.selectedIndex].value)'><!--下拉列表框开头--><option value='-1' selected>请选择城市</option><!--下拉列表框值开头--><?php while($row=mysql_fetch_row($result)){//循环记录集?><option value="<?= $row[1]?>"><?=$row[2]?></option><?php }?></select><?php }?><?phpif($citycode!=""){$sql="select * from area where citycode=$citycode";$result=mysql_query($sql);echo "<select>/n";echo "<option value='-1' selected>请选择县</option>/n";while($row=mysql_fetch_row($result)){echo "<option value='$row[1]'>$row[2]</option>/n";}echo "</select>/n";}>-- phpMyAdmin SQL Dump-- version 2.11.2-- ---- 主机: localhost-- ⽣成⽇期: 2008 年 07 ⽉ 11 ⽇ 00:45-- 服务器版本: 5.0.27-- PHP 版本: 5.2.0SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";---- 数据库: `novel`--CREATE DATABASE `novel` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;USE `novel`;-- 表的结构 `area`--CREATE TABLE IF NOT EXISTS `area` (`id` int(11) NOT NULL auto_increment,`code` varchar(6) NOT NULL,`name` varchar(20) NOT NULL,`citycode` varchar(6) NOT NULL,PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3145 ; ---- 导出表中的数据 `area`--INSERT INTO `area` (`id`, `code`, `name`, `citycode`) VALUES(1, '110101', '东城区', '110100'),(2, '110102', '西城区', '110100'),(3, '110103', '崇⽂区', '110100'),(4, '110104', '宣武区', '110100'),(5, '110105', '朝阳区', '110100'),(6, '110106', '丰台区', '110100'),(7, '110107', '⽯景⼭区', '110100'),(8, '110108', '海淀区', '110100'),(9, '110109', '门头沟区', '110100'),(10, '110111', '房⼭区', '110100'),(11, '110112', '通州区', '110100'),(12, '110113', '顺义区', '110100'),(13, '110114', '昌平区', '110100'),(14, '110115', '⼤兴区', '110100'),(15, '110116', '怀柔区', '110100'),(16, '110117', '平⾕区', '110100'),(17, '110228', '密云县', '110200'),(18, '110229', '延庆县', '110200'),(19, '120101', '和平区', '120100'),(20, '120102', '河东区', '120100'),(21, '120103', '河西区', '120100'),(22, '120104', '南开区', '120100'),(23, '120105', '河北区', '120100'),(24, '120106', '红桥区', '120100'),(25, '120107', '塘沽区', '120100'),(26, '120108', '汉沽区', '120100'),(27, '120109', '⼤港区', '120100'),(28, '120110', '东丽区', '120100'),(29, '120111', '西青区', '120100'),(30, '120112', '津南区', '120100'),(31, '120113', '北⾠区', '120100'),(32, '120114', '武清区', '120100'),(33, '120115', '宝坻区', '120100'),(34, '120221', '宁河县', '120200'),(35, '120223', '静海县', '120200'),(36, '120225', '蓟 县', '120200'),(37, '130101', '市辖区', '130100'),(38, '130102', '长安区', '130100'),(39, '130103', '桥东区', '130100'),(40, '130104', '桥西区', '130100'),(41, '130105', '新华区', '130100'),(42, '130107', '井陉矿区', '130100'),(43, '130108', '裕华区', '130100'),(44, '130121', '井陉县', '130100'),(45, '130123', '正定县', '130100'),(46, '130124', '栾城县', '130100'),(47, '130125', '⾏唐县', '130100'),(48, '130126', '灵寿县', '130100'),(49, '130127', '⾼⾢县', '130100'),(50, '130128', '深泽县', '130100'),(51, '130129', '赞皇县', '130100'),(52, '130130', '⽆极县', '130100'),(53, '130131', '平⼭县', '130100'),(54, '130132', '元⽒县', '130100'),(55, '130133', '赵 县', '130100'),(56, '130181', '⾟集市', '130100'),(57, '130182', '藁城市', '130100'),(58, '130183', '晋州市', '130100'),(59, '130184', '新乐市', '130100'),(60, '130185', '⿅泉市', '130100'),(61, '130201', '市辖区', '130200'),(62, '130202', '路南区', '130200'),(63, '130203', '路北区', '130200'),(64, '130204', '古冶区', '130200'),(73, '130230', '唐海县', '130200'), (74, '130281', '遵化市', '130200'), (75, '130283', '迁安市', '130200'), (76, '130301', '市辖区', '130300'), (77, '130302', '海港区', '130300'), (78, '130303', '⼭海关区', '130300'), (79, '130304', '北戴河区', '130300'), (80, '130321', '青龙满族⾃治县', '130300'), (81, '130322', '昌黎县', '130300'), (82, '130323', '抚宁县', '130300'), (83, '130324', '卢龙县', '130300'), (84, '130401', '市辖区', '130400'), (85, '130402', '邯⼭区', '130400'), (86, '130403', '丛台区', '130400'), (87, '130404', '复兴区', '130400'), (88, '130406', '峰峰矿区', '130400'), (89, '130421', '邯郸县', '130400'), (90, '130423', '临漳县', '130400'), (91, '130424', '成安县', '130400'), (92, '130425', '⼤名县', '130400'), (93, '130426', '涉 县', '130400'), (94, '130427', '磁 县', '130400'), (95, '130428', '肥乡县', '130400'), (96, '130429', '永年县', '130400'), (97, '130430', '邱 县', '130400'), (98, '130431', '鸡泽县', '130400'), (99, '130432', '⼴平县', '130400'), (100, '130433', '馆陶县', '130400'), (101, '130434', '魏 县', '130400'), (102, '130435', '曲周县', '130400'), (103, '130481', '武安市', '130400'), (104, '130501', '市辖区', '130500'), (105, '130502', '桥东区', '130500'), (106, '130503', '桥西区', '130500'), (107, '130521', '邢台县', '130500'), (108, '130522', '临城县', '130500'), (109, '130523', '内丘县', '130500'), (110, '130524', '柏乡县', '130500'), (111, '130525', '隆尧县', '130500'), (112, '130526', '任 县', '130500'), (113, '130527', '南和县', '130500'), (114, '130528', '宁晋县', '130500'), (115, '130529', '巨⿅县', '130500'), (116, '130530', '新河县', '130500'), (117, '130531', '⼴宗县', '130500'), (118, '130532', '平乡县', '130500'), (119, '130533', '威 县', '130500'), (120, '130534', '清河县', '130500'), (121, '130535', '临西县', '130500'), (122, '130581', '南宫市', '130500'), (123, '130582', '沙河市', '130500'), (124, '130601', '市辖区', '130600'), (125, '130602', '新市区', '130600'), (126, '130603', '北市区', '130600'), (127, '130604', '南市区', '130600'), (128, '130621', '满城县', '130600'), (129, '130622', '清苑县', '130600'), (130, '130623', '涞⽔县', '130600'), (131, '130624', '⾩平县', '130600'), (132, '130625', '徐⽔县', '130600'), (133, '130626', '定兴县', '130600'), (134, '130627', '唐 县', '130600'), (135, '130628', '⾼阳县', '130600'), (136, '130629', '容城县', '130600'), (137, '130630', '涞源县', '130600'), (138, '130631', '望都县', '130600'), (139, '130632', '安新县', '130600'), (140, '130633', '易 县', '130600'), (141, '130634', '曲阳县', '130600'), (142, '130635', '蠡 县', '130600'), (143, '130636', '顺平县', '130600'), (144, '130637', '博野县', '130600'), (145, '130638', '雄 县', '130600'), (146, '130681', '涿州市', '130600'), (147, '130682', '定州市', '130600'), (148, '130683', '安国市', '130600'),(157, '130723', '康保县', '130700'),(158, '130724', '沽源县', '130700'),(159, '130725', '尚义县', '130700'),(160, '130726', '蔚 县', '130700'),(161, '130727', '阳原县', '130700'),(162, '130728', '怀安县', '130700'),(163, '130729', '万全县', '130700'),(164, '130730', '怀来县', '130700'),(165, '130731', '涿⿅县', '130700'),(166, '130732', '⾚城县', '130700'),(167, '130733', '崇礼县', '130700'),(168, '130801', '市辖区', '130800'),(169, '130802', '双桥区', '130800'),(170, '130803', '双滦区', '130800'),(171, '130804', '鹰⼿营⼦矿区', '130800'), (172, '130821', '承德县', '130800'),(173, '130822', '兴隆县', '130800'),(174, '130823', '平泉县', '130800'),(175, '130824', '滦平县', '130800'),(176, '130825', '隆化县', '130800'),(177, '130826', '丰宁满族⾃治县', '130800'), (178, '130827', '宽城满族⾃治县', '130800'), (179, '130828', '围场满族蒙古族⾃治县', '130800'), (180, '130901', '市辖区', '130900'),(181, '130902', '新华区', '130900'),(182, '130903', '运河区', '130900'),(183, '130921', '沧 县', '130900'),(184, '130922', '青 县', '130900'),(185, '130923', '东光县', '130900'),(186, '130924', '海兴县', '130900'),(187, '130925', '盐⼭县', '130900'),(188, '130926', '肃宁县', '130900'),(189, '130927', '南⽪县', '130900'),(190, '130928', '吴桥县', '130900'),(191, '130929', '献 县', '130900'),(192, '130930', '孟村回族⾃治县', '130900'), (193, '130981', '泊头市', '130900'),(194, '130982', '任丘市', '130900'),(195, '130983', '黄骅市', '130900'),(196, '130984', '河间市', '130900'),(197, '131001', '市辖区', '131000'),(198, '131002', '安次区', '131000'),(199, '131003', '⼴阳区', '131000'),(200, '131022', '固安县', '131000'),(201, '131023', '永清县', '131000'),(202, '131024', '⾹河县', '131000'),(203, '131025', '⼤城县', '131000'),(204, '131026', '⽂安县', '131000'),(205, '131028', '⼤⼚回族⾃治县', '131000'), (206, '131081', '霸州市', '131000'),(207, '131082', '三河市', '131000'),(208, '131101', '市辖区', '131100'),(209, '131102', '桃城区', '131100'),(210, '131121', '枣强县', '131100'),(211, '131122', '武⾢县', '131100'),(212, '131123', '武强县', '131100'),(213, '131124', '饶阳县', '131100'),(214, '131125', '安平县', '131100'),(215, '131126', '故城县', '131100'),(216, '131127', '景 县', '131100'),(217, '131128', '⾩城县', '131100'),(218, '131181', '冀州市', '131100'),(219, '131182', '深州市', '131100'),(220, '140101', '市辖区', '140100'),(221, '140105', '⼩店区', '140100'),(222, '140106', '迎泽区', '140100'),(223, '140107', '杏花岭区', '140100'),(224, '140108', '尖草坪区', '140100'),(225, '140109', '万柏林区', '140100'),(226, '140110', '晋源区', '140100'),(227, '140121', '清徐县', '140100'),(228, '140122', '阳曲县', '140100'),(229, '140123', '娄烦县', '140100'),(230, '140181', '古交市', '140100'),(231, '140201', '市辖区', '140200'),(232, '140202', '城 区', '140200'),(241, '140226', '左云县', '140200'), (242, '140227', '⼤同县', '140200'), (243, '140301', '市辖区', '140300'), (244, '140302', '城 区', '140300'), (245, '140303', '矿 区', '140300'), (246, '140311', '郊 区', '140300'), (247, '140321', '平定县', '140300'), (248, '140322', '盂 县', '140300'), (249, '140401', '市辖区', '140400'), (250, '140402', '城 区', '140400'), (251, '140411', '郊 区', '140400'), (252, '140421', '长治县', '140400'), (253, '140423', '襄垣县', '140400'), (254, '140424', '屯留县', '140400'), (255, '140425', '平顺县', '140400'), (256, '140426', '黎城县', '140400'), (257, '140427', '壶关县', '140400'), (258, '140428', '长⼦县', '140400'), (259, '140429', '武乡县', '140400'), (260, '140430', '沁 县', '140400'), (261, '140431', '沁源县', '140400'), (262, '140481', '潞城市', '140400'), (263, '140501', '市辖区', '140500'), (264, '140502', '城 区', '140500'), (265, '140521', '沁⽔县', '140500'), (266, '140522', '阳城县', '140500'), (267, '140524', '陵川县', '140500'), (268, '140525', '泽州县', '140500'), (269, '140581', '⾼平市', '140500'), (270, '140601', '市辖区', '140600'), (271, '140602', '朔城区', '140600'), (272, '140603', '平鲁区', '140600'), (273, '140621', '⼭阴县', '140600'), (274, '140622', '应 县', '140600'), (275, '140623', '右⽟县', '140600'), (276, '140624', '怀仁县', '140600'), (277, '140701', '市辖区', '140700'), (278, '140702', '榆次区', '140700'), (279, '140721', '榆社县', '140700'), (280, '140722', '左权县', '140700'), (281, '140723', '和顺县', '140700'), (282, '140724', '昔阳县', '140700'), (283, '140725', '寿阳县', '140700'), (284, '140726', '太⾕县', '140700'), (285, '140727', '祁 县', '140700'), (286, '140728', '平遥县', '140700'), (287, '140729', '灵⽯县', '140700'), (288, '140781', '介休市', '140700'), (289, '140801', '市辖区', '140800'), (290, '140802', '盐湖区', '140800'), (291, '140821', '临猗县', '140800'), (292, '140822', '万荣县', '140800'), (293, '140823', '闻喜县', '140800'), (294, '140824', '稷⼭县', '140800'), (295, '140825', '新绛县', '140800'), (296, '140826', '绛 县', '140800'), (297, '140827', '垣曲县', '140800'), (298, '140828', '夏 县', '140800'), (299, '140829', '平陆县', '140800'), (300, '140830', '芮城县', '140800'), (301, '140881', '永济市', '140800'), (302, '140882', '河津市', '140800'), (303, '140901', '市辖区', '140900'), (304, '140902', '忻府区', '140900'), (305, '140921', '定襄县', '140900'), (306, '140922', '五台县', '140900'), (307, '140923', '代 县', '140900'), (308, '140924', '繁峙县', '140900'), (309, '140925', '宁武县', '140900'), (310, '140926', '静乐县', '140900'), (311, '140927', '神池县', '140900'), (312, '140928', '五寨县', '140900'), (313, '140929', '岢岚县', '140900'), (314, '140930', '河曲县', '140900'), (315, '140931', '保德县', '140900'), (316, '140932', '偏关县', '140900'),(325, '141026', '安泽县', '141000'),(326, '141027', '浮⼭县', '141000'),(327, '141028', '吉 县', '141000'),(328, '141029', '乡宁县', '141000'),(329, '141030', '⼤宁县', '141000'),(330, '141031', '隰 县', '141000'),(331, '141032', '永和县', '141000'),(332, '141033', '蒲 县', '141000'),(333, '141034', '汾西县', '141000'),(334, '141081', '侯马市', '141000'),(335, '141082', '霍州市', '141000'),(336, '141101', '市辖区', '141100'),(337, '141102', '离⽯区', '141100'),(338, '141121', '⽂⽔县', '141100'),(339, '141122', '交城县', '141100'),(340, '141123', '兴 县', '141100'),(341, '141124', '临 县', '141100'),(342, '141125', '柳林县', '141100'),(343, '141126', '⽯楼县', '141100'),(344, '141127', '岚 县', '141100'),(345, '141128', '⽅⼭县', '141100'),(346, '141129', '中阳县', '141100'),(347, '141130', '交⼝县', '141100'),(348, '141181', '孝义市', '141100'),(349, '141182', '汾阳市', '141100'),(350, '150101', '市辖区', '150100'),(351, '150102', '新城区', '150100'),(352, '150103', '回民区', '150100'),(353, '150104', '⽟泉区', '150100'),(354, '150105', '赛罕区', '150100'),(355, '150121', '⼟默特左旗', '150100'), (356, '150122', '托克托县', '150100'),(357, '150123', '和林格尔县', '150100'), (358, '150124', '清⽔河县', '150100'),(359, '150125', '武川县', '150100'),(360, '150201', '市辖区', '150200'),(361, '150202', '东河区', '150200'),(362, '150203', '昆都仑区', '150200'),(363, '150204', '青⼭区', '150200'),(364, '150205', '⽯拐区', '150200'),(365, '150206', '⽩云矿区', '150200'),(366, '150207', '九原区', '150200'),(367, '150221', '⼟默特右旗', '150200'), (368, '150222', '固阳县', '150200'),(369, '150223', '达尔罕茂明安联合旗', '150200'), (370, '150301', '市辖区', '150300'),(371, '150302', '海勃湾区', '150300'),(372, '150303', '海南区', '150300'),(373, '150304', '乌达区', '150300'),(374, '150401', '市辖区', '150400'),(375, '150402', '红⼭区', '150400'),(376, '150403', '元宝⼭区', '150400'),(377, '150404', '松⼭区', '150400'),(378, '150421', '阿鲁科尔沁旗', '150400'), (379, '150422', '巴林左旗', '150400'),(380, '150423', '巴林右旗', '150400'),(381, '150424', '林西县', '150400'),(382, '150425', '克什克腾旗', '150400'), (383, '150426', '翁⽜特旗', '150400'),(384, '150428', '喀喇沁旗', '150400'),(385, '150429', '宁城县', '150400'),(386, '150430', '敖汉旗', '150400'),(387, '150501', '市辖区', '150500'),(388, '150502', '科尔沁区', '150500'),(389, '150521', '科尔沁左翼中旗', '150500'), (390, '150522', '科尔沁左翼后旗', '150500'), (391, '150523', '开鲁县', '150500'),(392, '150524', '库伦旗', '150500'),(393, '150525', '奈曼旗', '150500'),(394, '150526', '扎鲁特旗', '150500'),(395, '150581', '霍林郭勒市', '150500'), (396, '150602', '东胜区', '150600'),(397, '150621', '达拉特旗', '150600'),(398, '150622', '准格尔旗', '150600'),(399, '150623', '鄂托克前旗', '150600'), (400, '150624', '鄂托克旗', '150600'),(407, '150722', '莫⼒达⽡达斡尔族⾃治旗', '150700'), (408, '150723', '鄂伦春⾃治旗', '150700'),(409, '150724', '鄂温克族⾃治旗', '150700'), (410, '150725', '陈巴尔虎旗', '150700'),(411, '150726', '新巴尔虎左旗', '150700'),(412, '150727', '新巴尔虎右旗', '150700'),(413, '150781', '满洲⾥市', '150700'),(414, '150782', '⽛克⽯市', '150700'),(415, '150783', '扎兰屯市', '150700'),(416, '150784', '额尔古纳市', '150700'),(417, '150785', '根河市', '150700'),(418, '150801', '市辖区', '150800'),(419, '150802', '临河区', '150800'),(420, '150821', '五原县', '150800'),(421, '150822', '磴⼝县', '150800'),(422, '150823', '乌拉特前旗', '150800'),(423, '150824', '乌拉特中旗', '150800'),(424, '150825', '乌拉特后旗', '150800'),(425, '150826', '杭锦后旗', '150800'),(426, '150901', '市辖区', '150900'),(427, '150902', '集宁区', '150900'),(428, '150921', '卓资县', '150900'),(429, '150922', '化德县', '150900'),(430, '150923', '商都县', '150900'),(431, '150924', '兴和县', '150900'),(432, '150925', '凉城县', '150900'),(433, '150926', '察哈尔右翼前旗', '150900'), (434, '150927', '察哈尔右翼中旗', '150900'), (435, '150928', '察哈尔右翼后旗', '150900'), (436, '150929', '四⼦王旗', '150900'),(437, '150981', '丰镇市', '150900'),(438, '152201', '乌兰浩特市', '152200'),(439, '152202', '阿尔⼭市', '152200'),(440, '152221', '科尔沁右翼前旗', '152200'), (441, '152222', '科尔沁右翼中旗', '152200'), (442, '152223', '扎赉特旗', '152200'),(443, '152224', '突泉县', '152200'),(444, '152501', '⼆连浩特市', '152500'),(445, '152502', '锡林浩特市', '152500'),(446, '152522', '阿巴嘎旗', '152500'),(447, '152523', '苏尼特左旗', '152500'),(448, '152524', '苏尼特右旗', '152500'),(449, '152525', '东乌珠穆沁旗', '152500'),(450, '152526', '西乌珠穆沁旗', '152500'),(451, '152527', '太仆寺旗', '152500'),(452, '152528', '镶黄旗', '152500'),(453, '152529', '正镶⽩旗', '152500'),(454, '152530', '正蓝旗', '152500'),(455, '152531', '多伦县', '152500'),(456, '152921', '阿拉善左旗', '152900'),(457, '152922', '阿拉善右旗', '152900'),(458, '152923', '额济纳旗', '152900'),(459, '210101', '市辖区', '210100'),(460, '210102', '和平区', '210100'),(461, '210103', '沈河区', '210100'),(462, '210104', '⼤东区', '210100'),(463, '210105', '皇姑区', '210100'),(464, '210106', '铁西区', '210100'),(465, '210111', '苏家屯区', '210100'),(466, '210112', '东陵区', '210100'),(467, '210113', '新城⼦区', '210100'),(468, '210114', '于洪区', '210100'),(469, '210122', '辽中县', '210100'),(470, '210123', '康平县', '210100'),(471, '210124', '法库县', '210100'),(472, '210181', '新民市', '210100'),(473, '210201', '市辖区', '210200'),(474, '210202', '中⼭区', '210200'),(475, '210203', '西岗区', '210200'),(476, '210204', '沙河⼝区', '210200'),(477, '210211', '⽢井⼦区', '210200'),(478, '210212', '旅顺⼝区', '210200'),(479, '210213', '⾦州区', '210200'),(480, '210224', '长海县', '210200'),(481, '210281', '⽡房店市', '210200'),(482, '210282', '普兰店市', '210200'),(483, '210283', '庄河市', '210200'),(484, '210301', '市辖区', '210300'),。
省市二级联动数据库生成代码(JAVA)
省市二级联动数据库生成代码(JAVA)来源:开发界数据来源于谷歌地图省市列表(无省、市、区字样)省市列表(带省、市、区)源代码注意:由于我不想把省、市、区这样的字也转换成拼音,如河北省转换为HBS,北京市转换为BJS,我把省、市、区相关字样已删除,但我也保留了原文件,有需要的可以下载。
表结构:[sql] view plaincopyprint?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;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;具体实现请看以下代码:[java] view plaincopyprint?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");//定义保存省、市数据的数据结构。
多数据库基础地理信息数据联动更新研究
多数据库基础地理信息数据联动更新研究李霞;张红萍;宋钢【摘要】数据现势性是数据服务能力的重要指标之一,多种地理信息数据库并存与分数据库独立更新的更新方式之间的矛盾日益凸显.文中提出了一种以共有要素为核心,采用增量更新包技术,同步更新多数据库的联动更新方法.选取兰州新区为试验区,验证了联动更新方法的可操作性和效率.试验表明:多数据库的联动更新方法不但避免了多数据库中同一要素现势性不一致问题,而且有效提高了基础地理信息数据的更新效率.【期刊名称】《矿山测量》【年(卷),期】2018(046)004【总页数】4页(P33-36)【关键词】多数据库;数据更新;基础地理信息数据;增量更新包【作者】李霞;张红萍;宋钢【作者单位】甘肃省基础地理信息中心,甘肃兰州 730000;甘肃省基础地理信息中心,甘肃兰州 730000;甘肃省基础地理信息中心,甘肃兰州 730000【正文语种】中文【中图分类】TD672;P208随着社会经济发展模式的不断变革,基础地理信息数据已经成为国家经济建设和社会发展的基础性、战略性资源[1]。
为满足不同服务对象的需求,基础地理信息数据库、地理空间框架数据库、“天地图”母库和地理国情普查数据库相继而生。
传统的基础地理信息数据生产方式往往导致同一要素重复采集、各类地理信息数据库现势性不一致,难以满足当前数据快速生产和服务的需求。
统筹多种地理信息数据库的更新工作,实现同一要素的联动更新、提高地理信息数据的更新效率,是目前地理信息技术发展中急需解决的问题之一[2-3]。
1 总体思路针对基础地理信息数据库(以下简称“基础库”)、地理空间框架数据库(以下简称“框架库”)、“天地图”母库(以下简称“母库”)、地理国情普查数据库(以下简称“普查库”)和制图数据库(以下简称“制图库”)的公共要素,设计基于要素的多数据库联动更新方法,实现不同数据库要素的联动更新,技术路线如图1所示。
数据更新流程主要包括三个环节:要素更新、外业调绘和联动更新。
中国省市区县三级联动(库表结构及数据)
省级别1110000北京市2120000天津市3130000河北省4140000山西省5150000内蒙古自治区6210000辽宁省7220000吉林省8230000黑龙江省9310000上海市10320000江苏省11330000浙江省12340000安徽省13350000福建省14360000江西省15370000山东省16410000河南省17420000湖北省18430000湖南省19440000广东省20450000广西壮族自治区21460000海南省22500000重庆市23510000四川省24520000贵州省25530000云南省26540000西藏自治区27610000陕西省28620000甘肃省29630000青海省30640000宁夏回族自治区31650000新疆维吾尔自治区32710000台湾省33810000香港特别行政区34820000澳门特别行政区地级1110100市辖区1100002110200县1100003120100市辖区1200004120200县1200005130100石家庄市1300006130200唐山市1300007130300秦皇岛市1300008130400邯郸市1300009130500邢台市13000010130600保定市13000011130700张家口市13000012130800承德市13000013130900沧州市13000014131000廊坊市13000015131100衡水市13000016140100太原市14000017140200大同市14000018140300阳泉市14000022140700晋中市140000 23140800运城市140000 24140900忻州市140000 25141000临汾市140000 26141100吕梁市140000 27150100呼和浩特市150000 28150200包头市150000 29150300乌海市150000 30150400赤峰市150000 31150500通辽市150000 32150600鄂尔多斯市150000 33150700呼伦贝尔市150000 34150800巴彦淖尔市150000 35150900乌兰察布市150000 36152200兴安盟150000 37152500锡林郭勒盟150000 38152900阿拉善盟150000 39210100沈阳市210000 40210200大连市210000 41210300鞍山市210000 42210400抚顺市210000 43210500本溪市210000 44210600丹东市210000 45210700锦州市210000 46210800营口市210000 47210900阜新市210000 48211000辽阳市210000 49211100盘锦市210000 50211200铁岭市210000 51211300朝阳市210000 52211400葫芦岛市210000 53220100长春市220000 54220200吉林市220000 55220300四平市220000 56220400辽源市220000 57220500通化市220000 58220600白山市220000 59220700松原市220000 60220800白城市220000220000 61222400延边朝鲜族自62230100哈尔滨市230000 63230200齐齐哈尔市230000 64230300鸡西市230000 65230400鹤岗市230000 66230500双鸭山市230000 67230600大庆市230000 68230700伊春市230000 69230800佳木斯市230000 70230900七台河市230000 71231000牡丹江市230000 72231100黑河市230000 73231200绥化市230000230000 74232700大兴安岭地区75310100市辖区310000 76310200县310000 77320100南京市32000081320500苏州市320000 82320600南通市320000 83320700连云港市320000 84320800淮安市320000 85320900盐城市320000 86321000扬州市320000 87321100镇江市320000 88321200泰州市320000 89321300宿迁市320000 90330100杭州市330000 91330200宁波市330000 92330300温州市330000 93330400嘉兴市330000 94330500湖州市330000 95330600绍兴市330000 96330700金华市330000 97330800衢州市330000 98330900舟山市330000 99331000台州市330000 100331100丽水市330000 101340100合肥市340000 102340200芜湖市340000 103340300蚌埠市340000 104340400淮南市340000 105340500马鞍山市340000 106340600淮北市340000 107340700铜陵市340000 108340800安庆市340000 109341000黄山市340000 110341100滁州市340000 111341200阜阳市340000 112341300宿州市340000 113341400巢湖市340000 114341500六安市340000 115341600亳州市340000 116341700池州市340000 117341800宣城市340000 118350100福州市350000 119350200厦门市350000 120350300莆田市350000 121350400三明市350000 122350500泉州市350000 123350600漳州市350000 124350700南平市350000 125350800龙岩市350000 126350900宁德市350000 127360100南昌市360000 128360200景德镇市360000 129360300萍乡市360000 130360400九江市360000 131360500新余市360000 132360600鹰潭市360000 133360700赣州市360000 134360800吉安市360000 135360900宜春市360000 136361000抚州市360000139370200青岛市370000 140370300淄博市370000 141370400枣庄市370000 142370500东营市370000 143370600烟台市370000 144370700潍坊市370000 145370800济宁市370000 146370900泰安市370000 147371000威海市370000 148371100日照市370000 149371200莱芜市370000 150371300临沂市370000 151371400德州市370000 152371500聊城市370000 153371600滨州市370000 154371700荷泽市370000 155410100郑州市410000 156410200开封市410000 157410300洛阳市410000 158410400平顶山市410000 159410500安阳市410000 160410600鹤壁市410000 161410700新乡市410000 162410800焦作市410000 163410900濮阳市410000 164411000许昌市410000 165411100漯河市410000 166411200三门峡市410000 167411300南阳市410000 168411400商丘市410000 169411500信阳市410000 170411600周口市410000 171411700驻马店市410000 172420100武汉市420000 173420200黄石市420000 174420300十堰市420000 175420500宜昌市420000 176420600襄樊市420000 177420700鄂州市420000 178420800荆门市420000 179420900孝感市420000 180421000荆州市420000 181421100黄冈市420000 182421200咸宁市420000 183421300随州市420000 184422800恩施土家族苗420000420000 185429000省直辖行政单186430100长沙市430000 187430200株洲市430000 188430300湘潭市430000 189430400衡阳市430000 190430500邵阳市430000 191430600岳阳市430000 192430700常德市430000 193430800张家界市430000 194430900益阳市430000 195431000郴州市430000198431300娄底市430000430000 199433100湘西土家族苗200440100广州市440000 201440200韶关市440000 202440300深圳市440000 203440400珠海市440000 204440500汕头市440000 205440600佛山市440000 206440700江门市440000 207440800湛江市440000 208440900茂名市440000 209441200肇庆市440000 210441300惠州市440000 211441400梅州市440000 212441500汕尾市440000 213441600河源市440000 214441700阳江市440000 215441800清远市440000 216441900东莞市440000 217442000中山市440000 218445100潮州市440000 219445200揭阳市440000 220445300云浮市440000 221450100南宁市450000 222450200柳州市450000 223450300桂林市450000 224450400梧州市450000 225450500北海市450000 226450600防城港市450000 227450700钦州市450000 228450800贵港市450000 229450900玉林市450000 230451000百色市450000 231451100贺州市450000 232451200河池市450000 233451300来宾市450000 234451400崇左市450000 235460100海口市460000 236460200三亚市460000460000 237469000省直辖县级行238500100市辖区500000 239500200县500000 240500300市500000 241510100成都市510000 242510300自贡市510000 243510400攀枝花市510000 244510500泸州市510000 245510600德阳市510000 246510700绵阳市510000 247510800广元市510000 248510900遂宁市510000 249511000内江市510000 250511100乐山市510000 251511300南充市510000 252511400眉山市510000 253511500宜宾市510000 254511600广安市510000257511900巴中市510000 258512000资阳市510000510000 259513200阿坝藏族羌族510000 260513300甘孜藏族自治510000 261513400凉山彝族自治262520100贵阳市520000 263520200六盘水市520000 264520300遵义市520000 265520400安顺市520000 266522200铜仁地区520000 267522300黔西南布依族520000 268522400毕节地区520000520000 269522600黔东南苗族侗270522700黔南布依族苗520000 271530100昆明市530000 272530300曲靖市530000 273530400玉溪市530000 274530500保山市530000 275530600昭通市530000 276530700丽江市530000 277530800思茅市530000 278530900临沧市530000530000 279532300楚雄彝族自治530000 280532500红河哈尼族彝530000 281532600文山壮族苗族530000 282532800西双版纳傣族530000 283532900大理白族自治530000 284533100德宏傣族景颇530000 285533300怒江傈僳族自530000 286533400迪庆藏族自治287540100拉萨市540000 288542100昌都地区540000 289542200山南地区540000 290542300日喀则地区540000 291542400那曲地区540000 292542500阿里地区540000 293542600林芝地区540000 294610100西安市610000 295610200铜川市610000 296610300宝鸡市610000 297610400咸阳市610000 298610500渭南市610000 299610600延安市610000 300610700汉中市610000 301610800榆林市610000 302610900安康市610000 303611000商洛市610000 304620100兰州市620000 305620200嘉峪关市620000 306620300金昌市620000 307620400白银市620000 308620500天水市620000 309620600武威市620000 310620700张掖市620000 311620800平凉市620000 312620900酒泉市620000 313621000庆阳市620000316622900临夏回族自治620000620000 317623000甘南藏族自治318630100西宁市630000319632100海东地区630000630000 320632200海北藏族自治630000 321632300黄南藏族自治630000 322632500海南藏族自治630000 323632600果洛藏族自治630000 324632700玉树藏族自治630000 325632800海西蒙古族藏326640100银川市640000327640200石嘴山市640000328640300吴忠市640000329640400固原市640000330640500中卫市640000331650100乌鲁木齐市650000332650200克拉玛依市650000333652100吐鲁番地区650000334652200哈密地区650000650000 335652300昌吉回族自治650000 336652700博尔塔拉蒙古650000 337652800巴音郭楞蒙古338652900阿克苏地区650000339653000克孜勒苏柯尔650000 340653100喀什地区650000341653200和田地区650000342654000伊犁哈萨克自650000 343654200塔城地区650000344654300阿勒泰地区650000345659000省直辖行政单650000县1110101东城区1101002110102西城区1101003110103崇文区1101004110104宣武区1101005110105朝阳区1101006110106丰台区1101007110107石景山区1101008110108海淀区1101009110109门头沟区11010010110111房山区11010011110112通州区11010012110113顺义区11010013110114昌平区11010014110115大兴区11010015110116怀柔区11010016110117平谷区11010017110228密云县11020018110229延庆县11020019120101和平区12010020120102河东区12010021120103河西区12010022120104南开区12010025120107塘沽区120100 26120108汉沽区120100 27120109大港区120100 28120110东丽区120100 29120111西青区120100 30120112津南区120100 31120113北辰区120100 32120114武清区120100 33120115宝坻区120100 34120221宁河县120200 35120223静海县120200 36120225蓟 县120200 37130101市辖区130100 38130102长安区130100 39130103桥东区130100 40130104桥西区130100 41130105新华区130100 42130107井陉矿区130100 43130108裕华区130100 44130121井陉县130100 45130123正定县130100 46130124栾城县130100 47130125行唐县130100 48130126灵寿县130100 49130127高邑县130100 50130128深泽县130100 51130129赞皇县130100 52130130无极县130100 53130131平山县130100 54130132元氏县130100 55130133赵 县130100 56130181辛集市130100 57130182藁城市130100 58130183晋州市130100 59130184新乐市130100 60130185鹿泉市130100 61130201市辖区130200 62130202路南区130200 63130203路北区130200 64130204古冶区130200 65130205开平区130200 66130207丰南区130200 67130208丰润区130200 68130223滦 县130200 69130224滦南县130200 70130225乐亭县130200 71130227迁西县130200 72130229玉田县130200 73130230唐海县130200 74130281遵化市130200 75130283迁安市130200 76130301市辖区130300 77130302海港区130300 78130303山海关区130300 79130304北戴河区130300 80130321青龙满族自治130300 81130322昌黎县13030084130401市辖区130400 85130402邯山区130400 86130403丛台区130400 87130404复兴区130400 88130406峰峰矿区130400 89130421邯郸县130400 90130423临漳县130400 91130424成安县130400 92130425大名县130400 93130426涉 县130400 94130427磁 县130400 95130428肥乡县130400 96130429永年县130400 97130430邱 县130400 98130431鸡泽县130400 99130432广平县130400 100130433馆陶县130400 101130434魏 县130400 102130435曲周县130400 103130481武安市130400 104130501市辖区130500 105130502桥东区130500 106130503桥西区130500 107130521邢台县130500 108130522临城县130500 109130523内丘县130500 110130524柏乡县130500 111130525隆尧县130500 112130526任 县130500 113130527南和县130500 114130528宁晋县130500 115130529巨鹿县130500 116130530新河县130500 117130531广宗县130500 118130532平乡县130500 119130533威 县130500 120130534清河县130500 121130535临西县130500 122130581南宫市130500 123130582沙河市130500 124130601市辖区130600 125130602新市区130600 126130603北市区130600 127130604南市区130600 128130621满城县130600 129130622清苑县130600 130130623涞水县130600 131130624阜平县130600 132130625徐水县130600 133130626定兴县130600 134130627唐 县130600 135130628高阳县130600 136130629容城县130600 137130630涞源县130600 138130631望都县130600 139130632安新县130600 140130633易 县130600143130636顺平县130600 144130637博野县130600 145130638雄 县130600 146130681涿州市130600 147130682定州市130600 148130683安国市130600 149130684高碑店市130600 150130701市辖区130700 151130702桥东区130700 152130703桥西区130700 153130705宣化区130700 154130706下花园区130700 155130721宣化县130700 156130722张北县130700 157130723康保县130700 158130724沽源县130700 159130725尚义县130700 160130726蔚 县130700 161130727阳原县130700 162130728怀安县130700 163130729万全县130700 164130730怀来县130700 165130731涿鹿县130700 166130732赤城县130700 167130733崇礼县130700 168130801市辖区130800 169130802双桥区130800 170130803双滦区130800130800 171130804鹰手营子矿区172130821承德县130800 173130822兴隆县130800 174130823平泉县130800 175130824滦平县130800 176130825隆化县130800130800 177130826丰宁满族自治130800 178130827宽城满族自治130800 179130828围场满族蒙古180130901市辖区130900 181130902新华区130900 182130903运河区130900 183130921沧 县130900 184130922青 县130900 185130923东光县130900 186130924海兴县130900 187130925盐山县130900 188130926肃宁县130900 189130927南皮县130900 190130928吴桥县130900 191130929献 县130900130900 192130930孟村回族自治193130981泊头市130900 194130982任丘市130900 195130983黄骅市130900 196130984河间市130900 197131001市辖区131000 198131002安次区131000 199131003广阳区131000202131024香河县131000 203131025大城县131000 204131026文安县131000 205131028大厂回族自治131000 206131081霸州市131000 207131082三河市131000 208131101市辖区131100 209131102桃城区131100 210131121枣强县131100 211131122武邑县131100 212131123武强县131100 213131124饶阳县131100 214131125安平县131100 215131126故城县131100 216131127景 县131100 217131128阜城县131100 218131181冀州市131100 219131182深州市131100 220140101市辖区140100 221140105小店区140100 222140106迎泽区140100 223140107杏花岭区140100 224140108尖草坪区140100 225140109万柏林区140100 226140110晋源区140100 227140121清徐县140100 228140122阳曲县140100 229140123娄烦县140100 230140181古交市140100 231140201市辖区140200 232140202城 区140200 233140203矿 区140200 234140211南郊区140200 235140212新荣区140200 236140221阳高县140200 237140222天镇县140200 238140223广灵县140200 239140224灵丘县140200 240140225浑源县140200 241140226左云县140200 242140227大同县140200 243140301市辖区140300 244140302城 区140300 245140303矿 区140300 246140311郊 区140300 247140321平定县140300 248140322盂 县140300 249140401市辖区140400 250140402城 区140400 251140411郊 区140400 252140421长治县140400 253140423襄垣县140400 254140424屯留县140400 255140425平顺县140400 256140426黎城县140400 257140427壶关县140400 258140428长子县140400 259140429武乡县140400262140481潞城市140400 263140501市辖区140500 264140502城 区140500 265140521沁水县140500 266140522阳城县140500 267140524陵川县140500 268140525泽州县140500 269140581高平市140500 270140601市辖区140600 271140602朔城区140600 272140603平鲁区140600 273140621山阴县140600 274140622应 县140600 275140623右玉县140600 276140624怀仁县140600 277140701市辖区140700 278140702榆次区140700 279140721榆社县140700 280140722左权县140700 281140723和顺县140700 282140724昔阳县140700 283140725寿阳县140700 284140726太谷县140700 285140727祁 县140700 286140728平遥县140700 287140729灵石县140700 288140781介休市140700 289140801市辖区140800 290140802盐湖区140800 291140821临猗县140800 292140822万荣县140800 293140823闻喜县140800 294140824稷山县140800 295140825新绛县140800 296140826绛 县140800 297140827垣曲县140800 298140828夏 县140800 299140829平陆县140800 300140830芮城县140800 301140881永济市140800 302140882河津市140800 303140901市辖区140900 304140902忻府区140900 305140921定襄县140900 306140922五台县140900 307140923代 县140900 308140924繁峙县140900 309140925宁武县140900 310140926静乐县140900 311140927神池县140900 312140928五寨县140900 313140929岢岚县140900 314140930河曲县140900 315140931保德县140900 316140932偏关县140900 317140981原平市140900 318141001市辖区141000321141022翼城县141000 322141023襄汾县141000 323141024洪洞县141000 324141025古 县141000 325141026安泽县141000 326141027浮山县141000 327141028吉 县141000 328141029乡宁县141000 329141030大宁县141000 330141031隰 县141000 331141032永和县141000 332141033蒲 县141000 333141034汾西县141000 334141081侯马市141000 335141082霍州市141000 336141101市辖区141100 337141102离石区141100 338141121文水县141100 339141122交城县141100 340141123兴 县141100 341141124临 县141100 342141125柳林县141100 343141126石楼县141100 344141127岚 县141100 345141128方山县141100 346141129中阳县141100 347141130交口县141100 348141181孝义市141100 349141182汾阳市141100 350150101市辖区150100 351150102新城区150100 352150103回民区150100 353150104玉泉区150100 354150105赛罕区150100 355150121土默特左旗150100 356150122托克托县150100 357150123和林格尔县150100 358150124清水河县150100 359150125武川县150100 360150201市辖区150200 361150202东河区150200 362150203昆都仑区150200 363150204青山区150200 364150205石拐区150200 365150206白云矿区150200 366150207九原区150200 367150221土默特右旗150200 368150222固阳县150200150200 369150223达尔罕茂明安370150301市辖区150300 371150302海勃湾区150300 372150303海南区150300 373150304乌达区150300 374150401市辖区150400 375150402红山区150400 376150403元宝山区150400 377150404松山区150400379150422巴林左旗150400 380150423巴林右旗150400 381150424林西县150400 382150425克什克腾旗150400 383150426翁牛特旗150400 384150428喀喇沁旗150400 385150429宁城县150400 386150430敖汉旗150400 387150501市辖区150500 388150502科尔沁区150500150500 389150521科尔沁左翼中150500 390150522科尔沁左翼后391150523开鲁县150500 392150524库伦旗150500 393150525奈曼旗150500 394150526扎鲁特旗150500 395150581霍林郭勒市150500 396150602东胜区150600 397150621达拉特旗150600 398150622准格尔旗150600 399150623鄂托克前旗150600 400150624鄂托克旗150600 401150625杭锦旗150600 402150626乌审旗150600 403150627伊金霍洛旗150600 404150701市辖区150700 405150702海拉尔区150700 406150721阿荣旗150700150700 407150722莫力达瓦达斡150700 408150723鄂伦春自治旗150700 409150724鄂温克族自治410150725陈巴尔虎旗150700 411150726新巴尔虎左旗150700150700 412150727新巴尔虎右旗413150781满洲里市150700 414150782牙克石市150700 415150783扎兰屯市150700 416150784额尔古纳市150700 417150785根河市150700 418150801市辖区150800 419150802临河区150800 420150821五原县150800 421150822磴口县150800 422150823乌拉特前旗150800 423150824乌拉特中旗150800 424150825乌拉特后旗150800 425150826杭锦后旗150800 426150901市辖区150900 427150902集宁区150900 428150921卓资县150900 429150922化德县150900 430150923商都县150900 431150924兴和县150900 432150925凉城县150900150900 433150926察哈尔右翼前150900 434150927察哈尔右翼中435150928察哈尔右翼后150900 436150929四子王旗150900438152201乌兰浩特市152200 439152202阿尔山市152200152200 440152221科尔沁右翼前152200 441152222科尔沁右翼中442152223扎赉特旗152200 443152224突泉县152200 444152501二连浩特市152500 445152502锡林浩特市152500 446152522阿巴嘎旗152500 447152523苏尼特左旗152500 448152524苏尼特右旗152500152500 449152525东乌珠穆沁旗152500 450152526西乌珠穆沁旗451152527太仆寺旗152500 452152528镶黄旗152500 453152529正镶白旗152500 454152530正蓝旗152500 455152531多伦县152500 456152921阿拉善左旗152900 457152922阿拉善右旗152900 458152923额济纳旗152900 459210101市辖区210100 460210102和平区210100 461210103沈河区210100 462210104大东区210100 463210105皇姑区210100 464210106铁西区210100 465210111苏家屯区210100 466210112东陵区210100 467210113新城子区210100 468210114于洪区210100 469210122辽中县210100 470210123康平县210100 471210124法库县210100 472210181新民市210100 473210201市辖区210200 474210202中山区210200 475210203西岗区210200 476210204沙河口区210200 477210211甘井子区210200 478210212旅顺口区210200 479210213金州区210200 480210224长海县210200 481210281瓦房店市210200 482210282普兰店市210200 483210283庄河市210200 484210301市辖区210300 485210302铁东区210300 486210303铁西区210300 487210304立山区210300 488210311千山区210300 489210321台安县210300 490210323岫岩满族自治210300 491210381海城市210300 492210401市辖区210400 493210402新抚区210400 494210403东洲区210400 495210404望花区210400497210421抚顺县210400210400 498210422新宾满族自治210400 499210423清原满族自治500210501市辖区210500 501210502平山区210500 502210503溪湖区210500 503210504明山区210500 504210505南芬区210500210500 505210521本溪满族自治210500 506210522桓仁满族自治507210601市辖区210600 508210602元宝区210600 509210603振兴区210600 510210604振安区210600210600 511210624宽甸满族自治512210681东港市210600 513210682凤城市210600 514210701市辖区210700 515210702古塔区210700 516210703凌河区210700 517210711太和区210700 518210726黑山县210700 519210727义 县210700 520210781凌海市210700 521210782北宁市210700 522210801市辖区210800 523210802站前区210800 524210803西市区210800 525210804鲅鱼圈区210800 526210811老边区210800 527210881盖州市210800 528210882大石桥市210800 529210901市辖区210900 530210902海州区210900 531210903新邱区210900 532210904太平区210900 533210905清河门区210900 534210911细河区210900210900 535210921阜新蒙古族自536210922彰武县210900 537211001市辖区211000 538211002白塔区211000 539211003文圣区211000 540211004宏伟区211000 541211005弓长岭区211000 542211011太子河区211000 543211021辽阳县211000 544211081灯塔市211000 545211101市辖区211100 546211102双台子区211100 547211103兴隆台区211100 548211121大洼县211100 549211122盘山县211100 550211201市辖区211200 551211202银州区211200 552211204清河区211200 553211221铁岭县211200 554211223西丰县211200556211281调兵山市211200 557211282开原市211200 558211301市辖区211300 559211302双塔区211300 560211303龙城区211300 561211321朝阳县211300 562211322建平县211300 563211324喀喇沁左翼蒙211300 564211381北票市211300 565211382凌源市211300 566211401市辖区211400 567211402连山区211400 568211403龙港区211400 569211404南票区211400 570211421绥中县211400 571211422建昌县211400 572211481兴城市211400 573220101市辖区220100 574220102南关区220100 575220103宽城区220100 576220104朝阳区220100 577220105二道区220100 578220106绿园区220100 579220112双阳区220100 580220122农安县220100 581220181九台市220100 582220182榆树市220100 583220183德惠市220100 584220201市辖区220200 585220202昌邑区220200 586220203龙潭区220200 587220204船营区220200 588220211丰满区220200 589220221永吉县220200 590220281蛟河市220200 591220282桦甸市220200 592220283舒兰市220200 593220284磐石市220200 594220301市辖区220300 595220302铁西区220300 596220303铁东区220300 597220322梨树县220300220300 598220323伊通满族自治599220381公主岭市220300 600220382双辽市220300 601220401市辖区220400 602220402龙山区220400 603220403西安区220400 604220421东丰县220400 605220422东辽县220400 606220501市辖区220500 607220502东昌区220500 608220503二道江区220500 609220521通化县220500 610220523辉南县220500 611220524柳河县220500 612220581梅河口市220500 613220582集安市220500615220602八道江区220600 616220621抚松县220600 617220622靖宇县220600 618220623长白朝鲜族自220600 619220625江源县220600 620220681临江市220600 621220701市辖区220700 622220702宁江区220700220700 623220721前郭尔罗斯蒙624220722长岭县220700 625220723乾安县220700 626220724扶余县220700 627220801市辖区220800 628220802洮北区220800 629220821镇赉县220800 630220822通榆县220800 631220881洮南市220800 632220882大安市220800 633222401延吉市222400 634222402图们市222400 635222403敦化市222400 636222404珲春市222400 637222405龙井市222400 638222406和龙市222400 639222424汪清县222400 640222426安图县222400 641230101市辖区230100 642230102道里区230100 643230103南岗区230100 644230104道外区230100 645230106香坊区230100 646230107动力区230100 647230108平房区230100 648230109松北区230100 649230111呼兰区230100 650230123依兰县230100 651230124方正县230100 652230125宾 县230100 653230126巴彦县230100 654230127木兰县230100 655230128通河县230100 656230129延寿县230100 657230181阿城市230100 658230182双城市230100 659230183尚志市230100 660230184五常市230100 661230201市辖区230200 662230202龙沙区230200 663230203建华区230200 664230204铁锋区230200 665230205昂昂溪区230200 666230206富拉尔基区230200 667230207碾子山区230200230200 668230208梅里斯达斡尔669230221龙江县230200 670230223依安县230200 671230224泰来县230200 672230225甘南县230200674230229克山县230200 675230230克东县230200 676230231拜泉县230200 677230281讷河市230200 678230301市辖区230300 679230302鸡冠区230300 680230303恒山区230300 681230304滴道区230300 682230305梨树区230300 683230306城子河区230300 684230307麻山区230300 685230321鸡东县230300 686230381虎林市230300 687230382密山市230300 688230401市辖区230400 689230402向阳区230400 690230403工农区230400 691230404南山区230400 692230405兴安区230400 693230406东山区230400 694230407兴山区230400 695230421萝北县230400 696230422绥滨县230400 697230501市辖区230500 698230502尖山区230500 699230503岭东区230500 700230505四方台区230500 701230506宝山区230500 702230521集贤县230500 703230522友谊县230500 704230523宝清县230500 705230524饶河县230500 706230601市辖区230600 707230602萨尔图区230600 708230603龙凤区230600 709230604让胡路区230600 710230605红岗区230600 711230606大同区230600 712230621肇州县230600 713230622肇源县230600 714230623林甸县230600 715230624杜尔伯特蒙古230600 716230701市辖区230700 717230702伊春区230700 718230703南岔区230700 719230704友好区230700 720230705西林区230700 721230706翠峦区230700 722230707新青区230700 723230708美溪区230700 724230709金山屯区230700 725230710五营区230700 726230711乌马河区230700 727230712汤旺河区230700 728230713带岭区230700 729230714乌伊岭区230700 730230715红星区230700 731230716上甘岭区230700733230781铁力市230700 734230801市辖区230800 735230802永红区230800 736230803向阳区230800 737230804前进区230800 738230805东风区230800 739230811郊 区230800 740230822桦南县230800 741230826桦川县230800 742230828汤原县230800 743230833抚远县230800 744230881同江市230800 745230882富锦市230800 746230901市辖区230900 747230902新兴区230900 748230903桃山区230900 749230904茄子河区230900 750230921勃利县230900 751231001市辖区231000 752231002东安区231000 753231003阳明区231000 754231004爱民区231000 755231005西安区231000 756231024东宁县231000 757231025林口县231000 758231081绥芬河市231000 759231083海林市231000 760231084宁安市231000 761231085穆棱市231000 762231101市辖区231100 763231102爱辉区231100 764231121嫩江县231100 765231123逊克县231100 766231124孙吴县231100 767231181北安市231100 768231182五大连池市231100 769231201市辖区231200 770231202北林区231200 771231221望奎县231200 772231222兰西县231200 773231223青冈县231200 774231224庆安县231200 775231225明水县231200 776231226绥棱县231200 777231281安达市231200 778231282肇东市231200 779231283海伦市231200 780232721呼玛县232700 781232722塔河县232700 782232723漠河县232700 783310101黄浦区310100 784310103卢湾区310100 785310104徐汇区310100 786310105长宁区310100 787310106静安区310100 788310107普陀区310100 789310108闸北区310100 790310109虹口区310100792310112闵行区310100 793310113宝山区310100 794310114嘉定区310100 795310115浦东新区310100 796310116金山区310100 797310117松江区310100 798310118青浦区310100 799310119南汇区310100 800310120奉贤区310100 801310230崇明县310200 802320101市辖区320100 803320102玄武区320100 804320103白下区320100 805320104秦淮区320100 806320105建邺区320100 807320106鼓楼区320100 808320107下关区320100 809320111浦口区320100 810320113栖霞区320100 811320114雨花台区320100 812320115江宁区320100 813320116六合区320100 814320124溧水县320100 815320125高淳县320100 816320201市辖区320200 817320202崇安区320200 818320203南长区320200 819320204北塘区320200 820320205锡山区320200 821320206惠山区320200 822320211滨湖区320200 823320281江阴市320200 824320282宜兴市320200 825320301市辖区320300 826320302鼓楼区320300 827320303云龙区320300 828320304九里区320300 829320305贾汪区320300 830320311泉山区320300 831320321丰 县320300 832320322沛 县320300 833320323铜山县320300 834320324睢宁县320300 835320381新沂市320300 836320382邳州市320300 837320401市辖区320400 838320402天宁区320400 839320404钟楼区320400 840320405戚墅堰区320400 841320411新北区320400 842320412武进区320400 843320481溧阳市320400 844320482金坛市320400 845320501市辖区320500 846320502沧浪区320500 847320503平江区320500 848320504金阊区320500 849320505虎丘区320500 850320506吴中区320500851320507相城区320500 852320581常熟市320500 853320582张家港市320500 854320583昆山市320500 855320584吴江市320500 856320585太仓市320500 857320601市辖区320600 858320602崇川区320600 859320611港闸区320600 860320621海安县320600 861320623如东县320600 862320681启东市320600 863320682如皋市320600 864320683通州市320600 865320684海门市320600 866320701市辖区320700 867320703连云区320700 868320705新浦区320700 869320706海州区320700 870320721赣榆县320700 871320722东海县320700 872320723灌云县320700 873320724灌南县320700 874320801市辖区320800 875320802清河区320800 876320803楚州区320800 877320804淮阴区320800 878320811清浦区320800 879320826涟水县320800 880320829洪泽县320800 881320830盱眙县320800 882320831金湖县320800 883320901市辖区320900 884320902亭湖区320900 885320903盐都区320900 886320921响水县320900 887320922滨海县320900 888320923阜宁县320900 889320924射阳县320900 890320925建湖县320900 891320981东台市320900 892320982大丰市320900 893321001市辖区321000 894321002广陵区321000 895321003邗江区321000 896321011郊 区321000 897321023宝应县321000 898321081仪征市321000 899321084高邮市321000 900321088江都市321000 901321101市辖区321100 902321102京口区321100 903321111润州区321100 904321112丹徒区321100 905321181丹阳市321100 906321182扬中市321100 907321183句容市321100 908321201市辖区321200 909321202海陵区321200910321203高港区321200 911321281兴化市321200 912321282靖江市321200 913321283泰兴市321200 914321284姜堰市321200 915321301市辖区321300 916321302宿城区321300 917321311宿豫区321300 918321322沭阳县321300 919321323泗阳县321300 920321324泗洪县321300 921330101市辖区330100 922330102上城区330100 923330103下城区330100 924330104江干区330100 925330105拱墅区330100 926330106西湖区330100 927330108滨江区330100 928330109萧山区330100 929330110余杭区330100 930330122桐庐县330100 931330127淳安县330100 932330182建德市330100 933330183富阳市330100 934330185临安市330100 935330201市辖区330200 936330203海曙区330200 937330204江东区330200 938330205江北区330200 939330206北仑区330200 940330211镇海区330200 941330212鄞州区330200 942330225象山县330200 943330226宁海县330200 944330281余姚市330200 945330282慈溪市330200 946330283奉化市330200 947330301市辖区330300 948330302鹿城区330300 949330303龙湾区330300 950330304瓯海区330300 951330322洞头县330300 952330324永嘉县330300 953330326平阳县330300 954330327苍南县330300 955330328文成县330300 956330329泰顺县330300 957330381瑞安市330300 958330382乐清市330300 959330401市辖区330400 960330402秀城区330400 961330411秀洲区330400 962330421嘉善县330400 963330424海盐县330400 964330481海宁市330400 965330482平湖市330400 966330483桐乡市330400 967330501市辖区330500 968330502吴兴区330500969330503南浔区330500 970330521德清县330500 971330522长兴县330500 972330523安吉县330500 973330601市辖区330600 974330602越城区330600 975330621绍兴县330600 976330624新昌县330600 977330681诸暨市330600 978330682上虞市330600 979330683嵊州市330600 980330701市辖区330700 981330702婺城区330700 982330703金东区330700 983330723武义县330700 984330726浦江县330700 985330727磐安县330700 986330781兰溪市330700 987330782义乌市330700 988330783东阳市330700 989330784永康市330700 990330801市辖区330800 991330802柯城区330800 992330803衢江区330800 993330822常山县330800 994330824开化县330800 995330825龙游县330800 996330881江山市330800 997330901市辖区330900 998330902定海区330900 999330903普陀区330900 1000330921岱山县330900 1001330922嵊泗县330900 1002331001市辖区331000 1003331002椒江区331000 1004331003黄岩区331000 1005331004路桥区331000 1006331021玉环县331000 1007331022三门县331000 1008331023天台县331000 1009331024仙居县331000 1010331081温岭市331000 1011331082临海市331000 1012331101市辖区331100 1013331102莲都区331100 1014331121青田县331100 1015331122缙云县331100 1016331123遂昌县331100 1017331124松阳县331100 1018331125云和县331100 1019331126庆元县331100331100 1020331127景宁畲族自治1021331181龙泉市331100 1022340101市辖区340100 1023340102瑶海区340100 1024340103庐阳区340100 1025340104蜀山区340100 1026340111包河区340100 1027340121长丰县3401001028340122肥东县340100 1029340123肥西县340100 1030340201市辖区340200 1031340202镜湖区340200 1032340203马塘区340200 1033340204新芜区340200 1034340207鸠江区340200 1035340221芜湖县340200 1036340222繁昌县340200 1037340223南陵县340200 1038340301市辖区340300 1039340302龙子湖区340300 1040340303蚌山区340300 1041340304禹会区340300 1042340311淮上区340300 1043340321怀远县340300 1044340322五河县340300 1045340323固镇县340300 1046340401市辖区340400 1047340402大通区340400 1048340403田家庵区340400 1049340404谢家集区340400 1050340405八公山区340400 1051340406潘集区340400 1052340421凤台县340400 1053340501市辖区340500 1054340502金家庄区340500 1055340503花山区340500 1056340504雨山区340500 1057340521当涂县340500 1058340601市辖区340600 1059340602杜集区340600 1060340603相山区340600 1061340604烈山区340600 1062340621濉溪县340600 1063340701市辖区340700 1064340702铜官山区340700 1065340703狮子山区340700 1066340711郊 区340700 1067340721铜陵县340700 1068340801市辖区340800 1069340802迎江区340800 1070340803大观区340800 1071340811郊 区340800 1072340822怀宁县340800 1073340823枞阳县340800 1074340824潜山县340800 1075340825太湖县340800 1076340826宿松县340800 1077340827望江县340800 1078340828岳西县340800 1079340881桐城市340800 1080341001市辖区341000 1081341002屯溪区341000 1082341003黄山区341000 1083341004徽州区341000 1084341021歙 县341000 1085341022休宁县341000 1086341023黟 县3410001087341024祁门县341000 1088341101市辖区341100 1089341102琅琊区341100 1090341103南谯区341100 1091341122来安县341100 1092341124全椒县341100 1093341125定远县341100 1094341126凤阳县341100 1095341181天长市341100 1096341182明光市341100 1097341201市辖区341200 1098341202颍州区341200 1099341203颍东区341200 1100341204颍泉区341200 1101341221临泉县341200 1102341222太和县341200 1103341225阜南县341200 1104341226颍上县341200 1105341282界首市341200 1106341301市辖区341300 1107341302墉桥区341300 1108341321砀山县341300 1109341322萧 县341300 1110341323灵璧县341300 1111341324泗 县341300 1112341401市辖区341400 1113341402居巢区341400 1114341421庐江县341400 1115341422无为县341400 1116341423含山县341400 1117341424和 县341400 1118341501市辖区341500 1119341502金安区341500 1120341503裕安区341500 1121341521寿 县341500 1122341522霍邱县341500 1123341523舒城县341500 1124341524金寨县341500 1125341525霍山县341500 1126341601市辖区341600 1127341602谯城区341600 1128341621涡阳县341600 1129341622蒙城县341600 1130341623利辛县341600 1131341701市辖区341700 1132341702贵池区341700 1133341721东至县341700 1134341722石台县341700 1135341723青阳县341700 1136341801市辖区341800 1137341802宣州区341800 1138341821郎溪县341800 1139341822广德县341800 1140341823泾 县341800 1141341824绩溪县341800 1142341825旌德县341800 1143341881宁国市341800 1144350101市辖区350100 1145350102鼓楼区350100。
省市区三级联动数据库代码(国家统计局最新代码、包含整理步骤)
省市区三级联动数据库代码(国家统计局最新代码、包含整理步骤)最终整理后的成果图。
最近项⽬要⽤到省市区地址三级联动。
原有的数据是⽼版本的。
在⽹上找了找,发现很多,也很杂。
最终决定⾃⼰整理⼀份,就当练⼿了。
看到的数据只有代码和名称两列数据如:110000 北京市110100 市辖区110101 东城区去空格整理后复制到excel 表中供导⼊数据库1、⾸先要把地址分出 1 、2 、3 级代表省、市、区。
那么问题来了。
原先想依据名称列的缩进来进⾏区分,但是想想有点复杂,⽽且容易出错。
后来⽤地区的编码规律来区分编码为 6 个字符组成例如:110101⾸先把表结构建起来吧。
从Excel表导⼊数据吧,这个就不说咯现在开始了!如果后4位为"0000" ---------------------是省级 1UPDATE[region]SET level=1WHERE SUBSTRING(code,3,6) ='0000'GO如果后2位为"00" 和等级level 不等于1----------是市级 2UPDATE[Test].[dbo].[region]SET[level]=2WHERE SUBSTRING(code,5,6) ='00'and ([level]<>1 ro [level] is null)GO备注:什么?执⾏了没效果?先把 level 字段赋值为 0 吧。
UPDATE [region]SET level = 0WHERE level is nullGO其他的 -----------------------------------是区级 3UPDATE[region]SET level=3WHERE level = 0GO2、现在我们来把⽗ID 整理出来也是依靠地址编码看代码就懂了啦省级UPDATE[region]SET parent_id =0WHERE level=1GO市级UPDATE aSET a.[parent_id]= b.[id]from[region] a,[region] bWHERE SUBSTRING(a.[code],1,2) =SUBSTRING(b.[code],1,2) and a.[level]=2and b.[level]=1GO区级UPDATE aSET a.[parent_id]= b.[id]from[region] a,[region] bWHERE SUBSTRING(a.[code],1,4) =SUBSTRING(b.[code],1,4) and a.[level]=3and b.[level]=2GO3、整理地区全称(这个字段有必要整理出来,原因嘛,选择联动地区获得省市区地址名称的时候会有意外的惊喜!例如:北京市市辖区XXX区,北京市县XXX县虽然没错但是影响美观)直接上代码:UPDATE[region]SET text_full =textWHERE id = id and level=1GOUPDATE aSET a.text_full = b.text_full + a.text from[region] a,[region] bWHERE a.parent_id = b.id and a.[level]=2and b.[level]=1GOUPDATE aSET a.text_full = b.text_full + a.text_full from[region] a,[region] bWHERE a.parent_id = b.id and a.[level]=3and b.[level]=2GO现在好了,看下检查下数据。
省市县三级联动的SQL语句
这篇文章主要介绍了省市县三级联动的SQL语句,包括建表及插入数据,需要的朋友可以参考下首先是建表语句代码如下:CREATE TABLE `t_address_province` (`id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',`code` CHAR(6) NOT NULL COMMENT '省份编码',`name` VARCHAR(40) NOT NULL COMMENT '省份名称') ENGINE=InnoDB DEFAULT CHARSET=UTF8 COMMENT='省份信息表';CREATE TABLE `t_address_city` (`id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',`code` CHAR(6) NOT NULL COMMENT '城市编码',`name` VARCHAR(40) NOT NULL COMMENT '城市名称',`provinceCode` CHAR(6) NOT NULL COMMENT '所属省份编码') ENGINE=InnoDB DEFAULT CHARSET=UTF8 COMMENT='城市信息表';CREATE TABLE `t_address_town` (`id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',`code` CHAR(6) NOT NULL COMMENT '区县编码',`name` VARCHAR(40) NOT NULL COMMENT '区县名称',`cityCode` CHAR(6) NOT NULL COMMENT '所属城市编码') ENGINE=InnoDB DEFAULT CHARSET=UTF8 COMMENT='区县信息表';然后是省份信息表数据代码如下:INSERT INTO `t_address_province` V ALUES ('1', '110000', '北京市');INSERT INTO `t_address_province` V ALUES ('2', '120000', '天津市');INSERT INTO `t_address_province` V ALUES ('3', '130000', '河北省');INSERT INTO `t_address_province` V ALUES ('4', '140000', '山西省');INSERT INTO `t_address_province` V ALUES ('5', '150000', '内蒙古自治区');INSERT INTO `t_address_province` V ALUES ('6', '210000', '辽宁省');INSERT INTO `t_address_province` V ALUES ('7', '220000', '吉林省');INSERT INTO `t_address_province` V ALUES ('8', '230000', '黑龙江省');INSERT INTO `t_address_province` V ALUES ('9', '310000', '上海市');INSERT INTO `t_address_province` V ALUES ('10', '320000', '江苏省');INSERT INTO `t_address_province` V ALUES ('11', '330000', '浙江省');INSERT INTO `t_address_province` V ALUES ('12', '340000', '安徽省');INSERT INTO `t_address_province` V ALUES ('13', '350000', '福建省');INSERT INTO `t_address_province` V ALUES ('14', '360000', '江西省');INSERT INTO `t_address_province` V ALUES ('15', '370000', '山东省');INSERT INTO `t_address_province` V ALUES ('16', '410000', '河南省');INSERT INTO `t_address_province` V ALUES ('17', '420000', '湖北省');INSERT INTO `t_address_province` V ALUES ('18', '430000', '湖南省');INSERT INTO `t_address_province` V ALUES ('19', '440000', '广东省');INSERT INTO `t_address_province` V ALUES ('20', '450000', '广西壮族自治区'); INSERT INTO `t_address_province` V ALUES ('21', '460000', '海南省');INSERT INTO `t_address_province` V ALUES ('22', '500000', '重庆市');INSERT INTO `t_address_province` V ALUES ('23', '510000', '四川省');INSERT INTO `t_address_province` V ALUES ('24', '520000', '贵州省');INSERT INTO `t_address_province` V ALUES ('25', '530000', '云南省');INSERT INTO `t_address_province` V ALUES ('26', '540000', '西藏自治区'); INSERT INTO `t_address_province` V ALUES ('27', '610000', '陕西省');INSERT INTO `t_address_province` V ALUES ('28', '620000', '甘肃省');INSERT INTO `t_address_province` V ALUES ('29', '630000', '青海省');INSERT INTO `t_address_province` V ALUES ('30', '640000', '宁夏回族自治区'); INSERT INTO `t_address_province` V ALUES ('31', '650000', '新疆维吾尔自治区'); INSERT INTO `t_address_province` V ALUES ('32', '710000', '台湾省');INSERT INTO `t_address_province` V ALUES ('33', '810000', '香港特别行政区'); INSERT INTO `t_address_province` V ALUES ('34', '820000', '澳门特别行政区'); 下面是城市信息表数据代码如下:INSERT INTO `t_address_city` V ALUES ('1', '110100', '北京市', '110000'); INSERT INTO `t_address_city` V ALUES ('2', '1102xx', '北京下属县', '1100xx'); INSERT INTO `t_address_city` V ALUES ('3', '120100', '天津市', '120000'); INSERT INTO `t_address_city` V ALUES ('4', '1202xx', '天津下属县', '1200xx'); INSERT INTO `t_address_city` V ALUES ('5', '130100', '石家庄市', '130000'); INSERT INTO `t_address_city` V ALUES ('6', '130200', '唐山市', '130000'); INSERT INTO `t_address_city` V ALUES ('7', '130300', '秦皇岛市', '130000'); INSERT INTO `t_address_city` V ALUES ('8', '130400', '邯郸市', '130000'); INSERT INTO `t_address_city` V ALUES ('9', '130500', '邢台市', '130000'); INSERT INTO `t_address_city` V ALUES ('10', '130600', '保定市', '130000'); INSERT INTO `t_address_city` V ALUES ('11', '130700', '张家口市', '130000'); INSERT INTO `t_address_city` V ALUES ('12', '130800', '承德市', '130000'); INSERT INTO `t_address_city` V ALUES ('13', '130900', '沧州市', '130000'); INSERT INTO `t_address_city` V ALUES ('14', '131000', '廊坊市', '130000'); INSERT INTO `t_address_city` V ALUES ('15', '131100', '衡水市', '130000'); INSERT INTO `t_address_city` V ALUES ('16', '140100', '太原市', '140000'); INSERT INTO `t_address_city` V ALUES ('17', '140200', '大同市', '140000'); INSERT INTO `t_address_city` V ALUES ('18', '140300', '阳泉市', '140000'); INSERT INTO `t_address_city` VALUES ('19', '140400', '长治市', '140000'); INSERT INTO `t_address_city` V ALUES ('20', '140500', '晋城市', '140000'); INSERT INTO `t_address_city` V ALUES ('21', '140600', '朔州市', '140000'); INSERT INTO `t_address_city` V ALUES ('22', '140700', '晋中市', '140000'); INSERT INTO `t_address_city` V ALUES ('23', '140800', '运城市', '140000'); INSERT INTO `t_address_city` V ALUES ('24', '140900', '忻州市', '140000'); INSERT INTO `t_address_city` V ALUES ('25', '141000', '临汾市', '140000'); INSERT INTO `t_address_city` V ALUES ('26', '141100', '吕梁市', '140000'); INSERT INTO `t_address_city` V ALUES ('27', '150100', '呼和浩特市', '150000');INSERT INTO `t_address_city` V ALUES ('29', '150300', '乌海市', '150000');INSERT INTO `t_address_city` V ALUES ('30', '150400', '赤峰市', '150000');INSERT INTO `t_address_city` V ALUES ('31', '150500', '通辽市', '150000');INSERT INTO `t_address_city` V ALUES ('32', '150600', '鄂尔多斯市', '150000'); INSERT INTO `t_address_city` V ALUES ('33', '150700', '呼伦贝尔市', '150000'); INSERT INTO `t_address_city` V ALUES ('34', '150800', '巴彦淖尔市', '150000'); INSERT INTO `t_address_city` V ALUES ('35', '150900', '乌兰察布市', '150000'); INSERT INTO `t_address_city` V ALUES ('36', '152200', '兴安盟', '150000');INSERT INTO `t_address_city` V ALUES ('37', '152500', '锡林郭勒盟', '150000'); INSERT INTO `t_address_city` V ALUES ('38', '152900', '阿拉善盟', '150000'); INSERT INTO `t_address_city` V ALUES ('39', '210100', '沈阳市', '210000');INSERT INTO `t_address_city` V ALUES ('40', '210200', '大连市', '210000');INSERT INTO `t_address_city` V ALUES ('41', '210300', '鞍山市', '210000');INSERT INTO `t_address_city` V ALUES ('42', '210400', '抚顺市', '210000');INSERT INTO `t_address_city` VALUES ('43', '210500', '本溪市', '210000');INSERT INTO `t_address_city` V ALUES ('44', '210600', '丹东市', '210000');INSERT INTO `t_address_city` V ALUES ('45', '210700', '锦州市', '210000');INSERT INTO `t_address_city` V ALUES ('46', '210800', '营口市', '210000');INSERT INTO `t_address_city` V ALUES ('47', '210900', '阜新市', '210000');INSERT INTO `t_address_city` V ALUES ('48', '211000', '辽阳市', '210000');INSERT INTO `t_address_city` V ALUES ('49', '211100', '盘锦市', '210000');INSERT INTO `t_address_city` V ALUES ('50', '211200', '铁岭市', '210000');INSERT INTO `t_address_city` V ALUES ('51', '211300', '朝阳市', '210000');INSERT INTO `t_address_city` V ALUES ('52', '211400', '葫芦岛市', '210000'); INSERT INTO `t_address_city` V ALUES ('53', '220100', '长春市', '220000');INSERT INTO `t_address_city` V ALUES ('54', '220200', '吉林市', '220000');INSERT INTO `t_address_city` V ALUES ('55', '220300', '四平市', '220000');INSERT INTO `t_address_city` V ALUES ('56', '220400', '辽源市', '220000');INSERT INTO `t_address_city` V ALUES ('57', '220500', '通化市', '220000');INSERT INTO `t_address_city` V ALUES ('58', '220600', '白山市', '220000');INSERT INTO `t_address_city` V ALUES ('59', '220700', '松原市', '220000');INSERT INTO `t_address_city` V ALUES ('60', '220800', '白城市', '220000');INSERT INTO `t_address_city` V ALUES ('61', '222400', '延边朝鲜族自治州', '220000'); INSERT INTO `t_address_city` V ALUES ('62', '230100', '哈尔滨市', '230000'); INSERT INTO `t_address_city` V ALUES ('63', '230200', '齐齐哈尔市', '230000'); INSERT INTO `t_address_city` V ALUES ('64', '230300', '鸡西市', '230000');INSERT INTO `t_address_city` V ALUES ('65', '230400', '鹤岗市', '230000');INSERT INTO `t_address_city` V ALUES ('66', '230500', '双鸭山市', '230000'); INSERT INTO `t_address_city` V ALUES ('67', '230600', '大庆市', '230000');INSERT INTO `t_address_city` V ALUES ('68', '230700', '伊春市', '230000');INSERT INTO `t_address_city` V ALUES ('69', '230800', '佳木斯市', '230000'); INSERT INTO `t_address_city` V ALUES ('70', '230900', '七台河市', '230000'); INSERT INTO `t_address_city` V ALUES ('71', '231000', '牡丹江市', '230000');INSERT INTO `t_address_city` V ALUES ('73', '231200', '绥化市', '230000'); INSERT INTO `t_address_city` VALUES ('74', '232700', '大兴安岭地区', '230000'); INSERT INTO `t_address_city` V ALUES ('75', '310100', '上海市', '310000'); INSERT INTO `t_address_city` V ALUES ('76', '3102xx', '上海下属县', '3100xx'); INSERT INTO `t_address_city` V ALUES ('77', '320100', '南京市', '320000'); INSERT INTO `t_address_city` V ALUES ('78', '320200', '无锡市', '320000'); INSERT INTO `t_address_city` V ALUES ('79', '320300', '徐州市', '320000'); INSERT INTO `t_address_city` V ALUES ('80', '320400', '常州市', '320000'); INSERT INTO `t_address_city` VALUES ('81', '320500', '苏州市', '320000'); INSERT INTO `t_address_city` V ALUES ('82', '320600', '南通市', '320000'); INSERT INTO `t_address_city` V ALUES ('83', '320700', '连云港市', '320000'); INSERT INTO `t_address_city` V ALUES ('84', '320800', '淮安市', '320000'); INSERT INTO `t_address_city` V ALUES ('85', '320900', '盐城市', '320000'); INSERT INTO `t_address_city` V ALUES ('86', '321000', '扬州市', '320000'); INSERT INTO `t_address_city` V ALUES ('87', '321100', '镇江市', '320000'); INSERT INTO `t_address_city` V ALUES ('88', '321200', '泰州市', '320000'); INSERT INTO `t_address_city` V ALUES ('89', '321300', '宿迁市', '320000'); INSERT INTO `t_address_city` V ALUES ('90', '330100', '杭州市', '330000'); INSERT INTO `t_address_city` V ALUES ('91', '330200', '宁波市', '330000'); INSERT INTO `t_address_city` V ALUES ('92', '330300', '温州市', '330000'); INSERT INTO `t_address_city` V ALUES ('93', '330400', '嘉兴市', '330000'); INSERT INTO `t_address_city` V ALUES ('94', '330500', '湖州市', '330000'); INSERT INTO `t_address_city` V ALUES ('95', '330600', '绍兴市', '330000'); INSERT INTO `t_address_city` V ALUES ('96', '330700', '金华市', '330000'); INSERT INTO `t_address_city` V ALUES ('97', '330800', '衢州市', '330000'); INSERT INTO `t_address_city` V ALUES ('98', '330900', '舟山市', '330000'); INSERT INTO `t_address_city` V ALUES ('99', '331000', '台州市', '330000'); INSERT INTO `t_address_city` V ALUES ('100', '331100', '丽水市', '330000'); INSERT INTO `t_address_city` V ALUES ('101', '340100', '合肥市', '340000'); INSERT INTO `t_address_city` V ALUES ('102', '340200', '芜湖市', '340000'); INSERT INTO `t_address_city` V ALUES ('103', '340300', '蚌埠市', '340000'); INSERT INTO `t_address_city` V ALUES ('104', '340400', '淮南市', '340000'); INSERT INTO `t_address_city` V ALUES ('105', '340500', '马鞍山市', '340000'); INSERT INTO `t_address_city` V ALUES ('106', '340600', '淮北市', '340000'); INSERT INTO `t_address_city` V ALUES ('107', '340700', '铜陵市', '340000'); INSERT INTO `t_address_city` V ALUES ('108', '340800', '安庆市', '340000'); INSERT INTO `t_address_city` V ALUES ('109', '341000', '黄山市', '340000'); INSERT INTO `t_address_city` V ALUES ('110', '341100', '滁州市', '340000'); INSERT INTO `t_address_city` V ALUES ('111', '341200', '阜阳市', '340000'); INSERT INTO `t_address_city` V ALUES ('112', '341300', '宿州市', '340000'); INSERT INTO `t_address_city` V ALUES ('113', '341400', '巢湖市', '340000'); INSERT INTO `t_address_city` V ALUES ('114', '341500', '六安市', '340000'); INSERT INTO `t_address_city` V ALUES ('115', '341600', '亳州市', '340000');INSERT INTO `t_address_city` V ALUES ('117', '341800', '宣城市', '340000'); INSERT INTO `t_address_city` V ALUES ('118', '350100', '福州市', '350000'); INSERT INTO `t_address_city` V ALUES ('119', '350200', '厦门市', '350000'); INSERT INTO `t_address_city` V ALUES ('120', '350300', '莆田市', '350000'); INSERT INTO `t_address_city` V ALUES ('121', '350400', '三明市', '350000'); INSERT INTO `t_address_city` VALUES ('122', '350500', '泉州市', '350000'); INSERT INTO `t_address_city` V ALUES ('123', '350600', '漳州市', '350000'); INSERT INTO `t_address_city` V ALUES ('124', '350700', '南平市', '350000'); INSERT INTO `t_address_city` V ALUES ('125', '350800', '龙岩市', '350000'); INSERT INTO `t_address_city` V ALUES ('126', '350900', '宁德市', '350000'); INSERT INTO `t_address_city` V ALUES ('127', '360100', '南昌市', '360000'); INSERT INTO `t_address_city` V ALUES ('128', '360200', '景德镇市', '360000'); INSERT INTO `t_address_city` VALUES ('129', '360300', '萍乡市', '360000'); INSERT INTO `t_address_city` V ALUES ('130', '360400', '九江市', '360000'); INSERT INTO `t_address_city` V ALUES ('131', '360500', '新余市', '360000'); INSERT INTO `t_address_city` V ALUES ('132', '360600', '鹰潭市', '360000'); INSERT INTO `t_address_city` V ALUES ('133', '360700', '赣州市', '360000'); INSERT INTO `t_address_city` V ALUES ('134', '360800', '吉安市', '360000'); INSERT INTO `t_address_city` V ALUES ('135', '360900', '宜春市', '360000'); INSERT INTO `t_address_city` V ALUES ('136', '361000', '抚州市', '360000'); INSERT INTO `t_address_city` V ALUES ('137', '361100', '上饶市', '360000'); INSERT INTO `t_address_city` V ALUES ('138', '370100', '济南市', '370000'); INSERT INTO `t_address_city` V ALUES ('139', '370200', '青岛市', '370000'); INSERT INTO `t_address_city` V ALUES ('140', '370300', '淄博市', '370000'); INSERT INTO `t_address_city` V ALUES ('141', '370400', '枣庄市', '370000'); INSERT INTO `t_address_city` V ALUES ('142', '370500', '东营市', '370000'); INSERT INTO `t_address_city` V ALUES ('143', '370600', '烟台市', '370000'); INSERT INTO `t_address_city` V ALUES ('144', '370700', '潍坊市', '370000'); INSERT INTO `t_address_city` V ALUES ('145', '370800', '济宁市', '370000'); INSERT INTO `t_address_city` V ALUES ('146', '370900', '泰安市', '370000'); INSERT INTO `t_address_city` V ALUES ('147', '371000', '威海市', '370000'); INSERT INTO `t_address_city` V ALUES ('148', '371100', '日照市', '370000'); INSERT INTO `t_address_city` V ALUES ('149', '371200', '莱芜市', '370000'); INSERT INTO `t_address_city` V ALUES ('150', '371300', '临沂市', '370000'); INSERT INTO `t_address_city` V ALUES ('151', '371400', '德州市', '370000'); INSERT INTO `t_address_city` V ALUES ('152', '371500', '聊城市', '370000'); INSERT INTO `t_address_city` V ALUES ('153', '371600', '滨州市', '370000'); INSERT INTO `t_address_city` V ALUES ('154', '371700', '荷泽市', '370000'); INSERT INTO `t_address_city` V ALUES ('155', '410100', '郑州市', '410000'); INSERT INTO `t_address_city` V ALUES ('156', '410200', '开封市', '410000'); INSERT INTO `t_address_city` V ALUES ('157', '410300', '洛阳市', '410000'); INSERT INTO `t_address_city` V ALUES ('158', '410400', '平顶山市', '410000'); INSERT INTO `t_address_city` V ALUES ('159', '410500', '安阳市', '410000');INSERT INTO `t_address_city` V ALUES ('161', '410700', '新乡市', '410000');INSERT INTO `t_address_city` V ALUES ('162', '410800', '焦作市', '410000');INSERT INTO `t_address_city` V ALUES ('163', '410900', '濮阳市', '410000');INSERT INTO `t_address_city` V ALUES ('164', '411000', '许昌市', '410000');INSERT INTO `t_address_city` V ALUES ('165', '411100', '漯河市', '410000');INSERT INTO `t_address_city` V ALUES ('166', '411200', '三门峡市', '410000');INSERT INTO `t_address_city` V ALUES ('167', '411300', '南阳市', '410000');INSERT INTO `t_address_city` V ALUES ('168', '411400', '商丘市', '410000');INSERT INTO `t_address_city` V ALUES ('169', '411500', '信阳市', '410000');INSERT INTO `t_address_city` V ALUES ('170', '411600', '周口市', '410000');INSERT INTO `t_address_city` V ALUES ('171', '411700', '驻马店市', '410000');INSERT INTO `t_address_city` V ALUES ('172', '420100', '武汉市', '420000');INSERT INTO `t_address_city` V ALUES ('173', '420200', '黄石市', '420000');INSERT INTO `t_address_city` V ALUES ('174', '420300', '十堰市', '420000');INSERT INTO `t_address_city` V ALUES ('175', '420500', '宜昌市', '420000');INSERT INTO `t_address_city` V ALUES ('176', '420600', '襄樊市', '420000');INSERT INTO `t_address_city` V ALUES ('177', '420700', '鄂州市', '420000');INSERT INTO `t_address_city` V ALUES ('178', '420800', '荆门市', '420000');INSERT INTO `t_address_city` V ALUES ('179', '420900', '孝感市', '420000');INSERT INTO `t_address_city` VALUES ('180', '421000', '荆州市', '420000');INSERT INTO `t_address_city` V ALUES ('181', '421100', '黄冈市', '420000');INSERT INTO `t_address_city` V ALUES ('182', '421200', '咸宁市', '420000');INSERT INTO `t_address_city` V ALUES ('183', '421300', '随州市', '420000');INSERT INTO `t_address_city` VALUES ('184', '422800', '恩施土家族苗族自治州', '420000');INSERT INTO `t_address_city` V ALUES ('185', '429000', '省直辖行政单位', '420000');INSERT INTO `t_address_city` V ALUES ('186', '430100', '长沙市', '430000');INSERT INTO `t_address_city` V ALUES ('187', '430200', '株洲市', '430000');INSERT INTO `t_address_city` V ALUES ('188', '430300', '湘潭市', '430000');INSERT INTO `t_address_city` V ALUES ('189', '430400', '衡阳市', '430000');INSERT INTO `t_address_city` V ALUES ('190', '430500', '邵阳市', '430000');INSERT INTO `t_address_city` V ALUES ('191', '430600', '岳阳市', '430000');INSERT INTO `t_address_city` V ALUES ('192', '430700', '常德市', '430000');INSERT INTO `t_address_city` V ALUES ('193', '430800', '张家界市', '430000');INSERT INTO `t_address_city` V ALUES ('194', '430900', '益阳市', '430000');INSERT INTO `t_address_city` V ALUES ('195', '431000', '郴州市', '430000');INSERT INTO `t_address_city` V ALUES ('196', '431100', '永州市', '430000');INSERT INTO `t_address_city` V ALUES ('197', '431200', '怀化市', '430000');INSERT INTO `t_address_city` V ALUES ('198', '431300', '娄底市', '430000');INSERT INTO `t_address_city` VALUES ('199', '433100', '湘西土家族苗族自治州', '430000');INSERT INTO `t_address_city` V ALUES ('200', '440100', '广州市', '440000');INSERT INTO `t_address_city` V ALUES ('202', '440300', '深圳市', '440000');INSERT INTO `t_address_city` V ALUES ('203', '440400', '珠海市', '440000');INSERT INTO `t_address_city` V ALUES ('204', '440500', '汕头市', '440000');INSERT INTO `t_address_city` V ALUES ('205', '440600', '佛山市', '440000');INSERT INTO `t_address_city` V ALUES ('206', '440700', '江门市', '440000');INSERT INTO `t_address_city` V ALUES ('207', '440800', '湛江市', '440000');INSERT INTO `t_address_city` V ALUES ('208', '440900', '茂名市', '440000');INSERT INTO `t_address_city` V ALUES ('209', '441200', '肇庆市', '440000');INSERT INTO `t_address_city` V ALUES ('210', '441300', '惠州市', '440000');INSERT INTO `t_address_city` V ALUES ('211', '441400', '梅州市', '440000');INSERT INTO `t_address_city` V ALUES ('212', '441500', '汕尾市', '440000');INSERT INTO `t_address_city` V ALUES ('213', '441600', '河源市', '440000');INSERT INTO `t_address_city` VALUES ('214', '441700', '阳江市', '440000');INSERT INTO `t_address_city` V ALUES ('215', '441800', '清远市', '440000');INSERT INTO `t_address_city` V ALUES ('216', '441900', '东莞市', '440000');INSERT INTO `t_address_city` V ALUES ('217', '442000', '中山市', '440000');INSERT INTO `t_address_city` V ALUES ('218', '445100', '潮州市', '440000');INSERT INTO `t_address_city` V ALUES ('219', '445200', '揭阳市', '440000');INSERT INTO `t_address_city` V ALUES ('220', '445300', '云浮市', '440000');INSERT INTO `t_address_city` V ALUES ('221', '450100', '南宁市', '450000');INSERT INTO `t_address_city` V ALUES ('222', '450200', '柳州市', '450000');INSERT INTO `t_address_city` V ALUES ('223', '450300', '桂林市', '450000');INSERT INTO `t_address_city` V ALUES ('224', '450400', '梧州市', '450000');INSERT INTO `t_address_city` V ALUES ('225', '450500', '北海市', '450000');INSERT INTO `t_address_city` V ALUES ('226', '450600', '防城港市', '450000');INSERT INTO `t_address_city` V ALUES ('227', '450700', '钦州市', '450000');INSERT INTO `t_address_city` V ALUES ('228', '450800', '贵港市', '450000');INSERT INTO `t_address_city` V ALUES ('229', '450900', '玉林市', '450000');INSERT INTO `t_address_city` V ALUES ('230', '451000', '百色市', '450000');INSERT INTO `t_address_city` V ALUES ('231', '451100', '贺州市', '450000');INSERT INTO `t_address_city` V ALUES ('232', '451200', '河池市', '450000');INSERT INTO `t_address_city` V ALUES ('233', '451300', '来宾市', '450000');INSERT INTO `t_address_city` V ALUES ('234', '451400', '崇左市', '450000');INSERT INTO `t_address_city` V ALUES ('235', '460100', '海口市', '460000');INSERT INTO `t_address_city` V ALUES ('236', '460200', '三亚市', '460000');INSERT INTO `t_address_city` V ALUES ('237', '469000', '省直辖县级行政单位', '460000'); INSERT INTO `t_address_city` V ALUES ('238', '500100', '重庆市', '500000');INSERT INTO `t_address_city` V ALUES ('239', '5002xx', '重庆下属县', '5000xx'); INSERT INTO `t_address_city` V ALUES ('240', '5003xx', '重庆下属市', '5000xx'); INSERT INTO `t_address_city` VALUES ('241', '510100', '成都市', '510000');INSERT INTO `t_address_city` V ALUES ('242', '510300', '自贡市', '510000');INSERT INTO `t_address_city` V ALUES ('243', '510400', '攀枝花市', '510000');INSERT INTO `t_address_city` V ALUES ('244', '510500', '泸州市', '510000');。
从试点看路径_向转型要动力——新一代地理信息公共服务平台建设试点经验摘要
近日,自然资源部办公厅印发《新一代地理信息公共服务平台(天地图)建设总体实施方案》,推动天地图由单一地理信息服务向综合地理信息服务转型。
新的平台该如何建设?此前,自然资源部组织10个省(区、市)开展了新一代地理信息公共服务平台(以下简称“新平台”)建设试点,形成了一批可复制、可推广的技术方案、软件工具、工作机制等,为全面开展新平台建设提供了丰富的、可借鉴的经验。
我们将试点经验摘编如下,以飨读者。
浙江:省市县协同在线“即采、即审、即发”明确省市县分域更新的职责。
将数据更新和年度地理信息公共服务平台运维工作结合。
明确省级节点为地理信息公共服务平台及全省数据在线更新提供技术支撑,承担数据库的维护和基础服务统一发布,市县节点负责本辖区内数据更新的组织实施、质量管理、本地节点建设及特色服务的发布等工作。
建立变化信息引导的更新流程。
省市县共建变化信息引导池,接入发改、建设等部门的工程建设信息,通过在线联动更新工具,将原来线上、线下混合作业流程全部移至线上,将数据更新、服务发布等相对独立的环节转化为集数据更新、服务发布于一体的数据在线更新服务模式,从串行的6个环节缩减为“在线更新、即审即发”2个环节,实现地理信息要素更新的减环节、提时效。
研制全流程在线联动更新工具。
更新内容包括新增楼址、门址等地址数据。
重大要素更新周期缩短至15个工作日。
研发在线更新工具、在线拟合接口、矢量瓦片快速更新发布技术,解决多端、多用户并发更新数据不一致等问题,支持省市县在线协同高效更新,实现“即采、即审、即发”。
构建并行在线质量巡检机制。
在数据更新发布的同时开展质量巡检,将原更新过程中分环节、分批次的质量控制变为全流程、全时段数据服务效能的监管。
通过上述做法,浙江省地理信息要素更新到发布的时间从3 ~ 4个月缩短至20个工作日左右,实现了地理信息要素更新服务的提质增效。
安徽:以变化驱动协同更新探索形成省市县协同更新工作机制。
在更新范围上,以城市建成区为界,省市县三级节点互补更新 ;在更新内容上,省级节点重点更新建成区外矢量和影像,市县级节点重点更新建成区内矢量和兴趣点,充分发挥省市节点各自数据优势和技术特点。
quan中国省市区三级数据库表.sql
# MySQL-Front 5.1 (Build 2.7)/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;/*!40101 SET SQL_MODE='' */;/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;/*!40103 SET SQL_NOTES='ON' */;# Host: localhost Database: iptohat_area# ------------------------------------------------------# Server version 5.0.26## Source for table hat_area#CREATE TABLE hat_area (id int(11) NOT NULL auto_increment,areaID varchar(50) default NULL,area varchar(60) default NULL,father varchar(6) default NULL,primary key(id)) ENGINE=MyISAM AUTO_INCREMENT=3145 DEFAULT CHARSET=utf8;## Dumping data for table hat_area#INSERT INTO hat_area VALUES (1,'110101','东城区','110100'); INSERT INTO hat_area VALUES (2,'110102','西城区','110100'); INSERT INTO hat_area VALUES (3,'110103','崇文区','110100'); INSERT INTO hat_area VALUES (4,'110104','宣武区','110100'); INSERT INTO hat_area VALUES (5,'110105','朝阳区','110100'); INSERT INTO hat_area VALUES (6,'110106','丰台区','110100'); INSERT INTO hat_area VALUES (7,'110107','石景山区','110100'); INSERT INTO hat_area VALUES (8,'110108','海淀区','110100'); INSERT INTO hat_area VALUES (9,'110109','门头沟区','110100'); INSERT INTO hat_area VALUES (10,'110111','房山区','110100'); INSERT INTO hat_area VALUES (11,'110112','通州区','110100'); INSERT INTO hat_area VALUES (12,'110113','顺义区','110100'); INSERT INTO hat_area VALUES (13,'110114','昌平区','110100'); INSERT INTO hat_area VALUES (14,'110115','大兴区','110100'); INSERT INTO hat_area VALUES (15,'110116','怀柔区','110100'); INSERT INTO hat_area VALUES (16,'110117','平谷区','110100');INSERT INTO hat_area VALUES (18,'110229','延庆县','110200'); INSERT INTO hat_area VALUES (19,'120101','和平区','120100'); INSERT INTO hat_area VALUES (20,'120102','河东区','120100'); INSERT INTO hat_area VALUES (21,'120103','河西区','120100'); INSERT INTO hat_area VALUES (22,'120104','南开区','120100'); INSERT INTO hat_area VALUES (23,'120105','河北区','120100'); INSERT INTO hat_area VALUES (24,'120106','红桥区','120100'); INSERT INTO hat_area VALUES (25,'120107','塘沽区','120100'); INSERT INTO hat_area VALUES (26,'120108','汉沽区','120100'); INSERT INTO hat_area VALUES (27,'120109','大港区','120100'); INSERT INTO hat_area VALUES (28,'120110','东丽区','120100'); INSERT INTO hat_area VALUES (29,'120111','西青区','120100'); INSERT INTO hat_area VALUES (30,'120112','津南区','120100'); INSERT INTO hat_area VALUES (31,'120113','北辰区','120100'); INSERT INTO hat_area VALUES (32,'120114','武清区','120100'); INSERT INTO hat_area VALUES (33,'120115','宝坻区','120100'); INSERT INTO hat_area VALUES (34,'120221','宁河县','120200'); INSERT INTO hat_area VALUES (35,'120223','静海县','120200'); INSERT INTO hat_area VALUES (36,'120225','蓟县','120200'); INSERT INTO hat_area VALUES (37,'130101','市辖区','130100'); INSERT INTO hat_area VALUES (38,'130102','长安区','130100'); INSERT INTO hat_area VALUES (39,'130103','桥东区','130100'); INSERT INTO hat_area VALUES (40,'130104','桥西区','130100'); INSERT INTO hat_area VALUES (41,'130105','新华区','130100'); INSERT INTO hat_area VALUES (42,'130107','井陉矿区','130100'); INSERT INTO hat_area VALUES (43,'130108','裕华区','130100'); INSERT INTO hat_area VALUES (44,'130121','井陉县','130100'); INSERT INTO hat_area VALUES (45,'130123','正定县','130100'); INSERT INTO hat_area VALUES (46,'130124','栾城县','130100'); INSERT INTO hat_area VALUES (47,'130125','行唐县','130100'); INSERT INTO hat_area VALUES (48,'130126','灵寿县','130100'); INSERT INTO hat_area VALUES (49,'130127','高邑县','130100'); INSERT INTO hat_area VALUES (50,'130128','深泽县','130100'); INSERT INTO hat_area VALUES (51,'130129','赞皇县','130100'); INSERT INTO hat_area VALUES (52,'130130','无极县','130100'); INSERT INTO hat_area VALUES (53,'130131','平山县','130100'); INSERT INTO hat_area VALUES (54,'130132','元氏县','130100'); INSERT INTO hat_area VALUES (55,'130133','赵县','130100'); INSERT INTO hat_area VALUES (56,'130181','辛集市','130100'); INSERT INTO hat_area VALUES (57,'130182','藁城市','130100'); INSERT INTO hat_area VALUES (58,'130183','晋州市','130100'); INSERT INTO hat_area VALUES (59,'130184','新乐市','130100'); INSERT INTO hat_area VALUES (60,'130185','鹿泉市','130100');INSERT INTO hat_area VALUES (62,'130202','路南区','130200'); INSERT INTO hat_area VALUES (63,'130203','路北区','130200'); INSERT INTO hat_area VALUES (64,'130204','古冶区','130200'); INSERT INTO hat_area VALUES (65,'130205','开平区','130200'); INSERT INTO hat_area VALUES (66,'130207','丰南区','130200'); INSERT INTO hat_area VALUES (67,'130208','丰润区','130200'); INSERT INTO hat_area VALUES (68,'130223','滦县','130200'); INSERT INTO hat_area VALUES (69,'130224','滦南县','130200'); INSERT INTO hat_area VALUES (70,'130225','乐亭县','130200'); INSERT INTO hat_area VALUES (71,'130227','迁西县','130200'); INSERT INTO hat_area VALUES (72,'130229','玉田县','130200'); INSERT INTO hat_area VALUES (73,'130230','唐海县','130200'); INSERT INTO hat_area VALUES (74,'130281','遵化市','130200'); INSERT INTO hat_area VALUES (75,'130283','迁安市','130200'); INSERT INTO hat_area VALUES (76,'130301','市辖区','130300'); INSERT INTO hat_area VALUES (77,'130302','海港区','130300'); INSERT INTO hat_area VALUES (78,'130303','山海关区','130300'); INSERT INTO hat_area VALUES (79,'130304','北戴河区','130300'); INSERT INTO hat_area VALUES (80,'130321','青龙满族自治县','130300'); INSERT INTO hat_area VALUES (81,'130322','昌黎县','130300'); INSERT INTO hat_area VALUES (82,'130323','抚宁县','130300'); INSERT INTO hat_area VALUES (83,'130324','卢龙县','130300'); INSERT INTO hat_area VALUES (84,'130401','市辖区','130400'); INSERT INTO hat_area VALUES (85,'130402','邯山区','130400'); INSERT INTO hat_area VALUES (86,'130403','丛台区','130400'); INSERT INTO hat_area VALUES (87,'130404','复兴区','130400'); INSERT INTO hat_area VALUES (88,'130406','峰峰矿区','130400'); INSERT INTO hat_area VALUES (89,'130421','邯郸县','130400'); INSERT INTO hat_area VALUES (90,'130423','临漳县','130400'); INSERT INTO hat_area VALUES (91,'130424','成安县','130400'); INSERT INTO hat_area VALUES (92,'130425','大名县','130400'); INSERT INTO hat_area VALUES (93,'130426','涉县','130400'); INSERT INTO hat_area VALUES (94,'130427','磁县','130400'); INSERT INTO hat_area VALUES (95,'130428','肥乡县','130400'); INSERT INTO hat_area VALUES (96,'130429','永年县','130400'); INSERT INTO hat_area VALUES (97,'130430','邱县','130400'); INSERT INTO hat_area VALUES (98,'130431','鸡泽县','130400'); INSERT INTO hat_area VALUES (99,'130432','广平县','130400'); INSERT INTO hat_area VALUES (100,'130433','馆陶县','130400'); INSERT INTO hat_area VALUES (101,'130434','魏县','130400'); INSERT INTO hat_area VALUES (102,'130435','曲周县','130400'); INSERT INTO hat_area VALUES (103,'130481','武安市','130400'); INSERT INTO hat_area VALUES (104,'130501','市辖区','130500');INSERT INTO hat_area VALUES (106,'130503','桥西区','130500'); INSERT INTO hat_area VALUES (107,'130521','邢台县','130500'); INSERT INTO hat_area VALUES (108,'130522','临城县','130500'); INSERT INTO hat_area VALUES (109,'130523','内丘县','130500'); INSERT INTO hat_area VALUES (110,'130524','柏乡县','130500'); INSERT INTO hat_area VALUES (111,'130525','隆尧县','130500'); INSERT INTO hat_area VALUES (112,'130526','任县','130500'); INSERT INTO hat_area VALUES (113,'130527','南和县','130500'); INSERT INTO hat_area VALUES (114,'130528','宁晋县','130500'); INSERT INTO hat_area VALUES (115,'130529','巨鹿县','130500'); INSERT INTO hat_area VALUES (116,'130530','新河县','130500'); INSERT INTO hat_area VALUES (117,'130531','广宗县','130500'); INSERT INTO hat_area VALUES (118,'130532','平乡县','130500'); INSERT INTO hat_area VALUES (119,'130533','威县','130500'); INSERT INTO hat_area VALUES (120,'130534','清河县','130500'); INSERT INTO hat_area VALUES (121,'130535','临西县','130500'); INSERT INTO hat_area VALUES (122,'130581','南宫市','130500'); INSERT INTO hat_area VALUES (123,'130582','沙河市','130500'); INSERT INTO hat_area VALUES (124,'130601','市辖区','130600'); INSERT INTO hat_area VALUES (125,'130602','新市区','130600'); INSERT INTO hat_area VALUES (126,'130603','北市区','130600'); INSERT INTO hat_area VALUES (127,'130604','南市区','130600'); INSERT INTO hat_area VALUES (128,'130621','满城县','130600'); INSERT INTO hat_area VALUES (129,'130622','清苑县','130600'); INSERT INTO hat_area VALUES (130,'130623','涞水县','130600'); INSERT INTO hat_area VALUES (131,'130624','阜平县','130600'); INSERT INTO hat_area VALUES (132,'130625','徐水县','130600'); INSERT INTO hat_area VALUES (133,'130626','定兴县','130600'); INSERT INTO hat_area VALUES (134,'130627','唐县','130600'); INSERT INTO hat_area VALUES (135,'130628','高阳县','130600'); INSERT INTO hat_area VALUES (136,'130629','容城县','130600'); INSERT INTO hat_area VALUES (137,'130630','涞源县','130600'); INSERT INTO hat_area VALUES (138,'130631','望都县','130600'); INSERT INTO hat_area VALUES (139,'130632','安新县','130600'); INSERT INTO hat_area VALUES (140,'130633','易县','130600'); INSERT INTO hat_area VALUES (141,'130634','曲阳县','130600'); INSERT INTO hat_area VALUES (142,'130635','蠡县','130600'); INSERT INTO hat_area VALUES (143,'130636','顺平县','130600'); INSERT INTO hat_area VALUES (144,'130637','博野县','130600'); INSERT INTO hat_area VALUES (145,'130638','雄县','130600'); INSERT INTO hat_area VALUES (146,'130681','涿州市','130600'); INSERT INTO hat_area VALUES (147,'130682','定州市','130600'); INSERT INTO hat_area VALUES (148,'130683','安国市','130600');INSERT INTO hat_area VALUES (150,'130701','市辖区','130700');INSERT INTO hat_area VALUES (151,'130702','桥东区','130700');INSERT INTO hat_area VALUES (152,'130703','桥西区','130700');INSERT INTO hat_area VALUES (153,'130705','宣化区','130700');INSERT INTO hat_area VALUES (154,'130706','下花园区','130700');INSERT INTO hat_area VALUES (155,'130721','宣化县','130700');INSERT INTO hat_area VALUES (156,'130722','张北县','130700');INSERT INTO hat_area VALUES (157,'130723','康保县','130700');INSERT INTO hat_area VALUES (158,'130724','沽源县','130700');INSERT INTO hat_area VALUES (159,'130725','尚义县','130700');INSERT INTO hat_area VALUES (160,'130726','蔚县','130700');INSERT INTO hat_area VALUES (161,'130727','阳原县','130700');INSERT INTO hat_area VALUES (162,'130728','怀安县','130700');INSERT INTO hat_area VALUES (163,'130729','万全县','130700');INSERT INTO hat_area VALUES (164,'130730','怀来县','130700');INSERT INTO hat_area VALUES (165,'130731','涿鹿县','130700');INSERT INTO hat_area VALUES (166,'130732','赤城县','130700');INSERT INTO hat_area VALUES (167,'130733','崇礼县','130700');INSERT INTO hat_area VALUES (168,'130801','市辖区','130800');INSERT INTO hat_area VALUES (169,'130802','双桥区','130800');INSERT INTO hat_area VALUES (170,'130803','双滦区','130800');INSERT INTO hat_area VALUES (171,'130804','鹰手营子矿区','130800'); INSERT INTO hat_area VALUES (172,'130821','承德县','130800');INSERT INTO hat_area VALUES (173,'130822','兴隆县','130800');INSERT INTO hat_area VALUES (174,'130823','平泉县','130800');INSERT INTO hat_area VALUES (175,'130824','滦平县','130800');INSERT INTO hat_area VALUES (176,'130825','隆化县','130800');INSERT INTO hat_area VALUES (177,'130826','丰宁满族自治县','130800'); INSERT INTO hat_area VALUES (178,'130827','宽城满族自治县','130800'); INSERT INTO hat_area VALUES (179,'130828','围场满族蒙古族自治县','130800'); INSERT INTO hat_area VALUES (180,'130901','市辖区','130900');INSERT INTO hat_area VALUES (181,'130902','新华区','130900');INSERT INTO hat_area VALUES (182,'130903','运河区','130900');INSERT INTO hat_area VALUES (183,'130921','沧县','130900');INSERT INTO hat_area VALUES (184,'130922','青县','130900');INSERT INTO hat_area VALUES (185,'130923','东光县','130900');INSERT INTO hat_area VALUES (186,'130924','海兴县','130900');INSERT INTO hat_area VALUES (187,'130925','盐山县','130900');INSERT INTO hat_area VALUES (188,'130926','肃宁县','130900');INSERT INTO hat_area VALUES (189,'130927','南皮县','130900');INSERT INTO hat_area VALUES (190,'130928','吴桥县','130900');INSERT INTO hat_area VALUES (191,'130929','献县','130900');INSERT INTO hat_area VALUES (192,'130930','孟村回族自治县','130900');INSERT INTO hat_area VALUES (194,'130982','任丘市','130900'); INSERT INTO hat_area VALUES (195,'130983','黄骅市','130900'); INSERT INTO hat_area VALUES (196,'130984','河间市','130900'); INSERT INTO hat_area VALUES (197,'131001','市辖区','131000'); INSERT INTO hat_area VALUES (198,'131002','安次区','131000'); INSERT INTO hat_area VALUES (199,'131003','广阳区','131000'); INSERT INTO hat_area VALUES (200,'131022','固安县','131000'); INSERT INTO hat_area VALUES (201,'131023','永清县','131000'); INSERT INTO hat_area VALUES (202,'131024','香河县','131000'); INSERT INTO hat_area VALUES (203,'131025','大城县','131000'); INSERT INTO hat_area VALUES (204,'131026','文安县','131000'); INSERT INTO hat_area VALUES (205,'131028','大厂回族自治县','131000'); INSERT INTO hat_area VALUES (206,'131081','霸州市','131000'); INSERT INTO hat_area VALUES (207,'131082','三河市','131000'); INSERT INTO hat_area VALUES (208,'131101','市辖区','131100'); INSERT INTO hat_area VALUES (209,'131102','桃城区','131100'); INSERT INTO hat_area VALUES (210,'131121','枣强县','131100'); INSERT INTO hat_area VALUES (211,'131122','武邑县','131100'); INSERT INTO hat_area VALUES (212,'131123','武强县','131100'); INSERT INTO hat_area VALUES (213,'131124','饶阳县','131100'); INSERT INTO hat_area VALUES (214,'131125','安平县','131100'); INSERT INTO hat_area VALUES (215,'131126','故城县','131100'); INSERT INTO hat_area VALUES (216,'131127','景县','131100'); INSERT INTO hat_area VALUES (217,'131128','阜城县','131100'); INSERT INTO hat_area VALUES (218,'131181','冀州市','131100'); INSERT INTO hat_area VALUES (219,'131182','深州市','131100'); INSERT INTO hat_area VALUES (220,'140101','市辖区','140100'); INSERT INTO hat_area VALUES (221,'140105','小店区','140100'); INSERT INTO hat_area VALUES (222,'140106','迎泽区','140100'); INSERT INTO hat_area VALUES (223,'140107','杏花岭区','140100'); INSERT INTO hat_area VALUES (224,'140108','尖草坪区','140100'); INSERT INTO hat_area VALUES (225,'140109','万柏林区','140100'); INSERT INTO hat_area VALUES (226,'140110','晋源区','140100'); INSERT INTO hat_area VALUES (227,'140121','清徐县','140100'); INSERT INTO hat_area VALUES (228,'140122','阳曲县','140100'); INSERT INTO hat_area VALUES (229,'140123','娄烦县','140100'); INSERT INTO hat_area VALUES (230,'140181','古交市','140100'); INSERT INTO hat_area VALUES (231,'140201','市辖区','140200'); INSERT INTO hat_area VALUES (232,'140202','城区','140200'); INSERT INTO hat_area VALUES (233,'140203','矿区','140200'); INSERT INTO hat_area VALUES (234,'140211','南郊区','140200'); INSERT INTO hat_area VALUES (235,'140212','新荣区','140200'); INSERT INTO hat_area VALUES (236,'140221','阳高县','140200');INSERT INTO hat_area VALUES (238,'140223','广灵县','140200'); INSERT INTO hat_area VALUES (239,'140224','灵丘县','140200'); INSERT INTO hat_area VALUES (240,'140225','浑源县','140200'); INSERT INTO hat_area VALUES (241,'140226','左云县','140200'); INSERT INTO hat_area VALUES (242,'140227','大同县','140200'); INSERT INTO hat_area VALUES (243,'140301','市辖区','140300'); INSERT INTO hat_area VALUES (244,'140302','城区','140300'); INSERT INTO hat_area VALUES (245,'140303','矿区','140300'); INSERT INTO hat_area VALUES (246,'140311','郊区','140300'); INSERT INTO hat_area VALUES (247,'140321','平定县','140300'); INSERT INTO hat_area VALUES (248,'140322','盂县','140300'); INSERT INTO hat_area VALUES (249,'140401','市辖区','140400'); INSERT INTO hat_area VALUES (250,'140402','城区','140400'); INSERT INTO hat_area VALUES (251,'140411','郊区','140400'); INSERT INTO hat_area VALUES (252,'140421','长治县','140400'); INSERT INTO hat_area VALUES (253,'140423','襄垣县','140400'); INSERT INTO hat_area VALUES (254,'140424','屯留县','140400'); INSERT INTO hat_area VALUES (255,'140425','平顺县','140400'); INSERT INTO hat_area VALUES (256,'140426','黎城县','140400'); INSERT INTO hat_area VALUES (257,'140427','壶关县','140400'); INSERT INTO hat_area VALUES (258,'140428','长子县','140400'); INSERT INTO hat_area VALUES (259,'140429','武乡县','140400'); INSERT INTO hat_area VALUES (260,'140430','沁县','140400'); INSERT INTO hat_area VALUES (261,'140431','沁源县','140400'); INSERT INTO hat_area VALUES (262,'140481','潞城市','140400'); INSERT INTO hat_area VALUES (263,'140501','市辖区','140500'); INSERT INTO hat_area VALUES (264,'140502','城区','140500'); INSERT INTO hat_area VALUES (265,'140521','沁水县','140500'); INSERT INTO hat_area VALUES (266,'140522','阳城县','140500'); INSERT INTO hat_area VALUES (267,'140524','陵川县','140500'); INSERT INTO hat_area VALUES (268,'140525','泽州县','140500'); INSERT INTO hat_area VALUES (269,'140581','高平市','140500'); INSERT INTO hat_area VALUES (270,'140601','市辖区','140600'); INSERT INTO hat_area VALUES (271,'140602','朔城区','140600'); INSERT INTO hat_area VALUES (272,'140603','平鲁区','140600'); INSERT INTO hat_area VALUES (273,'140621','山阴县','140600'); INSERT INTO hat_area VALUES (274,'140622','应县','140600'); INSERT INTO hat_area VALUES (275,'140623','右玉县','140600'); INSERT INTO hat_area VALUES (276,'140624','怀仁县','140600'); INSERT INTO hat_area VALUES (277,'140701','市辖区','140700'); INSERT INTO hat_area VALUES (278,'140702','榆次区','140700'); INSERT INTO hat_area VALUES (279,'140721','榆社县','140700'); INSERT INTO hat_area VALUES (280,'140722','左权县','140700');INSERT INTO hat_area VALUES (282,'140724','昔阳县','140700'); INSERT INTO hat_area VALUES (283,'140725','寿阳县','140700'); INSERT INTO hat_area VALUES (284,'140726','太谷县','140700'); INSERT INTO hat_area VALUES (285,'140727','祁县','140700'); INSERT INTO hat_area VALUES (286,'140728','平遥县','140700'); INSERT INTO hat_area VALUES (287,'140729','灵石县','140700'); INSERT INTO hat_area VALUES (288,'140781','介休市','140700'); INSERT INTO hat_area VALUES (289,'140801','市辖区','140800'); INSERT INTO hat_area VALUES (290,'140802','盐湖区','140800'); INSERT INTO hat_area VALUES (291,'140821','临猗县','140800'); INSERT INTO hat_area VALUES (292,'140822','万荣县','140800'); INSERT INTO hat_area VALUES (293,'140823','闻喜县','140800'); INSERT INTO hat_area VALUES (294,'140824','稷山县','140800'); INSERT INTO hat_area VALUES (295,'140825','新绛县','140800'); INSERT INTO hat_area VALUES (296,'140826','绛县','140800'); INSERT INTO hat_area VALUES (297,'140827','垣曲县','140800'); INSERT INTO hat_area VALUES (298,'140828','夏县','140800'); INSERT INTO hat_area VALUES (299,'140829','平陆县','140800'); INSERT INTO hat_area VALUES (300,'140830','芮城县','140800'); INSERT INTO hat_area VALUES (301,'140881','永济市','140800'); INSERT INTO hat_area VALUES (302,'140882','河津市','140800'); INSERT INTO hat_area VALUES (303,'140901','市辖区','140900'); INSERT INTO hat_area VALUES (304,'140902','忻府区','140900'); INSERT INTO hat_area VALUES (305,'140921','定襄县','140900'); INSERT INTO hat_area VALUES (306,'140922','五台县','140900'); INSERT INTO hat_area VALUES (307,'140923','代县','140900'); INSERT INTO hat_area VALUES (308,'140924','繁峙县','140900'); INSERT INTO hat_area VALUES (309,'140925','宁武县','140900'); INSERT INTO hat_area VALUES (310,'140926','静乐县','140900'); INSERT INTO hat_area VALUES (311,'140927','神池县','140900'); INSERT INTO hat_area VALUES (312,'140928','五寨县','140900'); INSERT INTO hat_area VALUES (313,'140929','岢岚县','140900'); INSERT INTO hat_area VALUES (314,'140930','河曲县','140900'); INSERT INTO hat_area VALUES (315,'140931','保德县','140900'); INSERT INTO hat_area VALUES (316,'140932','偏关县','140900'); INSERT INTO hat_area VALUES (317,'140981','原平市','140900'); INSERT INTO hat_area VALUES (318,'141001','市辖区','141000'); INSERT INTO hat_area VALUES (319,'141002','尧都区','141000'); INSERT INTO hat_area VALUES (320,'141021','曲沃县','141000'); INSERT INTO hat_area VALUES (321,'141022','翼城县','141000'); INSERT INTO hat_area VALUES (322,'141023','襄汾县','141000'); INSERT INTO hat_area VALUES (323,'141024','洪洞县','141000'); INSERT INTO hat_area VALUES (324,'141025','古县','141000');INSERT INTO hat_area VALUES (326,'141027','浮山县','141000'); INSERT INTO hat_area VALUES (327,'141028','吉县','141000'); INSERT INTO hat_area VALUES (328,'141029','乡宁县','141000'); INSERT INTO hat_area VALUES (329,'141030','大宁县','141000'); INSERT INTO hat_area VALUES (330,'141031','隰县','141000'); INSERT INTO hat_area VALUES (331,'141032','永和县','141000'); INSERT INTO hat_area VALUES (332,'141033','蒲县','141000'); INSERT INTO hat_area VALUES (333,'141034','汾西县','141000'); INSERT INTO hat_area VALUES (334,'141081','侯马市','141000'); INSERT INTO hat_area VALUES (335,'141082','霍州市','141000'); INSERT INTO hat_area VALUES (336,'141101','市辖区','141100'); INSERT INTO hat_area VALUES (337,'141102','离石区','141100'); INSERT INTO hat_area VALUES (338,'141121','文水县','141100'); INSERT INTO hat_area VALUES (339,'141122','交城县','141100'); INSERT INTO hat_area VALUES (340,'141123','兴县','141100'); INSERT INTO hat_area VALUES (341,'141124','临县','141100'); INSERT INTO hat_area VALUES (342,'141125','柳林县','141100'); INSERT INTO hat_area VALUES (343,'141126','石楼县','141100'); INSERT INTO hat_area VALUES (344,'141127','岚县','141100'); INSERT INTO hat_area VALUES (345,'141128','方山县','141100'); INSERT INTO hat_area VALUES (346,'141129','中阳县','141100'); INSERT INTO hat_area VALUES (347,'141130','交口县','141100'); INSERT INTO hat_area VALUES (348,'141181','孝义市','141100'); INSERT INTO hat_area VALUES (349,'141182','汾阳市','141100'); INSERT INTO hat_area VALUES (350,'150101','市辖区','150100'); INSERT INTO hat_area VALUES (351,'150102','新城区','150100'); INSERT INTO hat_area VALUES (352,'150103','回民区','150100'); INSERT INTO hat_area VALUES (353,'150104','玉泉区','150100'); INSERT INTO hat_area VALUES (354,'150105','赛罕区','150100'); INSERT INTO hat_area VALUES (355,'150121','土默特左旗','150100'); INSERT INTO hat_area VALUES (356,'150122','托克托县','150100'); INSERT INTO hat_area VALUES (357,'150123','和林格尔县','150100'); INSERT INTO hat_area VALUES (358,'150124','清水河县','150100'); INSERT INTO hat_area VALUES (359,'150125','武川县','150100'); INSERT INTO hat_area VALUES (360,'150201','市辖区','150200'); INSERT INTO hat_area VALUES (361,'150202','东河区','150200'); INSERT INTO hat_area VALUES (362,'150203','昆都仑区','150200'); INSERT INTO hat_area VALUES (363,'150204','青山区','150200'); INSERT INTO hat_area VALUES (364,'150205','石拐区','150200'); INSERT INTO hat_area VALUES (365,'150206','白云矿区','150200'); INSERT INTO hat_area VALUES (366,'150207','九原区','150200'); INSERT INTO hat_area VALUES (367,'150221','土默特右旗','150200'); INSERT INTO hat_area VALUES (368,'150222','固阳县','150200');。
JS全国省市县三级联动代码完整版
全国省市县三级联动(数据完整版)网页前台代码:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Defaul t" EnableEventValidation="false"%><%@ Register assembly="AjaxControlToolkit"namespace="AjaxControlToolkit" tagprefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""/TR/xhtml 1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head runat="server"><title>发电机销售网点</title></head><body><form id="form1" runat="server"><div align="center"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><fieldset ><legend>全国省市县</legend><fieldset style="width: 265px"><legend>省</legend><asp:DropDownList ID="DropDownList1" runat="server"AutoPostBack="True"></asp:DropDownList><cc1:CascadingDropDown ID="DropDownList1_CascadingDropDown" runat="server"Category="provice" Enabled="True" LoadingText="读取数据中.." PromptText="请选择省"TargetControlID="DropDownList1" ServicePath="WebService.asmx" ServiceMethod ="GetproviceNames"></cc1:CascadingDropDown></fieldset><fieldset style="width: 266px"><legend>市</legend><asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True"></asp:DropDownList><cc1:CascadingDropDown ID="DropDownList2_CascadingDropDown" runat="server"Category="city" Enabled="True" TargetControlID="DropDownList2" LoadingText="读取数据中.." PromptText="请选择市" ParentControlID="DropDownList1"ServicePath="WebService.asmx" ServiceMethod="GetCityNames"></cc1:CascadingDropDown></fieldset><fieldset style="width: 266px"><legend>县</legend><asp:DropDownList ID="DropDownList3" runat="server"></asp:DropDownList><cc1:CascadingDropDown ID="DropDownList3_CascadingDropDown" runat="server" Ca tegory="District" TargetControlID="DropDownList3"Enabled="True" LoadingText="读取数据中.." ParentControlID="DropDownList2"ServicePath="WebService.asmx" ServiceMethod="GetDistrictNames"></cc1:CascadingDropDown></fieldset></fieldset></div></form></body></html>WebService代码using System;using System.Collections;using System.Linq;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Xml.Linq;//访问数据库命名空间using System.Data;using System.Data.SqlClient;//访问web.config命名空间using System.Web.Configuration;//导入ScriptServiceAttribute类的命名空间using System.Web.Script.Services;//返回CascadingDropDownNameValue数组所需的命名空间using AjaxControlToolkit;using System.Collections.Generic;using System.Collections.Specialized;///<summary>///WebService 的摘要说明///</summary>[WebService(Namespace = "/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]//若要允许使用 AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
如何制作云表省市区三级联动
如何制作云表省市区三级联动我们在表单的填报过程中,经常需要填写省市区信息,如何实现快捷方便的联动填写呢?已有《省市区》模板,“省市区”数据批量导入;有以下3种实现方式:①下列列表联动②列表选择联动③树形列表联动一、下拉列表在“省份”上单击【﹀】从“省份下拉列表”中选择省份“江苏省”,在“城市”上单击【﹀】,弹出的下拉列表中只显示“江苏省下所有的城市列表”,选择“南京市”后,在“地区”上单击【﹀】,弹出的下拉列表中只显示“南京市下所有的地区列表”,实现联动实现分析:上图中以下拉列表的方式呈现数据,使用下拉列表的数据接口;省市区基础数据存放在《省市区》模板中,需要设计3个数据接口。
第1个数据接口“所有省份下拉列表”,没有参数,将所有的省份去重筛选出来,以便选择;第2个数据接口“根据省查询所有城市下拉列表”,有1个参数“省份”;第3个数据接口“根据省和城市查询所有地区下拉列表”,有2个参数“省份”和“城市”;在《客户档案》模板中调用已设计好的数据接口并给参数赋值;①在《省市区》模板中设计数据接口“省份下拉列表”。
该数据接口的类型为“下拉列表”,“取值”来自“数据表”“本模板”的“省份”数据项;②在《省市区》模板中设计数据接口“查询城市下拉列表(省份)”。
该数据接口的类型为“下拉列表”,“取值”来自“数据表”“本模板”的“城市”数据项;需要筛选指定“省份”的城市列表,设置“过滤设置”,选择“表达式过滤”,添加参数“省份”,并填写“过滤条件”;③在《省市区》模板中设计数据接口“查询地区下拉列表(省份,城市)”。
该数据接口的类型为“下拉列表”,“取值”来自“数据表”“本模板”的“地区”数据项;需要筛选指定“省份”和“城市”的城市列表,设置“过滤设置”,选择“表达式过滤”,添加参数“省份”和“城市”,并填写“过滤条件”;④在《客户档案》的填写规范中调用已设置的数据接口。
进入《客户档案》的模板设计界面,打开“数据定义管理”,在“省份”的填写规范上调用《省市区》的“省下拉列表”;⑤在“城市”的填写规范上调用《省市区》的“查询城市下拉列表(省份)”,该数据接口带有1个参数,将“本表单.省份”赋值给参数,并勾选“必填”,则只有当“本表单的省份”填写后,再单击城市的【﹀】才会运行该数据接口进行查询;⑥在“地区”的填写规范上调用《省市区》的“查询地区下拉列表(省份,城市)”,该数据接口带有2个参数,将“本表单.省份”和“本表单.城市”赋值给参数,并勾选“必填”,则只有当“本表单的省份和城市”都填写后,再单击地区的【﹀】才会运行该数据接口进行查询;这种实现方式用户需要单击进行选择,选项过多时,比较浪费时间,是否可以根据用户知道某几个字模糊查询并选择填写提高效率呢?二、列表选择联动在“省份”上填写内容后,下方根据填写的内容弹出模糊查询符合条件的省份列表,选择省份“广东省”,在“城市”上填写内容时,下方根据填写的内容在“广东省”内模查询符合条件的城市列表,在“地区”上填写内容后,下方根据填写的内容,在“广东省广州市”内模糊查询符合条件的地区列表;实现分析:省市区基础数据存放在《省市区》模板中,需要设计3个数据列表选择的数据接口,勾选“支持模糊查询”。
小程序省市区联动三种方法
小程序省市区联动三种方法一、通过接口获取省市区数据1.获取省份数据:从接口获取所有省份列表,返回一个包含所有省份信息的数组。
2.根据选中的省份获取城市数据:通过接口传递选中的省份ID,获取该省份下所有城市的列表,返回一个包含所有城市信息的数组。
3.根据选中的城市获取区域数据:通过接口传递选中的城市ID,获取该城市下所有区域的列表,返回一个包含所有区域信息的数组。
二、通过JSON数据获取省市区数据1.创建一个包含所有省份、城市和区域的JSON数据文件,格式如下:"province":"name": "省份1","city":"name": "城市1","area": ["区域1", "区域2", ...]},"name": "城市2","area": ["区域1", "区域2", ...]},...},"name": "省份2","city":"name": "城市1","area": ["区域1", "区域2", ...]},"name": "城市2","area": ["区域1", "区域2", ...]},...},...2. 通过AJAX请求获取JSON数据文件,并解析为一个包含所有省份、城市和区域信息的JavaScript对象。
3.根据选中的省份、城市,动态生成相应的区域选项。
解析高德地图api获取省市区,生成最新三级联动sql表
解析⾼德地图api获取省市区,⽣成最新三级联动sql表前⾔: 最近项⽬中⽤到了全国省市区三级信息,但是⽹上找到的信息都是⽐较旧的信息。
与现在最新的地区信息匹配不上。
后来想到⾼德地图上可能有这些信息。
所以解析了⼀下api接⼝,⽣成了相关省市区的sql信息。
(注意:这⾥⾯没有港台地区)具体的请参看⾼德地图⽂档。
alibaba.fastjson解析+mysql表 具体数据接⼝: 申请的key 注意:如果想调⽤此接⼝需要申请⼀个key,免费的,注册就可以获取3、java代码如下:@RequestMapping("/getAll")public Object getMasterList() throws Exception {HttpClientResult result = HttpClientUtils.doGet("https:///v3/config/district?subdistrict=4&key=⾃⼰申请的key");String jsonString = result.getContent();//数据结构如下/* String jsonString = "{\n" +" \"status\": \"1\",\n" +" \"info\": \"OK\",\n" +" \"infocode\": \"10000\",\n" +" \"count\": \"1\",\n" +" \"suggestion\": {\n" +" \"keywords\": [],\n" +" \"cities\": []\n" +" },\n" +" \"districts\": [{\n" +" \"citycode\": [],\n" +" \"adcode\": \"100000\",\n" +" \"name\": \"中华⼈民共和国\",\n" +" \"center\": \"116.3683244,39.915085\",\n" +" \"level\": \"country\",\n" +" \"districts\": [{\n" +" \"citycode\": [],\n" +" \"adcode\": \"410000\",\n" +" \"name\": \"河南省\",\n" +" \"center\": \"113.665412,34.757975\",\n" +" \"level\": \"province\",\n" +" \"districts\": [{\n" +" \"citycode\": \"0393\",\n" +" \"adcode\": \"410900\",\n" +" \"name\": \"濮阳市\",\n" +" \"center\": \"115.041299,35.768234\",\n" +" \"level\": \"city\",\n" +" \"districts\": [{\n" +" \"citycode\": \"0393\",\n" +" \"adcode\": \"410923\",\n" +" \"name\": \"南乐县\",\n" +" \"center\": \"115.204336,36.075204\",\n" +" \"level\": \"district\",\n" +" \"districts\": [{\n" +" \"citycode\": \"0393\",\n" +" \"adcode\": \"410923\",\n" +" \"name\": \"福坎镇\",\n" +" \"center\": \"115.398,36.0869\",\n" +" \"level\": \"street\",\n" +" \"districts\": []\n" +" }]\n" +" }]\n" +" }]\n" +" }]\n" +" }]\n" +"}";//result.getContent();*/JSONObject jsonObject = JSONObject.parseObject(jsonString);//获取到国家及下⾯所有的信息开始循环插⼊,这⾥可以写成递归调⽤,但是不如这样⽅便查看、理解JSONArray countryAll = jsonObject.getJSONArray("districts");for (int i = 0; i < countryAll.size(); i++) {JSONObject countryLeve0 = countryAll.getJSONObject(i);String citycode0 = countryLeve0.getString("citycode");String adcode0 = countryLeve0.getString("adcode");String name0 = countryLeve0.getString("name");String center0 = countryLeve0.getString("center");String country = countryLeve0.getString("level");int level = 0;if (country.equals("country")) {level = 0;}//插⼊国家Integer id1 = insert(0, adcode0, citycode0, name0, center0, level, name0);JSONArray province0 = countryLeve0.getJSONArray("districts");for (int j = 0; j < province0.size(); j++) {JSONObject province1 = province0.getJSONObject(j);String citycode1 = province1.getString("citycode");String adcode1 = province1.getString("adcode");String name1 = province1.getString("name");String center1 = province1.getString("center");String province = province1.getString("level");int level1 = 0;if (province.equals("province")) {level1 = 1;}//插⼊省Integer id2 = insert(id1, adcode1, citycode1, name1, center1, level1, name0, name1);JSONArray city0 = province1.getJSONArray("districts");for (int z = 0; z < city0.size(); z++) {JSONObject city2 = city0.getJSONObject(z);String citycode2 = city2.getString("citycode");String adcode2 = city2.getString("adcode");String name2 = city2.getString("name");String center2 = city2.getString("center");String city = city2.getString("level");int level2 = 0;if (city.equals("city")) {level2 = 2;}//插⼊市Integer id3 = insert(id2, adcode2, citycode2, name2, center2, level2, name0, name1, name2);JSONArray street0 = city2.getJSONArray("districts");for (int w = 0; w < street0.size(); w++) {JSONObject street3 = street0.getJSONObject(w);String citycode3 = street3.getString("citycode");String adcode3 = street3.getString("adcode");String name3 = street3.getString("name");String center3 = street3.getString("center");String street = street3.getString("level");int level3 = 0;if (street.equals("street")) {level3 = 2;}//插⼊区县insert(id3, adcode3, citycode3, name3, center3, level3, name0, name1, name2, name3);// JSONArray street = street3.getJSONArray("districts");//有需要可以继续向下遍历}}}}return getSuccessResult();}/*** 公共的插⼊⽅法** @param parentId ⽗id* @param citycode 城市编码* @param adcode 区域编码街道没有独有的adcode,均继承⽗类(区县)的adcode* @param name 城市名称(⾏政区名称)* @param center 地理坐标* @param level 等级 0 国家,1省,...依次排* @param mergeName 把名称拼接成全名* @return*/public Integer insert(Integer parentId, String citycode, String adcode, String name, String center, int level, String... mergeName) {// \"citycode\": [],\n" +// " \"adcode\": \"100000\",\n" +// " \"name\": \"中华⼈民共和国\",\n" +// " \"center\": \"116.3683244,39.915085\",\n" +// " \"level\": \"country\",\n" +RegionAmap record = new RegionAmap();if (!adcode.equals("[]")) {record.setAdcode(adcode);}record.setCitycode(Integer.parseInt(citycode));record.setCenter(center);record.setLevel(level);record.setName(name);record.setParentId(parentId);String megName = "";for (int i = 0; i < mergeName.length; i++) {megName = megName + mergeName[i];if (i < mergeName.length - 1) {megName = megName + ",";}}record.setMergerName(megName);regionAmapMapperCustom.insertSelective(record);return record.getCitycode();}/*** ⽣成的sql顺序重新排序** @return*/@RequestMapping("/order")public Object order() {RegionAmapExample example = new RegionAmapExample();example.setOrderByClause("citycode, adcode");List<RegionAmap> selectByExample = regionAmapMapperCustom.selectByExample(example);for (RegionAmap regionAmap : selectByExample) {RegionOrder record = new RegionOrder();record.setAdcode(regionAmap.getAdcode());record.setCitycode(regionAmap.getCitycode());record.setCenter(regionAmap.getCenter());record.setLevel(regionAmap.getLevel());record.setMergerName(regionAmap.getMergerName());record.setName(regionAmap.getName());record.setParentId(regionAmap.getParentId());regionOrderMapper.insertSelective(record);}return getSuccessResult();}注意:第⼀次调⽤接⼝解析的省市区不是按顺序解析,需要调⽤排序接⼝重新⽣成。
省市联动数据库
--创建DBTblArea数据库create database DBTblAreause DBTblAreago--创建TblArea表create table TblArea(AreaId int primary key,AreaName varchar(50) not null,AreaPId int not null)---------------------------------------------------------------------------------------------------------------------------------------- --中国34个省级行政单位 23个省 5个自治区 4个直辖市 2特别行政区insert into TblArea values(1,'北京市',0)insert into TblArea values(2,'天津市',0)insert into TblArea values(3,'上海市',0)insert into TblArea values(4,'重庆市',0)insert into TblArea values(5,'河北省',0)insert into TblArea values(6,'山西省',0)insert into TblArea values(7,'台湾省',0)insert into TblArea values(8,'辽宁省',0)insert into TblArea values(9,'吉林省',0)insert into TblArea values(10,'黑龙江省',0)insert into TblArea values(11,'江苏省',0)insert into TblArea values(12,'浙江省',0)insert into TblArea values(13,'安徽省',0)insert into TblArea values(14,'福建省',0)insert into TblArea values(15,'江西省',0)insert into TblArea values(16,'山东省',0)insert into TblArea values(17,'河南省',0)insert into TblArea values(18,'湖北省',0)insert into TblArea values(19,'湖南省',0)insert into TblArea values(20,'广东省',0)insert into TblArea values(21,'甘肃省',0)insert into TblArea values(22,'四川省',0)insert into TblArea values(23,'贵州省',0)insert into TblArea values(24,'海南省',0)insert into TblArea values(25,'云南省',0)insert into TblArea values(26,'青海省',0)insert into TblArea values(27,'陕西省',0)insert into TblArea values(28,'广西壮族自治区',0)insert into TblArea values(29,'西藏自治区',0)insert into TblArea values(30,'宁夏回族自治区',0)insert into TblArea values(31,'新疆维吾尔自治区',0)insert into TblArea values(32,'内蒙古自治区',0)insert into TblArea values(33,'澳门特别行政区',0)insert into TblArea values(34,'香港特别行政区',0)------------------------------------------------------------------------------------------------------------------------------------------ --插入各个省的城市数据--4个直辖市insert into TblArea values(35,'北京市',1)insert into TblArea values(36,'天津市',2)insert into TblArea values(37,'上海市',3)insert into TblArea values(38,'重庆市',4)--5河北省(2005年辖:11个地级市,36个市辖区、22个县级市、108个县、6个自治县)insert into TblArea values(39,'石家庄市',5)insert into TblArea values(40,'唐山市',5)insert into TblArea values(41,'秦皇岛市',5)insert into TblArea values(42,'邯郸市',5)insert into TblArea values(43,'邢台市',5)insert into TblArea values(44,'保定市',5)insert into TblArea values(45,'张家口市',5)insert into TblArea values(46,'承德市',5)insert into TblArea values(47,'沧州市',5)insert into TblArea values(48,'廊坊市',5)insert into TblArea values(49,'衡水市',5)--6山西省11个城市insert into TblArea values(50,'太原市',6)insert into TblArea values(51,'大同市',6)insert into TblArea values(52,'阳泉市',6)insert into TblArea values(53,'长治市',6)insert into TblArea values(54,'晋城市',6)insert into TblArea values(55,'朔州市',6)insert into TblArea values(56,'晋中市',6)insert into TblArea values(57,'运城市',6)insert into TblArea values(58,'忻州市',6)insert into TblArea values(59,'临汾市',6)insert into TblArea values(60,'吕梁市',6)--7台湾省(台湾本岛与澎湖共设7市、16县,其中台北市与高雄市为“院辖市”,直属“行政院”,其余属台湾省;市下设区,县下设市(县辖市)、镇、乡,合称区市镇乡。
省市联动效果的简单实现代码(推荐)
省市联动效果的简单实现代码(推荐)下拉框⼆级联动效果在⽇常应⽤场景中经常会碰到,尤其是涉及地区、品种等有多级选项时。
例如:常见的省市联动下拉框,在选择省份时,城市列表也会更随改变。
思路:1,所谓联动效果,是指出发⽗级的数据变化时,会影响到关联性⼦级数据元素的变化。
下⾯是造的省市的数据:var linkDatas = {provinces:[{"code":"0","name":"请选择"},{"code":"1","name":"北京"},{"code":"2","name":"天津"},{"code":"3","name":"河北"},{"code":"4","name":"湖北"},{"code":"5","name":"⼴东"},{"code":"6","name":"其他"}],citys:{0:["请选择"],1:["朝阳区","海淀区","东城区","西城区","房⼭区","其他"],2:["天津"],3:["沧州","⽯家庄",4:["武汉市","宜昌市","襄樊市","其他"],5:["⼴州市","深圳市","汕头市","佛⼭市","珠海市","其他"],6:["其他"]}};2,根据数据动态⽣成option节点:function addOptions(target,options){var optionEle = null,target = target,option = options,optionLen = options.length;for(var i = 0;i < optionLen;i++){optionEle = document.createElement('option');optionEle.value = option[i].value;optionEle.text = option[i].text;target.options.add(optionEle);}}3,根据上述省市数据,其中code代表“省级”指向“城市”的标识符,当省级的数据变更时,出发change事件:pro.onchange = function(){console.log(this);var ct = city[this.value],ctLen = ct.length,ctBox = [];c.innerHTML = "";/*添加城市*/for(var j = 0;j < ctLen;j++){ctBox.push({"text" : ct[j],"value": ct[j]});}addOptions(c,ctBox);}HTML代码:<div class="content"><h3>下拉框联动效果</h3><p>省份:<select name="provinces" id="provinces"></select></p><p>市:<select name="citys" id="citys"></select></p></div>全部JavaScript代码:"code":"0","name":"请选择"},{"code":"1","name":"北京"},{"code":"2","name":"天津"},{"code":"3","name":"河北"},{"code":"4","name":"湖北"},{"code":"5","name":"⼴东"},{"code":"6","name":"其他"}],citys:{0:["请选择"],1:["朝阳区","海淀区","东城区","西城区","房⼭区","其他"],2:["天津"],3:["沧州","⽯家庄","秦皇岛","其他"],4:["武汉市","宜昌市","襄樊市","其他"],5:["⼴州市","深圳市","汕头市","佛⼭市","珠海市","其他"],6:["其他"]}};function addOptions(target,options){ var optionEle = null,target = target,option = options,optionLen = options.length;for(var i = 0;i < optionLen;i++){optionEle = document.createElement('option');optionEle.value = option[i].value;optionEle.text = option[i].text;target.options.add(optionEle);}}function provincesCitysLink(pro,c){var LD = linkDatas,provinces = LD.provinces,city = LD.citys,initCity = city[0],proBox = [];/*添加省份*/for(var i = 0;i < provinces.length;i++){proBox.push({"text" : provinces[i].name,"value": provinces[i].code})}addOptions(pro,proBox);/*初始化城市*/addOptions(c,[{"text" : initCity,"value": initCity}]);/*添加联动事件*/pro.onchange = function(){console.log(this);var ct = city[this.value],ctLen = ct.length,ctBox = [];c.innerHTML = "";/*添加城市*/for(var j = 0;j < ctLen;j++){ctBox.push({"text" : ct[j],"value": ct[j]});}addOptions(c,ctBox);}}var provinces = document.getElementById('provinces'),citys = document.getElementById('citys');provincesCitysLink(provinces,citys);以上这篇省市联动效果的简单实现代码(推荐)就是⼩编分享给⼤家的全部内容了,希望能给⼤家⼀个参考,也希望⼤家多多⽀持。
全国行政区域四级联动数据
3.1.3 = 桥西区
3.1.4 = 新华区
3.1.5 = 井陉矿区
3.1.6 = 裕华区
3.1.7 = 辛集市
3.1.8 = 藁城市
3.1.9 = 晋州市
3.1.10 = 新乐市
3.1.11 = 鹿泉市
3.1.12 = 井陉县
3.1.13 = 正定县
4.4.12 = 沁源县
4.4.13 = 潞城市
4.5 = 晋城市
4.5.1 = 城区
4.5.2 = 沁水县
4.5.3 = 阳城县
4.5.4 = 陵川县
4.5.5 = 泽州县
4.5.6 = 高平市
4.6 = 朔州市
4.6.1 = 朔城区
4.6.2 = 平鲁区
3.5.6 = 临城县
3.5.7 = 内丘县
3.5.8 = 柏乡县
3.5.9 = 隆尧县
3.5.10 = 任 县
3.5.11 = 南和县
3.5.12 = 宁晋县
3.5.13 = 巨鹿县
3.5.14 = 新河县
3.5.15 = 广宗县
3.5.16 = 平乡县
3.4.14 = 邱 县
3.4.15 = 鸡泽县
3.4.16 = 广平县
3.4.17 = 馆陶县
3.4.18 = 魏 县
3.4.19 = 曲周县
3.5 = 邢台市
3.5.1 = 桥东区
3.5.2 = 桥西区
3.5.3 = 南宫市
3.5.4 = 沙河市
3.5.5 = 邢台县
4.9.6 = 宁武县
4.9.7 = 静乐县
省市区多级联动数据组合
省市区多级联动数据组合话不多说,直接说重点。
最近⽤到了省市区数据联动。
数据格式是这样的:$array = [0 => ['id' => 1,'pid' => 0,'name' => 't1',],1 => ['id' => 2,'pid' => 0,'name' => 't2',],2 => ['id' => 3,'pid' => 0,'name' => 't3',],3 => ['id' => 4,'pid' => 1,'name' => 't1-t4',],4 => ['id' => 5,'pid' => 2,'name' => 't2-t5',],5 => ['id' => 6,'pid' => 4,'name' => 't1-t4-t6',],];返回格式要求是这样的:Array([0] => Array([id] => 1[pid] => 0[name] => t1[child] => Array([0] => Array([id] => 4[pid] => 1[name] => t1-t4[child] => Array([0] => Array([id] => 6[pid] => 4[name] => t1-t4-t6)))))[1] => Array([id] => 2[pid] => 0[name] => t2[child] => Array([0] => Array([id] => 5[pid] => 2[name] => t2-t5)))[2] => Array([id] => 3[pid] => 0[name] => t3))在知道数组层级且层级⽐较少的情况下,最简单粗暴的⽅式当然是多层遍历组装数组。
省市区三级联动
string sheng = context.Request.Form["Province"] == null ? "" : context.Request.Form["Province"]; string str = "select * from cities where provinceid='" + sheng + "'"; using (SqlDataAdapter ada = new SqlDataAdapter(str, conn)) {
$("#sheng").val("赋值"); GetShi();
$("#Shi").val("赋值"); GetQu(); $("@Qu").val("赋值"); }
})
function GetSheng() { $("#Sheng").empty(); $("#Sheng").append("<option value='0'>请选择</option>"); $.ajax({ type: "post", url: "GetJsonData.ashx", datatype: "josn", //数据类型 data: "type=GetProvince", async: false, //把异步改为同步 success: function (data) { var GetData = eval(data); //转一下型,GetData相当于一张表的模型了,打点就可以调用字段 $.each(GetData, function (i, item) { $("#Sheng").append("<option value='" + item.provinceid + "'>" + item.province + "</option>"); }) } }) GetShi();
210990412_山东省地理信息公共服务平台数据省市县联动更新体系研究
智能智造与信息技山东省地理信息公共服务平台数据省市县联动更新体系研究仲佳王永(山东省国土测绘院山东济南250100)摘 要:本文针对山东省地理信息公共服务平台数据更新存在的市县年度更新机制缺失、数据更新发布周期长、省市县更新缺乏联动等问题,提出通过基于地理信息多渠道发现、多尺度融合等手段,建立省、市、县分工协同更新机制,编制全省数据更新和地名地址统一标准,运用专业软件定制等技术辅助,充分发挥省、市、县各自的优势,构建省级地理信息公共服务平台数据省市县联动更新体系。
关键词:联动更新更新体系数据标准更新机制中图分类号:P208文献标识码:A文章编号:1674-098X(2022)07(c)-0087-03山东省地理信息公共服务平台为政务信息化建设、应急指挥、重大规划、社会管理、产业发展等提供了权威、便捷的一站式地理信息服务。
随着经济社会的快速发展,政府各部门及社会公众对地理信息数据的需求量越来越大,对数据的现势性要求越来越高。
山东省地理信息公共服务平台自建成以来,应用不断深入,用户不断增多,随着市县平台、“数字城市”逐渐接入省平台,进一步丰富了平台的数据资源,使平台集成了海量基础地理信息资源。
想要日益科学有效地满足社会各个领域对平台的应用需求,大力推进省、市、县多级地理信息资源的整合联动,已经成为当前山东省信息化建设的必然发展趋势[1]。
当前,基于影像的快速变化发现和多源数据融合等更新技术手段多样,大大提高了地理信息数据的更新效率。
但是,平台采用原有传统测绘数据更新模式存在较大问题:(1)市县年度更新机制缺失,只有经济发展好、技术支撑强的少数几个市县建立了年度数据更新机制;(2)从数据更新到发布周期长,各县市普遍基于1∶500地形图进行数据更新,从数据采集、质检、验收到发布周期一般在一年以上,数据时效性不高;(3)省市县更新缺乏联动,同一区域要素往往重复测绘,尤其城区地理要素重复采集现象比较突出;(4)现有数据标准编制图,其社会化属性凸现不足,数据实体化程度不高,不满足公共服务需求[2]。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
insert into city values(10,'桃园县',7)
insert into city values(11,'新竹县',7)
insert into city values(12,'苗栗县',7)
insert into city values(21,'澎湖县',7)
insert into city values(22,'台东县',7)
insert into city values(23,'花莲县',7)
--8辽宁省(2006年,辖:14个地级市;56个市辖区、17个县级市、19个县、8个自治县。)
insert into city values(9,'沧州市',5)
insert into city values(10,'廊坊市',5)
insert into city values(11,'衡水市',5)
--6山西省11个城市
insert into city values(1,'太原市',6)
--中国34个省级行政单位 23个省 5个自治区 4个直辖市 2特别行政区
insert into promary values(1,'北京市')
insert into promary values(2,'天津市')
insert into promary values(3,'上海市')
insert into promary values(12,'浙江省')
insert into promary values(13,'安徽省')
insertቤተ መጻሕፍቲ ባይዱinto promary values(14,'福建省')
insert into promary values(15,'江西省')
insert into promary values(20,'广东省')
insert into promary values(21,'甘肃省')
insert into promary values(22,'四川省')
insert into promary values(24,'贵州省')
create table promary
(
proID int primary key,
proName varchar(50) not null
)
----------------------------------------------------------------------------------------------------------------------------------------
insert into promary values(25,'海南省')
insert into promary values(26,'云南省')
insert into promary values(27,'青海省')
insert into promary values(28,'陕西省')
insert into city values(5,'台南市',7)
insert into city values(6,'新竹市',7)
insert into city values(7,'嘉义市',7)
insert into city values(8,'台北县',7)
insert into city values(6,'朔州市',6)
insert into city values(7,'晋中市',6)
insert into city values(8,'运城市',6)
insert into city values(9,'忻州市',6)
insert into promary values(29,'广西壮族自治区')
insert into promary values(30,'西藏自治区')
insert into promary values(31,'宁夏回族自治区')
insert into promary values(32,'维吾尔自治区')
insert into city values(10,'临汾市',6)
insert into city values(11,'吕梁市',6)
--7台湾省(台湾本岛和澎湖共设7市、16县,其中台北市和高雄市为“院辖市”,直属“行政院”,其余属台湾省;市下设区,县下设市(县辖市)、镇、乡,合称区市镇乡。)
--插入各个省的城市数据
--4个直辖市
insert into city values(1,'北京市',1)
insert into city values(1,'天津市',2)
insert into city values(1,'上海市',3)
insert into city values(2,'大同市',6)
insert into city values(3,'阳泉市',6)
insert into city values(4,'长治市',6)
insert into city values(5,'晋城市',6)
insert into city values(13,'台中县',7)
insert into city values(14,'彰化县',7)
insert into city values(15,'南投县',7)
insert into city values(16,'云林县',7)
insert into promary values(8,'辽宁省')
insert into promary values(9,'吉林省')
insert into promary values(10,'黑龙江省')
insert into promary values(11,'江苏省')
insert into promary values(33,'内蒙古自治区')
insert into promary values(34,'澳门特别行政区')
insert into promary values(35,'香港特别行政区')
----------------------------------------------------------------------------------------------------------------------------------------
ity values(6,'保定市',5)
insert into city values(7,'张家口市',5)
insert into city values(8,'承德市',5)
insert into city values(5,'本溪市',8)
insert into city values(6,'丹东市',8)
insert into city values(3,'秦皇岛市',5)
insert into city values(4,'邯郸市',5)
insert into city values(5,'邢台市',5)
insert into c
查看文章
省市联动数据库2010-01-18 1348--创建DBPromary数据库