修改运行监控场站及设备信息查询接口

This commit is contained in:
lixiaoyuan
2025-09-06 15:23:07 +08:00
parent aca9a8f0ae
commit 566a3b050c
17 changed files with 468 additions and 302 deletions

View File

@@ -111,6 +111,7 @@ static Errcode QueryPagination(std::string sqlFields, std::string sqlCondition,
}
if (page.index < 1) page.index = 1;
if (page.size <= 0) page.size = 10;
page.total = count;
std::string sql = "SELECT " + sqlFields + " " + sqlCondition + DAO::sqlPageLimit(page.index -1, page.size);
int ret = dao.exec(sql, result);
@@ -416,7 +417,7 @@ Errcode DAO::updateStationById(Fields& params)
// 查询设备信息列表
Errcode DAO::queryDeviceList(std::shared_ptr<DaoEntity> dao, vector<Fields>& result)
{
std::string sql = "SELECT * FROM " + DMDevice::TABLENAME;
std::string sql = "SELECT d.*, ddt.category FROM device d LEFT JOIN def_device_type ddt ON d.`type`=ddt.device_type_id;";
return DAO::exec(dao, sql, result);
}