mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
修改运行监控场站及设备信息查询接口
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user