From 2bef72df0afa4f123365fb01fa961f9feabf0e45 Mon Sep 17 00:00:00 2001
From: xuxiuxi <554325746@qq.com>
Date: 星期三, 06 三月 2019 11:49:38 +0800
Subject: [PATCH] Merge branch 'yw.1.2.fixbug' of http://192.168.1.226:10010/r/development/c++ into yw.1.2.fixbug
---
QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp b/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp
index 8b8a3e1..42f22eb 100644
--- a/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp
+++ b/QiaoJiaSystem/VideoServer/QiaoJia/DB/LDBTool.cpp
@@ -2732,3 +2732,40 @@
return ruleMap;
}
+
+
+/**
+ * type 0 rtsp, 1 gb28181
+ */
+std::list<Record_Cam_Dev> LDBTool::searchCamDevTableByType(int type) {
+ QMutexLocker mutexLocker(&m_mutexVisit);//TODO
+ std::list<Record_Cam_Dev> lst;
+ QSqlTableModel pModel(NULL, m_db);
+ pModel.setTable("cam_dev");
+ pModel.setFilter(QObject::tr((string("cam_dev_id != '' and cam_dev_id is not null and type='")+to_string(type)+"'").c_str()));
+ pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange
+ pModel.select();
+
+ int rowCount = pModel.rowCount();
+ if (rowCount > 0) {
+ for (int i = 0; i < rowCount; ++i) {
+ Record_Cam_Dev lChannelRec;
+ QSqlRecord rec = pModel.record(i);
+ lChannelRec.n_id = rec.value("id").toInt();
+ lChannelRec.str_cam_dev_id = rec.value("cam_dev_id").toString();
+ lChannelRec.str_name = rec.value("name").toString();
+ lChannelRec.str_addr = rec.value("addr").toString();
+ lChannelRec.str_longitude = rec.value("longitude").toString();
+ lChannelRec.str_latitude = rec.value("latitude").toString();
+ lChannelRec.str_ip = rec.value("ip").toString();
+ lChannelRec.n_port = rec.value("port").toInt();
+ lChannelRec.str_username = rec.value("username").toString();
+ lChannelRec.str_password = rec.value("password").toString();
+ lChannelRec.str_brand = rec.value("brand").toString();
+ lChannelRec.str_reserved = rec.value("reserved").toString();
+ lst.push_back(lChannelRec);
+ }
+ }
+
+ return lst;
+}
\ No newline at end of file
--
Gitblit v1.8.0