From c5b9ce0c0cf973575a936df3aa928d4b7a7fa7d2 Mon Sep 17 00:00:00 2001
From: xuxiuxi <554325746@qq.com>
Date: 星期五, 08 三月 2019 13:09:26 +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/DataManagerServer/vss/dao/VssLocalSettingTblSqliteDao.h |   67 +++------------------------------
 1 files changed, 6 insertions(+), 61 deletions(-)

diff --git a/QiaoJiaSystem/DataManagerServer/vss/dao/VssLocalSettingTblSqliteDao.h b/QiaoJiaSystem/DataManagerServer/vss/dao/VssLocalSettingTblSqliteDao.h
index 7592a5a..4096fa0 100755
--- a/QiaoJiaSystem/DataManagerServer/vss/dao/VssLocalSettingTblSqliteDao.h
+++ b/QiaoJiaSystem/DataManagerServer/vss/dao/VssLocalSettingTblSqliteDao.h
@@ -3,7 +3,7 @@
 #define VSSLOCALSETTINGTBL_Sqlite_MANAGER_H
 
 #include "../model/VssLocalSettingTbl.h"
-#include "BaseDao.h"
+#include "BaseSqliteDao.h"
 
 #define VSSLocalSettingTbl_Sqlite_TABLE_NAME "VSSLocalSettingTbl"
 
@@ -11,23 +11,11 @@
 /**
  * 鏈湴鍥芥爣閰嶇疆绠$悊绫�
  */
-class VssLocalSettingTblSqliteDao : public BaseDao {
+class VssLocalSettingTblSqliteDao : public BaseSqliteDao {
 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() {
@@ -119,7 +107,7 @@
     Json::Value updateVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToUpdate,
 									std::map<std::string, std::string>& whereKeyValues) {
         Json::Value responseJsonValue;
-        responseJsonValue["message"] = "鍒犻櫎澶辫触锛�";
+        responseJsonValue["message"] = "鏇存柊澶辫触锛�";
         responseJsonValue["success"] = "false";
         QMutexLocker mutexLocker(m_mutexVisit);//TODO
         QSqlTableModel pModel(NULL, *m_db);
@@ -157,7 +145,7 @@
         if (pModel.submitAll()) {
             m_db->commit();//鎻愪氦
             responseJsonValue["success"] = "true";
-            responseJsonValue["message"] = "鍒犻櫎鎴愬姛锛�";
+            responseJsonValue["message"] = "鏇存柊鎴愬姛锛�";
         } else {
             m_db->rollback();//鍥炴粴
             ERR("updateLDeviceTable ,pModel_load Error: " << pModel.lastError().text().toStdString());
@@ -166,12 +154,12 @@
 	}
 
     /** 鏇存柊鍒涘缓浜岀骇璁惧琛� keyValuesToUpdate 闇�瑕佹洿鏂扮殑鍒楀悕鍜屽垪鍊煎锛� whereKeyValues 鍒楀悕鍜屽垪鍊兼潯浠� */
-    bool updateVssLocalSettingTbl(std::map<std::string, std::string>& keyValuesToUpdate,
+    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 update(keyValuesToUpdate, VSSLocalSettingTbl_TABLE_NAME, whereKeyValues);
+        return updateVssLocalSettingTbl(keyValuesToUpdate, whereKeyValues);
     }
 
 	/** 鏌ヨ鏈湴鍥芥爣閰嶇疆鍒楄〃  querySql 瑕佹煡璇㈢殑sql璇彞 */
@@ -219,49 +207,6 @@
         return findVssLocalSettingTblList(whereKeyValues);
     }
 
-	/** 鏌ヨmap鍒楄〃 querySql 瑕佹煡璇㈢殑sql璇彞 */
-	vector<map<string, string>> findMapList(string querySql) {
-		return findList(querySql);
-	}
-
-    /** 鎵цsql璇彞 */
-    bool execute(string sql) {
-        return exec(move(sql));
-    }
-
-    /** map杞琺odel绫� */
-    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;
-    }
 
 };
 

--
Gitblit v1.8.0