| | |
| | | |
| | | #ifndef VSSLOCALSETTINGTBL_Sqlite_MANAGER_H |
| | | #define VSSLOCALSETTINGTBL_Sqlite_MANAGER_H |
| | | |
| | | #include "../model/VssLocalSettingTbl.h" |
| | | #include "BaseDao.h" |
| | | |
| | | #define VSSLocalSettingTbl_Sqlite_TABLE_NAME "VSSLocalSettingTbl" |
| | | |
| | | /** |
| | | * 本地国标配置管理类 |
| | | */ |
| | | class VssLocalSettingTblSqliteDao : public BaseDao { |
| | | private: |
| | | /** 本地国标配置构造函数 */ |
| | | VssLocalSettingTblSqliteDao() {} |
| | | private: |
| | | LDBTool* lDBTool; |
| | | |
| | | QSqlDatabase* m_db; |
| | | QSqlTableModel *m_pModel; |
| | | QMutex* m_mutexVisit; |
| | | public: |
| | | void setLDBTool(LDBTool* lDBTool) { |
| | | this->lDBTool = lDBTool; |
| | | this->m_db = lDBTool->get_m_db(); |
| | | this->m_pModel = lDBTool->get_m_pModel(); |
| | | this->m_mutexVisit = lDBTool->get_m_mutexVisit(); |
| | | } |
| | | public: |
| | | /** 本地国标配置单例模式 */ |
| | | static VssLocalSettingTblSqliteDao* instance() { |
| | | static VssLocalSettingTblSqliteDao instance; |
| | | return &instance; |
| | | } |
| | | |
| | | /** 添加本地国标配置 keyValuesToAdd 需要添加的列名和列值对map*/ |
| | | Json::Value addVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToAdd) { |
| | | Json::Value responseJsonValue; |
| | | responseJsonValue["message"] = "添加失败!"; |
| | | responseJsonValue["success"] = "false"; |
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO |
| | | QSqlTableModel pModel(NULL, *m_db); |
| | | |
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME); |
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit); |
| | | |
| | | QSqlRecord rec = pModel.record(); |
| | | for (auto keyValueToAdd : keyValuesToAdd) { |
| | | rec.setValue(QString::fromUtf8(keyValueToAdd.first.c_str()), QString::fromUtf8(keyValueToAdd.second.c_str())); |
| | | } |
| | | rec.setGenerated("ID", false); |
| | | |
| | | pModel.insertRecord(-1, rec);//TODO |
| | | |
| | | m_db->transaction();//开始事务操作 |
| | | |
| | | if (pModel.submitAll()) { |
| | | m_db->commit();//提交 |
| | | responseJsonValue["success"] = "true"; |
| | | responseJsonValue["message"] = "添加成功!"; |
| | | } else { |
| | | m_db->rollback();//回滚 |
| | | ERR("addVssLocalSettingTbl err ,Database Error: " << pModel.lastError().text().toStdString()); |
| | | } |
| | | return responseJsonValue; |
| | | } |
| | | |
| | | /** 删除本地国标配置 whereKey 列名;whereValue 列值 */ |
| | | Json::Value deleteByColumn(string whereKey, string whereValue) { |
| | | |
| | | |
| | | std::map<std::string, std::string> whereKeyValues; |
| | | whereKeyValues[whereKey] = whereValue; |
| | | return deleteVssLocalSettingTbl(whereKeyValues); |
| | | } |
| | | |
| | | /** 删除本地国标配置 whereColumnNameValues 列名和列值对条件 */ |
| | | Json::Value deleteVssLocalSettingTbl(std::map<std::string, std::string>& whereKeyValues) { |
| | | |
| | | Json::Value responseJsonValue; |
| | | responseJsonValue["message"] = "删除失败!"; |
| | | responseJsonValue["success"] = "false"; |
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO |
| | | QSqlTableModel pModel(NULL, *m_db); |
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME); |
| | | for (auto whereKeyValue : whereKeyValues ) { |
| | | pModel.setFilter(QObject::tr((string(whereKeyValue.first)+" = '%1'").c_str()).arg(QString::fromUtf8(whereKeyValue.second.c_str()))); |
| | | } |
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange |
| | | pModel.select(); |
| | | |
| | | int rowCount = pModel.rowCount(); |
| | | |
| | | if (rowCount >= 1) { |
| | | for (int i = 0; i < rowCount; i++) { |
| | | pModel.removeRow(i);//TODO |
| | | } |
| | | } else { |
| | | return responseJsonValue; |
| | | } |
| | | |
| | | m_db->transaction();//开始事务操作 |
| | | |
| | | if (pModel.submitAll()) { |
| | | m_db->commit();//提交 |
| | | responseJsonValue["success"] = "true"; |
| | | responseJsonValue["message"] = "删除成功!"; |
| | | } else { |
| | | m_db->rollback();//回滚 |
| | | ERR("deleteLDeviceTable ,pModel_load Error: " << pModel.lastError().text().toStdString()); |
| | | } |
| | | |
| | | return responseJsonValue; |
| | | } |
| | | |
| | | /** 更新本地国标配置 keyValuesToUpdate 需要更新的列名和列值对; whereKeyValues 列名和列值条件 */ |
| | | Json::Value updateVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToUpdate, |
| | | std::map<std::string, std::string>& whereKeyValues) { |
| | | Json::Value responseJsonValue; |
| | | responseJsonValue["message"] = "删除失败!"; |
| | | responseJsonValue["success"] = "false"; |
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO |
| | | QSqlTableModel pModel(NULL, *m_db); |
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME); |
| | | for (auto whereKeyValue : whereKeyValues) { |
| | | pModel.setFilter(QObject::tr((whereKeyValue.first + " = '%1'").c_str()).arg(QString::fromStdString(whereKeyValue.second))); |
| | | } |
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange |
| | | pModel.select(); |
| | | |
| | | /*QSqlRecord rec = pModel.record(); |
| | | rec.setValue("dst_path",QString::fromStdString(dst_path)); |
| | | rec.setValue("total",total); |
| | | rec.setValue("finish_flag",1); |
| | | rec.setValue("update_time",QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));*/ |
| | | |
| | | int rowCount = pModel.rowCount(); |
| | | if (rowCount > 0) { |
| | | QSqlRecord rec = pModel.record(0); |
| | | for (auto keyValueToUpdate : keyValuesToUpdate) { |
| | | rec.setValue(keyValueToUpdate.first.c_str(), keyValueToUpdate.second.c_str()); |
| | | } |
| | | // rec.setValue("dst_path", QString::fromStdString(dst_path)); |
| | | // rec.setValue("total", total); |
| | | // rec.setValue("finish_flag", 1); |
| | | rec.setValue("UpdateTime", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); |
| | | |
| | | pModel.setRecord(0, rec); |
| | | } else { |
| | | return responseJsonValue; |
| | | } |
| | | |
| | | m_db->transaction();//开始事务操作 |
| | | |
| | | if (pModel.submitAll()) { |
| | | m_db->commit();//提交 |
| | | responseJsonValue["success"] = "true"; |
| | | responseJsonValue["message"] = "删除成功!"; |
| | | } else { |
| | | m_db->rollback();//回滚 |
| | | ERR("updateLDeviceTable ,pModel_load Error: " << pModel.lastError().text().toStdString()); |
| | | } |
| | | return responseJsonValue; |
| | | } |
| | | |
| | | /** 更新创建二级设备表 keyValuesToUpdate 需要更新的列名和列值对; whereKeyValues 列名和列值条件 */ |
| | | bool updateVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToUpdate, |
| | | string whereKey, |
| | | string whereValue) { |
| | | std::map<std::string, std::string> whereKeyValues; |
| | | whereKeyValues[whereKey] = whereValue; |
| | | return update(keyValuesToUpdate, VSSLocalSettingTbl_TABLE_NAME, whereKeyValues); |
| | | } |
| | | |
| | | /** 查询本地国标配置列表 querySql 要查询的sql语句 */ |
| | | Json::Value findVssLocalSettingTblList(string querySql) { |
| | | |
| | | Json::Value responseJsonValue; |
| | | responseJsonValue["message"] = "删除失败!"; |
| | | responseJsonValue["success"] = "false"; |
| | | responseJsonValue["data"] = "[]"; |
| | | |
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO |
| | | std::list<Record_Cut_Video_info> lst; |
| | | QSqlTableModel pModel(NULL, *m_db); |
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME); |
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange |
| | | pModel.select(); |
| | | |
| | | int rowCount = pModel.rowCount(); |
| | | if (rowCount > 0) { |
| | | Json::Value rowDataList; |
| | | for (int i = 0; i < rowCount; ++i) { |
| | | Json::Value rowData; |
| | | Record_Cut_Video_info lRec; |
| | | QSqlRecord rec = pModel.record(i); |
| | | // if (!rec.value("finish_flag").toBool()) { |
| | | // lRec.n_id = rec.value("id").toInt(); |
| | | // lRec.str_storage_dev_id = rec.value("storage_dev_id").toString(); |
| | | // lRec.n_chn = rec.value("chn").toInt(); |
| | | // lRec.str_src_path = rec.value("src_path").toString(); |
| | | // lRec.str_dst_path = rec.value("dst_path").toString(); |
| | | // lRec.n_total = rec.value("total").toInt(); |
| | | // lRec.b_finish_flag = rec.value("finish_flag").toBool(); |
| | | // lRec.tim_update_time = QDateTime::fromString(rec.value("update_time").toString(), |
| | | // "yyyy-MM-dd hh:mm:ss"); |
| | | // lRec.str_reserved = rec.value("reserved").toString(); |
| | | // lst.push_back(lRec); |
| | | // } |
| | | rowDataList.append(rowData); |
| | | } |
| | | responseJsonValue["data"] = rowDataList; |
| | | } |
| | | |
| | | return responseJsonValue; |
| | | |
| | | |
| | | |
| | | |
| | | // vector<VssLocalSettingTbl> vssLocalSettingTblVec; |
| | | // vector<map<string, string>> rowDatList = findList(querySql); |
| | | // vssLocalSettingTblVec.reserve(rowDatList.size()); |
| | | // for (auto rowData : rowDatList) { |
| | | // vssLocalSettingTblVec.emplace_back(mapToModel(rowData)); |
| | | // } |
| | | // return vssLocalSettingTblVec; |
| | | } |
| | | |
| | | /**查询本地国标配置列表 whereKeyValues 列名和列值对条件 */ |
| | | Json::Value findVssLocalSettingTblList(std::map<std::string, std::string>& whereKeyValues) { |
| | | return findVssLocalSettingTblList(string("select * from ") + VSSLocalSettingTbl_TABLE_NAME + " where 1=1 " + getWhereColumnNameValuePair(whereKeyValues)); |
| | | } |
| | | |
| | | /**查询所有本地国标配置列表 */ |
| | | Json::Value findAllVssLocalSettingTblList() { |
| | | return findVssLocalSettingTblList(string("select * from ") + VSSLocalSettingTbl_TABLE_NAME + " where 1=1 "); |
| | | } |
| | | |
| | | /** 查询map列表 querySql 要查询的sql语句 */ |
| | | vector<map<string, string>> findMapList(string querySql) { |
| | | return findList(querySql); |
| | | } |
| | | |
| | | /** 执行sql语句 */ |
| | | bool execute(string sql) { |
| | | return exec(move(sql)); |
| | | } |
| | | |
| | | /** map转model类 */ |
| | | VssLocalSettingTbl mapToModel(map<string, string>& rowData) { |
| | | VssLocalSettingTbl vssLocalSettingTbl; |
| | | string IDValue = rowData[VssLocalSettingTbl_ID]; |
| | | if (IDValue.length() != 0 && IDValue != "NULL") { |
| | | vssLocalSettingTbl.ID = std::stoi(IDValue); |
| | | } |
| | | string ServerIpValue = rowData[VssLocalSettingTbl_ServerIp]; |
| | | if (ServerIpValue.length() != 0 && ServerIpValue != "NULL") { |
| | | vssLocalSettingTbl.ServerIp = ServerIpValue; |
| | | } |
| | | string ServerPortValue = rowData[VssLocalSettingTbl_ServerPort]; |
| | | if (ServerPortValue.length() != 0 && ServerPortValue != "NULL") { |
| | | vssLocalSettingTbl.ServerPort = ServerPortValue; |
| | | } |
| | | string ServerIdValue = rowData[VssLocalSettingTbl_ServerId]; |
| | | if (ServerIdValue.length() != 0 && ServerIdValue != "NULL") { |
| | | vssLocalSettingTbl.ServerId = ServerIdValue; |
| | | } |
| | | string UserAuthIdValue = rowData[VssLocalSettingTbl_UserAuthId]; |
| | | if (UserAuthIdValue.length() != 0 && UserAuthIdValue != "NULL") { |
| | | vssLocalSettingTbl.UserAuthId = UserAuthIdValue; |
| | | } |
| | | string PasswordValue = rowData[VssLocalSettingTbl_Password]; |
| | | if (PasswordValue.length() != 0 && PasswordValue != "NULL") { |
| | | vssLocalSettingTbl.Password = PasswordValue; |
| | | } |
| | | string UpdateTimeValue = rowData[VssLocalSettingTbl_UpdateTime]; |
| | | if (UpdateTimeValue.length() != 0 && UpdateTimeValue != "NULL") { |
| | | vssLocalSettingTbl.UpdateTime = UpdateTimeValue; |
| | | } |
| | | return vssLocalSettingTbl; |
| | | } |
| | | |
| | | }; |
| | | |
| | | |
| | | #endif //VSSLOCALSETTINGTBL_Sqlite_MANAGER_H |
| | | |
| | | |
| | |
|
| | | #ifndef VSSLOCALSETTINGTBL_Sqlite_MANAGER_H
|
| | | #define VSSLOCALSETTINGTBL_Sqlite_MANAGER_H
|
| | |
|
| | | #include "../model/VssLocalSettingTbl.h"
|
| | | #include "BaseSqliteDao.h"
|
| | |
|
| | | #define VSSLocalSettingTbl_Sqlite_TABLE_NAME "VSSLocalSettingTbl"
|
| | |
|
| | | #include <qsqlfield.h>
|
| | | /**
|
| | | * 本地国标配置管理类
|
| | | */
|
| | | class VssLocalSettingTblSqliteDao : public BaseSqliteDao {
|
| | | private:
|
| | | /** 本地国标配置构造函数 */
|
| | | VssLocalSettingTblSqliteDao() {}
|
| | |
|
| | | public:
|
| | | /** 本地国标配置单例模式 */
|
| | | static VssLocalSettingTblSqliteDao* instance() {
|
| | | static VssLocalSettingTblSqliteDao instance;
|
| | | return &instance;
|
| | | }
|
| | |
|
| | | /** 添加本地国标配置 keyValuesToAdd 需要添加的列名和列值对map*/
|
| | | Json::Value addVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToAdd) {
|
| | | Json::Value responseJsonValue;
|
| | | responseJsonValue["message"] = "添加失败!";
|
| | | responseJsonValue["success"] = "false";
|
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO
|
| | | QSqlTableModel pModel(NULL, *m_db);
|
| | |
|
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME);
|
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);
|
| | |
|
| | | QSqlRecord rec = pModel.record();
|
| | | for (auto keyValueToAdd : keyValuesToAdd) {
|
| | | rec.setValue(QString::fromUtf8(keyValueToAdd.first.c_str()), QString::fromUtf8(keyValueToAdd.second.c_str()));
|
| | | }
|
| | | rec.setGenerated("ID", false);
|
| | |
|
| | | pModel.insertRecord(-1, rec);//TODO
|
| | |
|
| | | m_db->transaction();//开始事务操作
|
| | |
|
| | | if (pModel.submitAll()) {
|
| | | m_db->commit();//提交
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "添加成功!";
|
| | | } else {
|
| | | m_db->rollback();//回滚
|
| | | ERR("addVssLocalSettingTbl err ,Database Error: " << pModel.lastError().text().toStdString());
|
| | | }
|
| | | return responseJsonValue;
|
| | | }
|
| | |
|
| | | /** 删除本地国标配置 whereKey 列名;whereValue 列值 */
|
| | | Json::Value deleteByColumn(string whereKey, string whereValue) {
|
| | |
|
| | |
|
| | | std::map<std::string, std::string> whereKeyValues;
|
| | | whereKeyValues[whereKey] = whereValue;
|
| | | return deleteVssLocalSettingTbl(whereKeyValues);
|
| | | }
|
| | |
|
| | | /** 删除本地国标配置 whereColumnNameValues 列名和列值对条件 */
|
| | | Json::Value deleteVssLocalSettingTbl(std::map<std::string, std::string>& whereKeyValues) {
|
| | |
|
| | | Json::Value responseJsonValue;
|
| | | responseJsonValue["message"] = "删除失败!";
|
| | | responseJsonValue["success"] = "false";
|
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO
|
| | | QSqlTableModel pModel(NULL, *m_db);
|
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME);
|
| | | if (whereKeyValues.size() > 0) {
|
| | | auto filter = QObject::tr((string(" 1=1 ")+getWhereColumnNameValuePair(whereKeyValues)).c_str());
|
| | | pModel.setFilter(filter);
|
| | | }
|
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange
|
| | | pModel.select();
|
| | |
|
| | | int rowCount = pModel.rowCount();
|
| | |
|
| | | if (rowCount >= 1) {
|
| | | for (int i = 0; i < rowCount; i++) {
|
| | | pModel.removeRow(i);//TODO
|
| | | }
|
| | | } else {
|
| | | return responseJsonValue;
|
| | | }
|
| | |
|
| | | m_db->transaction();//开始事务操作
|
| | |
|
| | | if (pModel.submitAll()) {
|
| | | m_db->commit();//提交
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "删除成功!";
|
| | | } else {
|
| | | m_db->rollback();//回滚
|
| | | ERR("deleteLDeviceTable ,pModel_load Error: " << pModel.lastError().text().toStdString());
|
| | | }
|
| | |
|
| | | return responseJsonValue;
|
| | | }
|
| | |
|
| | | /** 更新本地国标配置 keyValuesToUpdate 需要更新的列名和列值对; whereKeyValues 列名和列值条件 */
|
| | | Json::Value updateVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToUpdate,
|
| | | std::map<std::string, std::string>& whereKeyValues) {
|
| | | Json::Value responseJsonValue;
|
| | | responseJsonValue["message"] = "更新失败!";
|
| | | responseJsonValue["success"] = "false";
|
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO
|
| | | QSqlTableModel pModel(NULL, *m_db);
|
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME);
|
| | | if (whereKeyValues.size() > 0) {
|
| | | auto filter = QObject::tr((string(" 1=1 ")+getWhereColumnNameValuePair(whereKeyValues)).c_str());
|
| | | pModel.setFilter(filter);
|
| | | }
|
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange
|
| | | pModel.select();
|
| | |
|
| | | /*QSqlRecord rec = pModel.record();
|
| | | rec.setValue("dst_path",QString::fromStdString(dst_path));
|
| | | rec.setValue("total",total);
|
| | | rec.setValue("finish_flag",1);
|
| | | rec.setValue("update_time",QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));*/
|
| | |
|
| | | int rowCount = pModel.rowCount();
|
| | | if (rowCount > 0) {
|
| | | QSqlRecord rec = pModel.record(0);
|
| | | for (auto keyValueToUpdate : keyValuesToUpdate) {
|
| | | rec.setValue(keyValueToUpdate.first.c_str(), keyValueToUpdate.second.c_str());
|
| | | }
|
| | | // rec.setValue("dst_path", QString::fromStdString(dst_path));
|
| | | // rec.setValue("total", total);
|
| | | // rec.setValue("finish_flag", 1);
|
| | | rec.setValue("UpdateTime", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));
|
| | |
|
| | | pModel.setRecord(0, rec);
|
| | | } else {
|
| | | return responseJsonValue;
|
| | | }
|
| | |
|
| | | m_db->transaction();//开始事务操作
|
| | |
|
| | | if (pModel.submitAll()) {
|
| | | m_db->commit();//提交
|
| | | responseJsonValue["success"] = "true";
|
| | | responseJsonValue["message"] = "更新成功!";
|
| | | } else {
|
| | | m_db->rollback();//回滚
|
| | | ERR("updateLDeviceTable ,pModel_load Error: " << pModel.lastError().text().toStdString());
|
| | | }
|
| | | return responseJsonValue;
|
| | | }
|
| | |
|
| | | /** 更新创建二级设备表 keyValuesToUpdate 需要更新的列名和列值对; whereKeyValues 列名和列值条件 */
|
| | | Json::Value updateVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToUpdate,
|
| | | string whereKey,
|
| | | string whereValue) {
|
| | | std::map<std::string, std::string> whereKeyValues;
|
| | | whereKeyValues[whereKey] = whereValue;
|
| | | return updateVssLocalSettingTbl(keyValuesToUpdate, whereKeyValues);
|
| | | }
|
| | |
|
| | | /** 查询本地国标配置列表 querySql 要查询的sql语句 */
|
| | | Json::Value findVssLocalSettingTblList(std::map<std::string, std::string>& whereKeyValues) {
|
| | |
|
| | | Json::Value responseJsonValue;
|
| | | responseJsonValue["message"] = "查询失败!";
|
| | | responseJsonValue["success"] = "false";
|
| | | responseJsonValue["data"] = Json::arrayValue;
|
| | |
|
| | | QMutexLocker mutexLocker(m_mutexVisit);//TODO
|
| | | std::list<Record_Cut_Video_info> lst;
|
| | | QSqlTableModel pModel(NULL, *m_db);
|
| | | pModel.setTable(VSSLocalSettingTbl_Sqlite_TABLE_NAME);;
|
| | | if (whereKeyValues.size() > 0) {
|
| | | auto filter = QObject::tr((string(" 1=1 ")+getWhereColumnNameValuePair(whereKeyValues)).c_str());
|
| | | pModel.setFilter(filter);
|
| | | }
|
| | | pModel.setEditStrategy(QSqlTableModel::OnManualSubmit);//OnManualSubmit OnFieldChange
|
| | | pModel.select();
|
| | |
|
| | | int rowCount = pModel.rowCount();
|
| | | if (rowCount > 0) {
|
| | | Json::Value rowDataList = Json::arrayValue;
|
| | | for (int i = 0; i < rowCount; ++i) {
|
| | | Json::Value rowData = Json::objectValue;
|
| | | Record_Cut_Video_info lRec;
|
| | | QSqlRecord rec = pModel.record(i);
|
| | | for (int i = 0; i < rec.count(); i++) {
|
| | | QSqlField field = rec.field(i);
|
| | | rowData[field.name().toStdString()] = field.value().toString().toStdString();
|
| | | }
|
| | | rowDataList.append(rowData);
|
| | | }
|
| | | responseJsonValue["data"] = rowDataList;
|
| | | }
|
| | |
|
| | | responseJsonValue["message"] = "查询成功!";
|
| | | responseJsonValue["success"] = "true";
|
| | | return responseJsonValue;
|
| | | }
|
| | |
|
| | | /**查询所有本地国标配置列表 */
|
| | | Json::Value findAllVssLocalSettingTblList() {
|
| | | std::map<std::string, std::string> whereKeyValues;
|
| | | return findVssLocalSettingTblList(whereKeyValues);
|
| | | }
|
| | |
|
| | |
|
| | | };
|
| | |
|
| | |
|
| | | #endif //VSSLOCALSETTINGTBL_Sqlite_MANAGER_H
|
| | |
|
| | |
|