city_base.py 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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
  66. class GovdataEmergencyResponse(Base):
  67. __tablename__ = 'govdata_emergency_response'
  68. id = Column(Integer, primary_key=True, autoincrement=True)
  69. area_code = Column(String, nullable=False, comment='姓名')
  70. created_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  71. response_addr = Column(String, nullable=False, comment='应急响应地址')
  72. response_level = Column(String, nullable=False, comment='应急响应级别')
  73. response_status = Column(String, nullable=True, comment='应急响应状态 0 启动 1 结束 2 调整')
  74. response_status_desc = Column(String, comment='应急响应状态描述')
  75. response_time = Column(String, comment='应急响应时间')
  76. response_type_old = Column(String, comment='应急响应类型(旧数据)')
  77. response_type = Column(String, comment='应急响应类型(1:防风2:防汛3:防旱4:防冻6:防暴雨)')
  78. del_flag = Column(String, comment='是否删除(0:否 1:是)')
  79. created_by = Column(String, comment='创建人ID')
  80. created_user = Column(String, comment='创建人姓名')
  81. data_insert_time = Column(DateTime, default=datetime.now, comment='数据新増时间')
  82. data_update_time = Column(DateTime, default=datetime.now, comment='数据更新时间')
  83. data_update_flag = Column(String, comment='数据操作标识')
  84. class Config:
  85. orm_mode = True