31 #ifndef LEDGER_CORE_CONDITIONQUERYFILTER_H 32 #define LEDGER_CORE_CONDITIONQUERYFILTER_H 34 #include "QueryFilter.h" 35 #include <fmt/format.h> 36 #include <api/Amount.hpp> 44 const std::string& prefix) {
45 _fieldName = std::move(fieldName);
46 _symbol = std::move(symbol);
48 if (!prefix.empty()) {
49 _prefixedName = fmt::format(
"{}.{}", prefix, _fieldName);
51 _prefixedName = _fieldName;
55 void toString(std::stringstream &ss)
const override {
56 if (_symbol.find(
"NULL") != std::string::npos) {
57 ss << _prefixedName <<
" " << _symbol;
59 ss << _prefixedName <<
" " << _symbol <<
" :" << _fieldName;
62 switch (getOperatorForNextFilter()) {
63 case QueryFilterOperator::OP_AND :
66 case QueryFilterOperator::OP_AND_NOT :
69 case QueryFilterOperator::OP_OR :
72 case QueryFilterOperator::OP_OR_NOT :
76 getNext()->toString(ss);
80 void bindValue(soci::details::prepare_temp_type &statement)
const override {
81 if (_symbol.find(
"NULL") == std::string::npos) {
82 statement, soci::use(_value);
85 getNext()->bindValue(statement);
90 std::string _fieldName;
92 std::string _prefixedName;
100 void toString(std::stringstream &ss)
const override;
102 void bindValue(soci::details::prepare_temp_type &statement)
const override;
105 std::string _condition;
111 #endif //LEDGER_CORE_CONDITIONQUERYFILTER_H Definition: ConditionQueryFilter.h:96
Definition: QueryFilter.h:51
Definition: Account.cpp:8
Definition: ConditionQueryFilter.h:41