gtdgnsdao.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. //
  2. // Created by anna on 2020/10/14.
  3. //
  4. #ifndef GTCVR_GTDGNSDAO_H
  5. #define GTCVR_GTDGNSDAO_H
  6. #include "dgns_gtcvrparam.h"
  7. #include "dgns_gtcvrresult.h"
  8. #include "dgns_gtserverrunlog.h"
  9. #include "dgns_gtstandard.h"
  10. #include <map>
  11. #include "dgns_gtmloutcode.h"
  12. #include <list>
  13. #include "dgns_gtgktype.h"
  14. #include <vector>
  15. #include "dgns_gtbaseparam.h"
  16. #include "aoid_singlegt_yield.h"
  17. #include "aoid_daily_yield.h"
  18. class gtdgnsdao {
  19. public:
  20. //TODO:连接数优化,多线程安全测试
  21. // static properties
  22. // in order to decrease DB pressure ,not suit for multithread
  23. static std::vector<dgns_gtcvrparam> gtcvrparams;
  24. static time_t gtcvrparams_sync_latesttime;
  25. public:
  26. //static func
  27. static std::vector<dgns_gtcvrparam> getDgns_gtcvrparamContent(int paramid, std::string paramitemname);
  28. static bool addDgns_gtcvrparamContent(dgns_gtcvrparam d);
  29. static bool alterDgns_gtcvrparamContent(dgns_gtcvrparam d);
  30. static bool deleteDgns_gtcvrparamContent(int paramid);
  31. static bool
  32. get_dgns_gtbaseparam_single(dgns_gtbaseparam &d, std::string _id = NULL, std::string _recivetime = NULL);
  33. static bool add_dgns_gtbaseparam_single(dgns_gtbaseparam d);
  34. static bool alterDgns_gtbaseparamContent(dgns_gtbaseparam d);
  35. static bool deleteDgns_gtbaseparamContent(std::string paramid);
  36. static std::vector<dgns_gtcvrresult> getDgns_gtcvrresultContent(std::string id, std::string sgt_recivetime);
  37. static bool addDgns_gtcvrresultContent(dgns_gtcvrresult d);
  38. static bool alterDgns_gtcvrresultContent(dgns_gtcvrresult d);
  39. static bool deleteDgns_gtcvrresultContent(int paramid);
  40. static std::vector<dgns_gtserverrunlog> getDgns_gtserverrunlogContent(int paramid, std::string paramitemname);
  41. static bool addDgns_gtserverrunlogContent(dgns_gtserverrunlog d);
  42. static bool alterDgns_gtserverrunlogContent(dgns_gtserverrunlog d);
  43. static bool deleteDgns_gtserverrunlogContent(int paramid);
  44. /**
  45. *
  46. * @param conditionsql default: null; formate= " where x=y and so on ";
  47. * @return
  48. */
  49. static std::vector<dgns_gtstandard> get_dgns_gtstandard_list(std::string conditionsql = "");
  50. static bool addDgns_gtstandardContent(dgns_gtstandard d);
  51. static bool alterDgns_gtstandardContent(dgns_gtstandard d);
  52. static bool deleteDgns_gtstandardContent(std::string paramid);
  53. static std::map<int, dgns_gtmloutcode> get_dgns_gtmloutcode_map();
  54. static bool addDgns_gtgktypeContent(dgns_gtgktype d);
  55. static bool alterDgns_gtgktypeContent(dgns_gtgktype d);
  56. static bool deleteDgns_gtgktypeContent(int paramid);
  57. /**
  58. * 获取工况类型配置
  59. *
  60. * @param d
  61. * @param _id 根据id或者工况名称
  62. * @param _gkname 根据id或者工况名称
  63. * @return 都没有数据将返回false
  64. */
  65. static bool get_dgns_gtgktype_single(dgns_gtgktype &d, int _id, std::string _gkname);
  66. /**
  67. * 获取全部工况类型配置
  68. * 以工况名称为主键
  69. * @return
  70. */
  71. static std::map<std::string, dgns_gtgktype> get_dgns_gtgktype_all_map_indexofgkname();
  72. /**
  73. * 获取全部工况类型配置
  74. * 以id名称为主键
  75. * @return
  76. */
  77. static std::map<int, dgns_gtgktype> get_dgns_gtgktype_all_map_indexofid();
  78. };
  79. #endif //GTCVR_GTDGNSDAO_H