天天看點

身份證前6位城市代碼

身份證前6位代碼代表着城市的範圍,這樣使用者的身份證資訊就可以分析所在城市的資訊了。

比如:370781,

其中370000代表山東省

370700代表濰坊市

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');      

繼續閱讀