from sqlalchemy import create_engine, Column, BigInteger, String, Text, DateTime, CHAR,Integer,Float, Enum from database import Base from datetime import datetime class GovdataCity(Base): __tablename__ = 'govdata_city' id = Column(Integer, primary_key=True, comment='主键') name = Column(String(40), comment='省市区名称') parentid = Column(Integer, comment='上级ID') shortname = Column(String(40), comment='简称') leveltype = Column(Integer, comment='级别:0,中国;1,省分;2,市;3,区、县') citycode = Column(String(7), comment='城市代码') zipcode = Column(String(7), comment='邮编') lng = Column(String(20), comment='经度') lat = Column(String(20), comment='纬度') pinyin = Column(String(40), comment='拼音') status = Column(Enum('0', '1'), default='1', comment='状态') class Config: orm_mode = True class GovdataArea(Base): __tablename__ = 'govdata_area' id = Column(Integer, primary_key=True, comment='ID') area_code = Column(String(20), nullable=True, comment='区划编码') area_name = Column(String(50), nullable=True, comment='区划名称') parent_code = Column(String(20), nullable=True, comment='父级区划编码') parent_id = Column(Integer, nullable=True, comment='父级ID') status = Column(String(2), nullable=True, comment='状态') create_time = Column(String(255), nullable=True, comment='创建时间') class Config: orm_mode = True # 灾害信息员 class GovdataDisasterInfoOfficer(Base): __tablename__ = 'govdata_disaster_info_officer' id = Column(Integer, primary_key=True, autoincrement=True) name = Column(String, nullable=False, comment='姓名') gender = Column(String, nullable=False, comment='性别') work_unit = Column(String, nullable=False, comment='工作单位') cellphone = Column(String, nullable=False, comment='手机号码') location = Column(String, nullable=True, comment='所处位置') area = Column(String, comment='区县') longitude = Column(Float, comment='经度') latitude = Column(Float, comment='纬度') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') sign = Column(String, server_default='', default='', comment='HMACSM3数值') class Config: orm_mode = True class EmergencyExpert(Base): __tablename__ = 'emergency_expert' id = Column(Integer, primary_key=True, autoincrement=True) name = Column(String, server_default='', default='', comment='姓名') area = Column(String, server_default='', default='', comment='地区') type = Column(String, server_default='', default='', comment='类型') company = Column(String, server_default='', default='', comment='所属公司') official = Column(String, server_default='', default='', comment='职称') phone = Column(String, server_default='', default='', comment='手机号码') tjsj = Column(DateTime, default=datetime.now, comment='数据创建时间') gxsj = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') longitude = Column(Float, comment='经度') latitude = Column(Float, comment='纬度') sign = Column(String, server_default='', default='', comment='HMACSM3数值') class Config: orm_mode = True