device_mul_queue.py 1.3 KB

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter database
  5. name:device_mul_queue.py
  6. author:rabin
  7. """
  8. from __load__ import *
  9. class Device_mul_queue(Model):
  10. __table__ = 'device_mul_queue'
  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. mul_id = Fields(type='uuid', comment='批量控制id')
  15. device_id = Fields(type='uuid', comment='设备id')
  16. value = Fields(type='int', comment='当前的值')
  17. status = Fields(type='int', default='1', comment='数据执行状态,1为队列中,2为执行成功,3执行失败')
  18. operstate = Fields(type='boolean', default='False', comment='数据执行状态,True为已执行,False为未执行')
  19. operdate = Fields(type='int', comment='操作时间')
  20. oper = Fields(type='varchar(500)', comment='操作说明')
  21. state = Fields(type='boolean', default='True', comment='数据存在状态')
  22. cdate = Fields(type='int', default='time', comment='创建时间')
  23. inorder = Fields(type='int', default='0', comment='设备的排序')
  24. udate = Fields(type='int', comment='接入时间,仅做排序用')
  25. hardware_id = Fields(type='bigint', comment='硬件id仅做排序用')
  26. #ALTER TABLE device_mul_queue ADD inorder int default 100;