1 Star 2 Fork 0

kugar / Kugar.Tools.CityToolUpdater

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT
用于输出新项目的城市信息,使用国家标准的编号
注意:1.插入数据之前,如果是mssql,请先确保数据库中,不存在相同名称的表结构,否则程序将会抛错
                 如果是mongodb,请先确保对应的Collection未使用,避免出现数据插入后,原有数据的混乱
	 2.直辖市的的省级编码与市级编码是一样的,在单表模式下,Type会不同


执行之前,请先按照需求修改配置 appsettings.json 文件

{
  "Type": "Mongo/MySQL/MSSQL", //使用以下两个配置数据库类型:Mongo或MSSQL

  "Mongo": {    //当使用Type= "Mongo" 时候使用该配置
    "Conn": "mongodb://127.0.0.1:37018/Test"  //数据库链接
  },
  "MSSQL": {    //当使用Type= "Mongo" 时候使用该配置
    "Conn": "Data Source=127.0.0.1,3433;Initial Catalog=Test;User ID=**;Password=*****;"  //数据库链接
  },

  "Config": {
    "Table": {
	  "Type":0,  //0= 单表方式   1=多表方式
	  "Name":"base_City", //当使用单表方式时候,使用该属性配置表名

      "City": "base_City",  //当使用多表方式时,使用一下几个配置
      "Province": "base_Province",
      "District": "base_District"
    }
  }
}


数据结构为:
	MSSQL:
		单表模式下:
			Id int
			Type integer
			Name nvarchar(100),
			Code int not null 
			ParentID int null
			ParentCode int null
			Code_Path varchar(26)  //当前节点的路径,使用下划线分隔 如 210000_211000_211001
		多表模式下:
			省:
				Id int
				Name nvarchar(100)
				Code int not null
			市:
				Id int
				Name nvarchar(100)
				Code int not null
				ProvinceID int
				ProvinceCode int not null
				Code_Path varchar(26)
			区:
				Id int
				Name nvarchar(100)
				Code int not null
				ProvinceID int
				ProvinceCode int not null
				CityID int not null
				CityCode int not null
				Code_Path varchar(26)
MIT License Copyright (c) 2019 kugar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

用于向数据库添加城市信息 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/kugar/Kugar.Tools.CityToolUpdater.git
git@gitee.com:kugar/Kugar.Tools.CityToolUpdater.git
kugar
Kugar.Tools.CityToolUpdater
Kugar.Tools.CityToolUpdater
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891