123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- //
- // Created by anna on 2020/10/14.
- //
- #ifndef GTCVR_GTDGNSDAO_H
- #define GTCVR_GTDGNSDAO_H
- #include "dgns_gtcvrparam.h"
- #include "dgns_gtcvrresult.h"
- #include "dgns_gtserverrunlog.h"
- #include "dgns_gtstandard.h"
- #include <map>
- #include "dgns_gtmloutcode.h"
- #include <list>
- #include "dgns_gtgktype.h"
- #include <vector>
- #include "dgns_gtbaseparam.h"
- #include "aoid_singlegt_yield.h"
- #include "aoid_daily_yield.h"
- class gtdgnsdao {
- public:
- //TODO:连接数优化,多线程安全测试
- // static properties
- // in order to decrease DB pressure ,not suit for multithread
- static std::vector<dgns_gtcvrparam> gtcvrparams;
- static time_t gtcvrparams_sync_latesttime;
- public:
- //static func
- static std::vector<dgns_gtcvrparam> getDgns_gtcvrparamContent(int paramid, std::string paramitemname);
- static bool addDgns_gtcvrparamContent(dgns_gtcvrparam d);
- static bool alterDgns_gtcvrparamContent(dgns_gtcvrparam d);
- static bool deleteDgns_gtcvrparamContent(int paramid);
- static bool
- get_dgns_gtbaseparam_single(dgns_gtbaseparam &d, std::string _id = NULL, std::string _recivetime = NULL);
- static bool add_dgns_gtbaseparam_single(dgns_gtbaseparam d);
- static bool alterDgns_gtbaseparamContent(dgns_gtbaseparam d);
- static bool deleteDgns_gtbaseparamContent(std::string paramid);
- static std::vector<dgns_gtcvrresult> getDgns_gtcvrresultContent(std::string id, std::string sgt_recivetime);
- static bool addDgns_gtcvrresultContent(dgns_gtcvrresult d);
- static bool alterDgns_gtcvrresultContent(dgns_gtcvrresult d);
- static bool deleteDgns_gtcvrresultContent(int paramid);
- static std::vector<dgns_gtserverrunlog> getDgns_gtserverrunlogContent(int paramid, std::string paramitemname);
- static bool addDgns_gtserverrunlogContent(dgns_gtserverrunlog d);
- static bool alterDgns_gtserverrunlogContent(dgns_gtserverrunlog d);
- static bool deleteDgns_gtserverrunlogContent(int paramid);
- /**
- *
- * @param conditionsql default: null; formate= " where x=y and so on ";
- * @return
- */
- static std::vector<dgns_gtstandard> get_dgns_gtstandard_list(std::string conditionsql = "");
- static bool addDgns_gtstandardContent(dgns_gtstandard d);
- static bool alterDgns_gtstandardContent(dgns_gtstandard d);
- static bool deleteDgns_gtstandardContent(std::string paramid);
- static std::map<int, dgns_gtmloutcode> get_dgns_gtmloutcode_map();
- static bool addDgns_gtgktypeContent(dgns_gtgktype d);
- static bool alterDgns_gtgktypeContent(dgns_gtgktype d);
- static bool deleteDgns_gtgktypeContent(int paramid);
- /**
- * 获取工况类型配置
- *
- * @param d
- * @param _id 根据id或者工况名称
- * @param _gkname 根据id或者工况名称
- * @return 都没有数据将返回false
- */
- static bool get_dgns_gtgktype_single(dgns_gtgktype &d, int _id, std::string _gkname);
- /**
- * 获取全部工况类型配置
- * 以工况名称为主键
- * @return
- */
- static std::map<std::string, dgns_gtgktype> get_dgns_gtgktype_all_map_indexofgkname();
- /**
- * 获取全部工况类型配置
- * 以id名称为主键
- * @return
- */
- static std::map<int, dgns_gtgktype> get_dgns_gtgktype_all_map_indexofid();
- };
- #endif //GTCVR_GTDGNSDAO_H
|