risk_management.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from sqlalchemy import create_engine, Column, BigInteger, String, Text, DateTime, CHAR,Integer
  2. from database import Base
  3. from datetime import datetime
  4. class RiskManagementInspectionUser(Base):
  5. __tablename__ = 'risk_management_inspection_user'
  6. id = Column(BigInteger, primary_key=True, autoincrement=True, comment='ID')
  7. user_id = Column(BigInteger, nullable=False, comment='用户ID')
  8. dept_id = Column(BigInteger, nullable=True, comment='部门ID')
  9. dept_name = Column(String(30), nullable=True, comment='部门名称')
  10. ancestors_names = Column(Text, nullable=True, comment='部门路径')
  11. user_name = Column(String(30), nullable=False, comment='用户账号')
  12. nick_name = Column(String(30), nullable=False, comment='用户昵称')
  13. phonenumber = Column(String(11), default='', comment='手机号码')
  14. area_code = Column(String(11), default='', comment='责任区划编码')
  15. area = Column(String(11), default='', comment='责任区划')
  16. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  17. create_dept = Column(BigInteger, default=None, comment='创建部门')
  18. create_by = Column(BigInteger, default=None, comment='创建者')
  19. create_time = Column(DateTime, default=datetime.now, comment='创建时间')
  20. update_by = Column(BigInteger, default=None, comment='更新者')
  21. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
  22. remark = Column(String(500), default=None, comment='备注')
  23. yzy_account = Column(String(50), default=None, comment='粤政易账号')
  24. class GovdataArea(Base):
  25. __tablename__ = 'govdata_area'
  26. id = Column(Integer, primary_key=True, comment='ID')
  27. area_code = Column(String(20), nullable=True, comment='区划编码')
  28. area_name = Column(String(50), nullable=True, comment='区划名称')
  29. parent_code = Column(String(20), nullable=True, comment='父级区划编码')
  30. parent_id = Column(Integer, nullable=True, comment='父级ID')
  31. status = Column(String(2), nullable=True, comment='状态')
  32. create_time = Column(String(255), nullable=True, comment='创建时间')