device_set_condition.py 1.1 KB

123456789101112131415161718192021222324
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter database
  5. name:device_set_condition.py
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class Device_set_condition(Model):
  10. __table__ = 'device_set_condition'
  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. devices = Fields(type='text', comment='设备id')
  15. gateway_id = Fields(type='uuid', comment='设备条件里的网关id')
  16. device_id = Fields(type='uuid', comment='设备条件里的设备id')
  17. oper = Fields(type='smallint', comment='操作')
  18. condition = Fields(type='smallint', comment='条件')
  19. value = Fields(type='varchar(100)', comment='条件的值')
  20. notice = Fields(type='boolean', default='False', comment='是否报警')
  21. status = Fields(type='boolean', default='True', comment='是否取消')
  22. state = Fields(type='boolean', default='True', comment='数据存在状态')
  23. cdate = Fields(type='int', default='time', comment='创建时间')