city_base.py 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 Config:
  18. orm_mode = True
  19. class GovdataArea(Base):
  20. __tablename__ = 'govdata_area'
  21. id = Column(Integer, primary_key=True, comment='ID')
  22. area_code = Column(String(20), nullable=True, comment='区划编码')
  23. area_name = Column(String(50), nullable=True, comment='区划名称')
  24. parent_code = Column(String(20), nullable=True, comment='父级区划编码')
  25. parent_id = Column(Integer, nullable=True, comment='父级ID')
  26. status = Column(String(2), nullable=True, comment='状态')
  27. create_time = Column(String(255), nullable=True, comment='创建时间')
  28. class Config:
  29. orm_mode = True
  30. # 灾害信息员
  31. class GovdataDisasterInfoOfficer(Base):
  32. __tablename__ = 'govdata_disaster_info_officer'
  33. id = Column(Integer, primary_key=True, autoincrement=True)
  34. name = Column(String, nullable=False, comment='姓名')
  35. gender = Column(String, nullable=False, comment='性别')
  36. work_unit = Column(String, nullable=False, comment='工作单位')
  37. cellphone = Column(String, nullable=False, comment='手机号码')
  38. location = Column(String, nullable=True, comment='所处位置')
  39. area = Column(String, comment='区县')
  40. longitude = Column(Float, comment='经度')
  41. latitude = Column(Float, comment='纬度')
  42. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  43. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  44. create_dept = Column(BigInteger, default=None, comment='创建部门')
  45. create_by = Column(BigInteger, default=None, comment='创建者')
  46. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  47. sign = Column(String, server_default='', default='', comment='HMACSM3数值')
  48. class Config:
  49. orm_mode = True
  50. class EmergencyExpert(Base):
  51. __tablename__ = 'emergency_expert'
  52. id = Column(Integer, primary_key=True, autoincrement=True)
  53. name = Column(String, server_default='', default='', comment='姓名')
  54. area = Column(String, server_default='', default='', comment='地区')
  55. type = Column(String, server_default='', default='', comment='类型')
  56. company = Column(String, server_default='', default='', comment='所属公司')
  57. official = Column(String, server_default='', default='', comment='职称')
  58. phone = Column(String, server_default='', default='', comment='手机号码')
  59. tjsj = Column(DateTime, default=datetime.now, comment='数据创建时间')
  60. gxsj = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  61. longitude = Column(Float, comment='经度')
  62. latitude = Column(Float, comment='纬度')
  63. sign = Column(String, server_default='', default='', comment='HMACSM3数值')
  64. class Config:
  65. orm_mode = True