generated from Sithas/conan_template
База для ручки GetUserDiariesExecutor.h
This commit is contained in:
@@ -32,29 +32,33 @@ std::vector<user_treatment_scheme_dto> MySQLUserTreatmentSchemesDAO::FindByUserL
|
||||
|
||||
std::unordered_map<std::string, user_treatment_scheme_dto> scheme_map;
|
||||
|
||||
for (const mysqlx::Row& row : result) {
|
||||
for (const mysqlx::Row& row : result)
|
||||
{
|
||||
const std::string scheme_uuid = row[0].get<std::string>();
|
||||
|
||||
if (scheme_map.find(scheme_uuid) == scheme_map.end()) {
|
||||
if (scheme_map.find(scheme_uuid) == scheme_map.end())
|
||||
{
|
||||
user_treatment_scheme_dto dto;
|
||||
dto.uuid = scheme_uuid;
|
||||
dto.treatment_name = row[1].isNull() ? "" : row[1].get<std::string>();
|
||||
dto.instructions = row[2].isNull() ? "" : row[2].get<std::string>();
|
||||
dto.instructions = row[2].isNull() ? "" : row[2].get<std::string>();
|
||||
|
||||
scheme_map.emplace(scheme_uuid, std::move(dto));
|
||||
}
|
||||
|
||||
if (!row[3].isNull()) {
|
||||
if (!row[3].isNull())
|
||||
{
|
||||
scheme_map[scheme_uuid]
|
||||
.medication_uuids
|
||||
.push_back(row[3].get<std::string>());
|
||||
.medication_uuids
|
||||
.push_back(row[3].get<std::string>());
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<user_treatment_scheme_dto> schemes;
|
||||
schemes.reserve(scheme_map.size());
|
||||
|
||||
for (auto& [_, dto] : scheme_map) {
|
||||
for (auto& [_, dto] : scheme_map)
|
||||
{
|
||||
schemes.push_back(std::move(dto));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user