[M]修改排序方式,先按 站id 排序,再按rtu_no
This commit is contained in:
parent
79f70475b9
commit
5f1a4dabd3
@ -334,10 +334,10 @@ void CTrendInfoManage::loadDevGroupInfo(CDbApi *pReadDb)
|
|||||||
QString sqlSequenceQuery = QStringLiteral("select tag_name, description, location_id from dev_group where sub_system > 3 ");
|
QString sqlSequenceQuery = QStringLiteral("select tag_name, description, location_id from dev_group where sub_system > 3 ");
|
||||||
if(!strLoctionFilter.isEmpty())
|
if(!strLoctionFilter.isEmpty())
|
||||||
{
|
{
|
||||||
sqlSequenceQuery.append(QString(" and %1 order by dev_group_no asc;").arg(strLoctionFilter));
|
sqlSequenceQuery.append(QString(" and %1 order by location_id , rtu_no , dev_group_no asc ,tag_name;").arg(strLoctionFilter));
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
sqlSequenceQuery.append(QStringLiteral(" order by dev_group_no asc;"));
|
sqlSequenceQuery.append(QStringLiteral(" order by location_id , rtu_no , dev_group_no asc ,tag_name;"));
|
||||||
}
|
}
|
||||||
query.setForwardOnly(true);
|
query.setForwardOnly(true);
|
||||||
pReadDb->execute(sqlSequenceQuery, query);
|
pReadDb->execute(sqlSequenceQuery, query);
|
||||||
@ -368,11 +368,13 @@ void CTrendInfoManage::loadDeviceInfo(CDbApi *pReadDb)
|
|||||||
}
|
}
|
||||||
strLoctionFilter = QString("(group_tag_name in ('%1'))").arg(listLocation.join("','"));
|
strLoctionFilter = QString("(group_tag_name in ('%1'))").arg(listLocation.join("','"));
|
||||||
}
|
}
|
||||||
QString sqlSequenceQuery = QStringLiteral("select tag_name, description, group_tag_name, location_id from dev_info");
|
QString sqlSequenceQuery = QStringLiteral("select tag_name, description, group_tag_name, location_id from dev_info ");
|
||||||
if(!strLoctionFilter.isEmpty())
|
if(!strLoctionFilter.isEmpty())
|
||||||
{
|
{
|
||||||
sqlSequenceQuery.append(QString(" where %1;").arg(strLoctionFilter));
|
sqlSequenceQuery.append(QString(" where %1").arg(strLoctionFilter));
|
||||||
}
|
}
|
||||||
|
sqlSequenceQuery.append(" order by location_id, tag_name;");
|
||||||
|
|
||||||
query.setForwardOnly(true);
|
query.setForwardOnly(true);
|
||||||
pReadDb->execute(sqlSequenceQuery, query);
|
pReadDb->execute(sqlSequenceQuery, query);
|
||||||
while(query.next())
|
while(query.next())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user