model.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. from sqlalchemy import String, Integer, SmallInteger
  3. from sqlalchemy.orm import Mapped, mapped_column
  4. from app.core.base_model import ModelMixin, UserMixin
  5. class BizVarDictModel(ModelMixin, UserMixin):
  6. """
  7. 变量信息表
  8. """
  9. __tablename__: str = 'biz_var_dict'
  10. __table_args__: dict[str, str] = {'comment': '变量信息'}
  11. __loader_options__: list[str] = ["created_by", "updated_by"]
  12. crane_no: Mapped[str | None] = mapped_column(String(255), nullable=True, comment='')
  13. var_code: Mapped[str | None] = mapped_column(String(50), nullable=True, comment='变量code')
  14. var_name: Mapped[str | None] = mapped_column(String(50), nullable=True, comment='变量名称')
  15. mec_type: Mapped[int | None] = mapped_column(Integer, nullable=True, comment='所属机构')
  16. data_type: Mapped[int | None] = mapped_column(Integer, nullable=True, comment='数据类型')
  17. switch_type: Mapped[int | None] = mapped_column(Integer, nullable=True, comment='变量类型')
  18. addr: Mapped[str | None] = mapped_column(String(50), nullable=True, comment='modbus地址')
  19. gateway_id: Mapped[int | None] = mapped_column(Integer, nullable=True, comment='网关')
  20. var_sort: Mapped[int | None] = mapped_column(Integer, nullable=True, comment='排序')
  21. var_group: Mapped[int | None] = mapped_column(Integer, nullable=True, comment='变量分组')
  22. var_category: Mapped[int | None] = mapped_column(Integer, nullable=True, comment='变量分类')
  23. translate: Mapped[str | None] = mapped_column(String(50), nullable=True, comment='绑定公式')
  24. device_no: Mapped[str | None] = mapped_column(String(50), nullable=True, comment='关联设备编号 ')
  25. is_reverse: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否取反')
  26. is_top_show: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否重点显示')
  27. is_save: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否生成')
  28. is_calibration: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否标定')
  29. is_overview_top_show: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否首页重点显示')
  30. is_home_page_show: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否首页显示')
  31. is_diagnose: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否启用诊断专家')
  32. is_upload: Mapped[int | None] = mapped_column(SmallInteger, nullable=True, comment='是否上传云平台')
  33. diagnosis_id: Mapped[str | None] = mapped_column(String(50), nullable=True, comment='关联诊断专家')