mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
修改场站策略解析及网关指令下发
This commit is contained in:
@@ -106,7 +106,8 @@ bool AppData::initFromDB()
|
||||
}
|
||||
{ // 数据库读取场站信息
|
||||
str = "", result.clear();
|
||||
DAO::queryStationList(dao, result);
|
||||
std::string sql = "SELECT s.*, p.name policy_name, p.`type` policy_type, p.value FROM station s LEFT JOIN policy p ON s.policy_id=p.policy_id;";
|
||||
dao->exec(sql, result);
|
||||
for (auto& fields: result)
|
||||
{
|
||||
auto station = std::make_shared<Station>();
|
||||
@@ -140,7 +141,7 @@ bool AppData::initFromDB()
|
||||
DAO::queryPolicyList(dao, result);
|
||||
for (auto& fields: result)
|
||||
{
|
||||
auto policy = std::make_shared<MyPolicy>();
|
||||
auto policy = std::make_shared<SysPolicy>();
|
||||
policy->policyId = fields.get<int>(DMPolicy::POLICY_ID);
|
||||
policy->type = fields.get<int>(DMPolicy::TYPE);
|
||||
policy->name = fields.value(DMPolicy::NAME);
|
||||
|
||||
Reference in New Issue
Block a user