device_info.py 1.1 KB

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter database
  5. name:device_info.py
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class Device_info(Base):
  10. __table__ = 'device_info'
  11. __comment__ = '设备管理'
  12. id = Fields(type='uuid', primaryKey=True, comment='设备ID', uuid='farm_id')
  13. farm_id = Fields(type='int', default='setting.farm', comment='园区ID', match='not')
  14. name = Fields(type='varchar(50)', comment='设备名')
  15. hardware_id = Fields(type='bigint', comment='硬件id')
  16. hardware_type = Fields(type='int', comment='硬件类型')
  17. hardware_station = Fields(type='smallint', comment='硬件所属站:1气象站、2温室、3土壤商情、4阀门灌溉')
  18. gateway_id = Fields(type='uuid', comment='网关id')
  19. type_id = Fields(type='int', comment='设备类型')
  20. num = Fields(type='int', default='0', comment='设备数据')
  21. show_num = Fields(type='varchar(100)', comment='设备数据计算之后的数值')
  22. status = Fields(type='boolean', default='False', comment='设备连接状态')
  23. state = Fields(type='boolean', default='True', comment='数据存在状态')
  24. cdate = Fields(type='int', default='time', comment='创建时间')