From efafab5273ba3ff13a19f07088c320a5180188b6 Mon Sep 17 00:00:00 2001
From: pans <pansen626@sina.com>
Date: 星期四, 31 一月 2019 10:49:56 +0800
Subject: [PATCH] 1.2_布控feature: Auto stash before merge of "ywv1.2_布控feature" and "origin/ywv1.2_布控feature"
---
QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp b/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp
index 2461bfd..7495c9d 100644
--- a/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp
+++ b/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp
@@ -28,6 +28,7 @@
std::string uuid;
FaceFeature feature;
std::string faceUrl;
+ std::string feature_base64;
};
struct FaceInfo {
@@ -37,6 +38,8 @@
std::string sex;
std::string idCard;
std::string phoneNum;
+ std::string enable;
+ std::string monLevel;
};
typedef std::vector<FaceInfo> FaceInfos;
typedef std::map<std::string, FaceInfo> FaceInfosCache;
@@ -65,6 +68,8 @@
std::string uuid;
std::string faceurl;
FaceFeature faceFeature;
+ std::string enable;
+ std::string monLevel;
};
typedef std::map<std::string, FaceFeatureWithUrl> FeatureDBWithUrlCache;
@@ -85,6 +90,7 @@
//
std::string getFacesFromTableSql(std::string tableName) {
+// #todo get monLevel 鑱斿悎鏌ヨ
std::string sql =
"select uuid,feature,create_time,faceUrl,del_flag from '" + tableName +
"_fea' where feature is not null ";
@@ -100,7 +106,7 @@
}
std::string getTableInfosSql(std::string tableName) {
- std::string sql = "select * from '" + tableName+"';";// + " where del_flag = 0";
+ std::string sql = "select * from '" + tableName + "';";// + " where del_flag = 0";
return sql;
}
@@ -108,8 +114,8 @@
std::string getTableInfosSql() {
//uuid,tableName,tableDesc,tableType,bwType,startTime,endTime
std::string sql =
- "select uuid,tableName,tableType,bwType,startTime,endTime,uploadFlag,cmpThreshold,enabled from '" +
- g_tableName + "' where del_flag = 0";
+ "select uuid,tableName,tableType,bwType,startTime,endTime,uploadFlag,cmpThreshold,enabled,create_by from " +
+ g_tableName + " where del_flag = 0";
return sql;
}
@@ -178,7 +184,7 @@
std::string sqlTemp = sql;
std::string sql2 = ") VALUES('";
for (auto item : fieldValues) {
- if (item.first.size() != 0) {
+ if (item.first.size() != 0 && item.second.size() != 0) {
sql.append(item.first + ",");
sql2.append(item.second + "','");
}
@@ -198,6 +204,9 @@
* @return sql
*/
std::string getInitDBSql() {
+// %% ALTER TABLE sys_o_tables ADD COLUMN uploadFlag varchar(255) DEFAULT 0;
+// %% ALTER TABLE sys_o_tables ADD COLUMN cmpThreshold varchar(255) DEFAULT 60;
+// %% ALTER TABLE sys_o_tables ADD COLUMN enabled varchar(255) DEFAULT 1;
std::string sql = "CREATE TABLE \"main\".\"sys_o_tables\" (";
sql.append(" uuid varchar(255) PRIMARY KEY, ");
// sql.append(" ClusterName varchar(255) DEFAULT NULL,");//鏈湴搴撲笉闇�瑕�
@@ -241,7 +250,9 @@
sql.append("create_time BLOB DEFAULT (datetime('now', 'localtime')),");
sql.append("update_time DATETIME DEFAULT NULL,");
sql.append("create_by varchar(255) DEFAULT NULL,");
- sql.append("del_flag INTEGER DEFAULT 0");
+ sql.append("del_flag INTEGER DEFAULT 0,");
+ sql.append("monitorLevel varchar(255) DEFAULT 0,");
+ sql.append(" enabled varchar(255) DEFAULT 1");
sql.append(");");
// 浜鸿劯鐗瑰緛琛�
sql.append("CREATE TABLE " + g_dbName + ".'");
@@ -276,6 +287,9 @@
std::string sql = "update '";
sql.append(tableName + "' set ");
for (auto &item :fieldValues) {
+ if (item.second.size() == 0) {
+ continue;
+ }
sql.append(item.first + " = '" + item.second + "',");
}
sql.append(" update_time ='" + AppUtil::getTimeSecString() + "'");
--
Gitblit v1.8.0