risk_management.py 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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='创建时间')
  33. class RiskManagementInspectionTask(Base):
  34. __tablename__ = 'risk_management_inspection_task'
  35. id = Column(BigInteger, primary_key=True, autoincrement=True, comment='ID')
  36. task_number = Column(String(50), comment='任务编号')
  37. inspection_business = Column(String(255), nullable=True, comment='巡查业务,城市隐患巡查、森林防火巡查、重点危化企业巡查、重点水库水位巡查')
  38. start_time = Column(DateTime, nullable=True, comment='巡查开始时间')
  39. end_time = Column(DateTime, nullable=True, comment='巡查结束时间')
  40. inspection_cycle = Column(String(50), nullable=True, comment='巡查周期,每年、每月、每周、每日、一次')
  41. corn_expression = Column(String(100), nullable=True, comment='corn表达式')
  42. inspection_range = Column(String(50), nullable=True, comment='巡查范围,市级、区县级、镇街级、村居级')
  43. task_status = Column(String(20), nullable=True, comment='任务状态,未开始、进行中、未完成、已完结')
  44. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  45. create_dept = Column(BigInteger, default=None, comment='创建部门')
  46. create_by = Column(BigInteger, default=None, comment='创建者')
  47. create_time = Column(DateTime, default=datetime.now, comment='创建时间')
  48. update_by = Column(BigInteger, default=None, comment='更新者')
  49. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
  50. remark = Column(String(500), default=None, comment='备注')
  51. class RiskManagementRiskTask(Base):
  52. __tablename__ = 'risk_management_risk_task'
  53. id = Column(BigInteger, primary_key=True, autoincrement=True, comment='ID')
  54. task_number = Column(String(50), nullable=True, comment='任务编号')
  55. risk_type = Column(String(255), nullable=True, comment='风险源类型,风险源排查、隐患源排查、危险源排查')
  56. start_time = Column(DateTime, nullable=True, comment='排查开始时间')
  57. end_time = Column(DateTime, nullable=True, comment='排查结束时间')
  58. task_cycle = Column(String(50), nullable=True, comment='排查周期,每年、每月、每周、每日、一次')
  59. corn_expression = Column(String(100), nullable=True, comment='corn表达式')
  60. task_range = Column(String(50), nullable=True, comment='巡查范围,市级、区县级、镇街级、村居级')
  61. task_status = Column(String(20), nullable=True, comment='任务状态,未开始、进行中、未完成、已完结')
  62. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  63. create_dept = Column(BigInteger, default=None, comment='创建部门')
  64. create_by = Column(BigInteger, default=None, comment='创建者')
  65. create_time = Column(DateTime, default=datetime.now, comment='创建时间')
  66. update_by = Column(BigInteger, default=None, comment='更新者')
  67. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
  68. remark = Column(String(500), default=None, comment='备注')