three_proofing_responsible_base.py 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 ThreeProofingResponsibleType(Base):
  31. __tablename__ = 'three_proofing_responsible_type'
  32. id = Column(Integer, primary_key=True, autoincrement=True)
  33. type_parent_id = Column(String(255), comment='责任类型id')
  34. type_name = Column(String(255), nullable=False, comment='责任类别')
  35. order_num = Column(Integer, default=100, comment='排序顺序')
  36. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  37. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  38. create_dept = Column(BigInteger, default=None, comment='创建部门')
  39. create_by = Column(BigInteger, default=None, comment='创建者')
  40. update_by = Column(BigInteger, default=None, comment='更新者')
  41. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  42. class Config:
  43. orm_mode = True
  44. class ThreeProofingResponsibleOtherType(Base):
  45. __tablename__ = 'three_proofing_responsible_other_type'
  46. id = Column(Integer, primary_key=True, autoincrement=True)
  47. type_parent_id = Column(String(255), comment='责任类型id')
  48. type_name = Column(String(255), nullable=False, comment='责任类别')
  49. order_num = Column(Integer, default=100, comment='排序顺序')
  50. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  51. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  52. create_dept = Column(BigInteger, default=None, comment='创建部门')
  53. create_by = Column(BigInteger, default=None, comment='创建者')
  54. update_by = Column(BigInteger, default=None, comment='更新者')
  55. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  56. class Config:
  57. orm_mode = True
  58. class ThreeProofingResponsiblePersonType(Base):
  59. __tablename__ = 'three_proofing_responsible_person_type'
  60. id = Column(Integer, primary_key=True, autoincrement=True)
  61. type_id = Column(String(255), comment='责任类别id')
  62. type_parent_id = Column(String(255), nullable=False, comment='责任类型id')
  63. person_id = Column(Integer, nullable=False, comment='责任人id')
  64. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  65. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  66. create_dept = Column(BigInteger, default=None, comment='创建部门')
  67. create_by = Column(BigInteger, default=None, comment='创建者')
  68. update_by = Column(BigInteger, default=None, comment='更新者')
  69. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  70. class Config:
  71. orm_mode = True
  72. class ThreeProofingResponsiblePersonOtherInfo(Base):
  73. __tablename__ = 'three_proofing_responsible_person_other_info'
  74. id = Column(Integer, primary_key=True, autoincrement=True)
  75. dept_name = Column(String(255), comment='单位名称')
  76. other_type_2_name = Column(String(255), comment='具体类型名称')
  77. denger_point_name = Column(String(255), comment='隐患点名称')
  78. type_parent_id = Column(String(255), nullable=False, comment='责任类型id')
  79. person_id = Column(Integer, nullable=False, comment='责任人id')
  80. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  81. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  82. create_dept = Column(BigInteger, default=None, comment='创建部门')
  83. create_by = Column(BigInteger, default=None, comment='创建者')
  84. update_by = Column(BigInteger, default=None, comment='更新者')
  85. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  86. class Config:
  87. orm_mode = True
  88. class ThreeProofingResponsiblePersonOtherType(Base):
  89. __tablename__ = 'three_proofing_responsible_person_other_type'
  90. id = Column(Integer, primary_key=True, autoincrement=True)
  91. other_type_id = Column(String(255), comment='其他责任类别id')
  92. type_parent_id = Column(String(255), nullable=False, comment='责任类型id')
  93. person_id = Column(Integer, nullable=False, comment='责任人id')
  94. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  95. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  96. create_dept = Column(BigInteger, default=None, comment='创建部门')
  97. create_by = Column(BigInteger, default=None, comment='创建者')
  98. update_by = Column(BigInteger, default=None, comment='更新者')
  99. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  100. class Config:
  101. orm_mode = True
  102. class ThreeProofingResponsiblePersonImportFileStatus(Base):
  103. __tablename__ = 'three_proofing_responsible_person_import_file_status'
  104. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  105. file_uuid = Column(String(255), nullable=False, comment='文件uuid名称')
  106. file_name = Column(String(255), nullable=False, comment='文件名称')
  107. error_num = Column(Integer, nullable=False,default=0, comment='错误数量')
  108. warning_num = Column(Integer, nullable=False,default=0,comment='警告数量')
  109. status = Column(String(50), nullable=False, comment='状态')
  110. create_time = Column(DateTime, default=datetime.now, comment='创建时间')
  111. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
  112. user_id = Column(String(255), nullable=False, comment='操作账号')
  113. remark = Column(Text, comment='备注')
  114. class Config:
  115. orm_mode = True