three_proofing_responsible_base.py 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. from sqlalchemy import create_engine, Column, BigInteger, String, Text, DateTime, CHAR,Integer,Float
  2. from database import Base
  3. from datetime import datetime
  4. class ThreeProofingResponsiblePerson(Base):
  5. __tablename__ = 'three_proofing_responsible_person'
  6. id = Column(Integer, primary_key=True, autoincrement=True)
  7. unit_id = Column(Integer, comment='单位ID')
  8. unit_name = Column(String(255), nullable=False, comment='单位名称')
  9. name = Column(String(255), nullable=False, comment='联系人')
  10. area_code2 = Column(String(255), nullable=False, comment='区划编码')
  11. area_code = Column(String(255), nullable=False, comment='区划编码')
  12. position = Column(String(255), nullable=True, comment='职务')
  13. phone = Column(String(50), comment='手机号码')
  14. telephone = Column(String(255), comment='办公电话')
  15. longitude =Column(String(255), comment='经度')
  16. latitude =Column(String(255), comment='纬度')
  17. location_time =Column(DateTime, comment='最近一次打点时间')
  18. responsible_type =Column(String(255), comment='责任类型(三防、危化、森防)')
  19. order_num = Column(Integer, default=100, comment='排序顺序')
  20. user_id = Column(Integer, comment='用户id')
  21. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  22. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  23. create_dept = Column(BigInteger, default=None, comment='创建部门')
  24. create_by = Column(BigInteger, default=None, comment='创建者')
  25. update_by = Column(BigInteger, default=None, comment='更新者')
  26. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  27. sign = Column(String, server_default='', default='', comment='HMACSM3数值')
  28. class Config:
  29. orm_mode = True
  30. class ThreeProofingResponsibleAdmin(Base):
  31. __tablename__ = 'three_proofing_responsible_admin'
  32. id = Column(Integer, primary_key=True, autoincrement=True)
  33. user_id = Column(Integer, comment='用户id')
  34. area_code = Column(String(255), nullable=False, comment='区划编码')
  35. class ThreeProofingResponsibleType(Base):
  36. __tablename__ = 'three_proofing_responsible_type'
  37. id = Column(Integer, primary_key=True, autoincrement=True)
  38. type_parent_id = Column(String(255), comment='责任类型id')
  39. type_name = Column(String(255), nullable=False, comment='责任类别')
  40. order_num = Column(Integer, default=100, comment='排序顺序')
  41. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  42. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  43. create_dept = Column(BigInteger, default=None, comment='创建部门')
  44. create_by = Column(BigInteger, default=None, comment='创建者')
  45. update_by = Column(BigInteger, default=None, comment='更新者')
  46. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  47. class Config:
  48. orm_mode = True
  49. class ThreeProofingResponsibleOtherType(Base):
  50. __tablename__ = 'three_proofing_responsible_other_type'
  51. id = Column(Integer, primary_key=True, autoincrement=True)
  52. type_parent_id = Column(String(255), comment='责任类型id')
  53. type_name = Column(String(255), nullable=False, comment='责任类别')
  54. order_num = Column(Integer, default=100, comment='排序顺序')
  55. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  56. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  57. create_dept = Column(BigInteger, default=None, comment='创建部门')
  58. create_by = Column(BigInteger, default=None, comment='创建者')
  59. update_by = Column(BigInteger, default=None, comment='更新者')
  60. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  61. class Config:
  62. orm_mode = True
  63. class ThreeProofingResponsiblePersonType(Base):
  64. __tablename__ = 'three_proofing_responsible_person_type'
  65. id = Column(Integer, primary_key=True, autoincrement=True)
  66. type_id = Column(String(255), comment='责任类别id')
  67. type_parent_id = Column(String(255), nullable=False, comment='责任类型id')
  68. person_id = Column(Integer, nullable=False, comment='责任人id')
  69. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  70. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  71. create_dept = Column(BigInteger, default=None, comment='创建部门')
  72. create_by = Column(BigInteger, default=None, comment='创建者')
  73. update_by = Column(BigInteger, default=None, comment='更新者')
  74. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  75. class Config:
  76. orm_mode = True
  77. class ThreeProofingResponsiblePersonOtherInfo(Base):
  78. __tablename__ = 'three_proofing_responsible_person_other_info'
  79. id = Column(Integer, primary_key=True, autoincrement=True)
  80. dept_name = Column(String(255), comment='单位名称')
  81. other_type_2_name = Column(String(255), comment='具体类型名称')
  82. denger_point_name = Column(String(255), comment='隐患点名称')
  83. type_parent_id = Column(String(255), nullable=False, comment='责任类型id')
  84. person_id = Column(Integer, nullable=False, comment='责任人id')
  85. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  86. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  87. create_dept = Column(BigInteger, default=None, comment='创建部门')
  88. create_by = Column(BigInteger, default=None, comment='创建者')
  89. update_by = Column(BigInteger, default=None, comment='更新者')
  90. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  91. class Config:
  92. orm_mode = True
  93. class ThreeProofingResponsiblePersonOtherType(Base):
  94. __tablename__ = 'three_proofing_responsible_person_other_type'
  95. id = Column(Integer, primary_key=True, autoincrement=True)
  96. other_type_id = Column(String(255), comment='其他责任类别id')
  97. type_parent_id = Column(String(255), nullable=False, comment='责任类型id')
  98. person_id = Column(Integer, nullable=False, comment='责任人id')
  99. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  100. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  101. create_dept = Column(BigInteger, default=None, comment='创建部门')
  102. create_by = Column(BigInteger, default=None, comment='创建者')
  103. update_by = Column(BigInteger, default=None, comment='更新者')
  104. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  105. class Config:
  106. orm_mode = True
  107. class ThreeProofingResponsiblePersonImportFileStatus(Base):
  108. __tablename__ = 'three_proofing_responsible_person_import_file_status'
  109. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  110. file_uuid = Column(String(255), nullable=False, comment='文件uuid名称')
  111. file_name = Column(String(255), nullable=False, comment='文件名称')
  112. error_num = Column(Integer, nullable=False,default=0, comment='错误数量')
  113. warning_num = Column(Integer, nullable=False,default=0,comment='警告数量')
  114. status = Column(String(50), nullable=False, comment='状态')
  115. create_time = Column(DateTime, default=datetime.now, comment='创建时间')
  116. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
  117. user_id = Column(String(255), nullable=False, comment='操作账号')
  118. remark = Column(Text, comment='备注')
  119. class Config:
  120. orm_mode = True