city_base.py 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. from sqlalchemy import create_engine, Column, BigInteger, String, Text, DateTime, CHAR,Integer,Float, Enum
  2. from database import Base
  3. from datetime import datetime
  4. class GovdataCity(Base):
  5. __tablename__ = 'govdata_city'
  6. id = Column(Integer, primary_key=True, comment='主键')
  7. name = Column(String(40), comment='省市区名称')
  8. parentid = Column(Integer, comment='上级ID')
  9. shortname = Column(String(40), comment='简称')
  10. leveltype = Column(Integer, comment='级别:0,中国;1,省分;2,市;3,区、县')
  11. citycode = Column(String(7), comment='城市代码')
  12. zipcode = Column(String(7), comment='邮编')
  13. lng = Column(String(20), comment='经度')
  14. lat = Column(String(20), comment='纬度')
  15. pinyin = Column(String(40), comment='拼音')
  16. status = Column(Enum('0', '1'), default='1', comment='状态')
  17. class GovdataArea(Base):
  18. __tablename__ = 'govdata_area'
  19. id = Column(Integer, primary_key=True, comment='ID')
  20. area_code = Column(String(20), nullable=True, comment='区划编码')
  21. area_name = Column(String(50), nullable=True, comment='区划名称')
  22. parent_code = Column(String(20), nullable=True, comment='父级区划编码')
  23. parent_id = Column(Integer, nullable=True, comment='父级ID')
  24. status = Column(String(2), nullable=True, comment='状态')
  25. create_time = Column(String(255), nullable=True, comment='创建时间')