1
0

forbid_staff_down_mine.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // Created by Administrator on 2019/3/5.
  3. // 禁止制定人员下井
  4. //
  5. #ifndef WORKSPACE_FORBID_STAFF_DOWN_MINE_H
  6. #define WORKSPACE_FORBID_STAFF_DOWN_MINE_H
  7. #include "write-copy.h"
  8. #include <string>
  9. #include <map>
  10. #include <list>
  11. #include "db_api/CDBResultSet.h"
  12. struct SForbidStaffInfo
  13. {
  14. int staff_id;
  15. int db_id;
  16. time_t start_time;
  17. time_t end_time;
  18. int state; //状态 0 = 无效 1 = 有效
  19. SForbidStaffInfo()
  20. {
  21. db_id = 0;
  22. staff_id = 0;
  23. start_time = 0;
  24. end_time = 0;
  25. state = 0;
  26. }
  27. };
  28. struct SForbidStaffList
  29. {
  30. int staff_id ;
  31. std::list<SForbidStaffInfo> forbidList;
  32. };
  33. struct forbid_staff_down_mine
  34. :single_base<forbid_staff_down_mine,int,std::shared_ptr<SForbidStaffList>>
  35. {
  36. public:
  37. ~forbid_staff_down_mine(){}
  38. public:
  39. // 根据数据库中的自增长id
  40. void init_forbid_staff(int id = -1);
  41. // 根据数据库中的自增长id
  42. void del_forbid_data(int id,int staff_id);
  43. //是否禁止状态
  44. bool IsForbid(int staff_id,time_t cur_time);
  45. public:
  46. //更新数据
  47. void update_forbid_data(YADB::CDBResultSet & DBRes,bool bInsert);
  48. };
  49. #endif //WORKSPACE_FORBID_STAFF_DOWN_MINE_H