身份证前6位代码代表着城市的范围,这样用户的身份证信息就可以分析所在城市的信息了。
比如:370781,
其中370000代表山东省
370700代表潍坊市
370781代表青州市(县级市)
这样我们就可以根据370781找出山东省潍坊市青州市的信息。
现在需要最全的身份证前六位的城市代码
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for citycode
-- ----------------------------
DROP TABLE IF EXISTS `citycode`;
CREATE TABLE `citycode` (
`zip` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`father_zip` int(11) NOT NULL,
`level` int(11) NOT NULL,
`abbr_name` varchar(50) DEFAULT NULL,
`abbr_letter` varchar(50) DEFAULT NULL,
`bdmap_citycode` int(11) NOT NULL,
`is_enabled` tinyint(1) NOT NULL,
`lng_x` double NOT NULL,
`lat_y` double NOT NULL,
PRIMARY KEY (`zip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of citycode
-- ----------------------------
INSERT INTO `citycode` VALUES ('110000', '北京市', '0', '0', '京', 'BJ', '131', '0', '116.395645', '39.929986');
INSERT INTO `citycode` VALUES ('110100', '北京市', '110000', '1', '0', '0', '131', '0', '116.395645', '39.929986');
INSERT INTO `citycode` VALUES ('110101', '东城区', '110100', '2', '0', '0', '0', '0', '0', '0');
INSERT INTO `citycode` VALUES ('110102', '西城区', '110100', '2', '0', '0', '0', '0', '0', '0');
INSERT INTO `citycode` VALUES ('110103', '崇文区', '110100', '2', '0', '0', '0', '0', '0', '0');
INSERT INTO `citycode` VALUES ('110104', '宣武区', '110100', '2', '0', '0', '0', '0', '0', '0');
INSERT INTO `citycode` VALUES ('110105', '朝阳区', '110100', '2', '0', '0', '0', '0', '0', '0');
sql文件下载地址:
https://download.csdn.net/download/sunyuhua_keyboard/11268817