// // 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 #include "dgns_gtmloutcode.h" #include #include "dgns_gtgktype.h" #include #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 gtcvrparams; static time_t gtcvrparams_sync_latesttime; public: //static func static std::vector 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 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 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 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 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 get_dgns_gtgktype_all_map_indexofgkname(); /** * 获取全部工况类型配置 * 以id名称为主键 * @return */ static std::map get_dgns_gtgktype_all_map_indexofid(); }; #endif //GTCVR_GTDGNSDAO_H