From 979bc003bce710bf300bc2bd87a8278585678763 Mon Sep 17 00:00:00 2001 From: pansen <pansen626@sina.com> Date: 星期四, 07 三月 2019 14:47:14 +0800 Subject: [PATCH] GB28181集成完成。录像bug暂未解决,已注释 --- QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 48 insertions(+), 4 deletions(-) diff --git a/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp b/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp index 7495c9d..ff1bb42 100644 --- a/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp +++ b/QiaoJiaSystem/LocalDBTool/SqliteToolkit.hpp @@ -1,6 +1,10 @@ // // Created by pans on 4/28/18. // +/*** + * 璇存槑锛屾湰鏂囦欢涓昏鏄痵ql璇彞鎷兼帴鍙婅幏鍙栧凡瀹氫箟鐨剆ql璇彞 + * 鐩墠浠呮敮鎸佸崟琛╯ql璇彞鎷兼帴 + */ #ifndef TESTSQLITE_SQLITETOOLKIT_HPP #define TESTSQLITE_SQLITETOOLKIT_HPP @@ -24,6 +28,9 @@ */ typedef std::vector<unsigned char> FaceFeature; +/*** + * 娣诲姞浜鸿劯鐨勬暟鎹粨鏋� + */ struct AddFaceData { std::string uuid; FaceFeature feature; @@ -31,6 +38,9 @@ std::string feature_base64; }; +/*** + * 浜鸿劯淇℃伅鐨勬暟鎹粨鏋� + */ struct FaceInfo { std::string uuid; std::string personName; @@ -44,6 +54,9 @@ typedef std::vector<FaceInfo> FaceInfos; typedef std::map<std::string, FaceInfo> FaceInfosCache; +/*** + * 琛ㄤ俊鎭暟鎹粨鏋� + */ struct TableInfo { std::string uuid; std::string tableName; @@ -64,6 +77,9 @@ //typedef std::map<std::string, FaceFeatures> FeatureDBCache; +/*** + * 甯︽湁URL鍜屽叾浠栧睘鎬х殑浜鸿劯鐗瑰緛鏁版嵁缁撴瀯 + */ struct FaceFeatureWithUrl { std::string uuid; std::string faceurl; @@ -81,14 +97,19 @@ #define SQLERR(message) fprintf(stderr, "%s->%d-> SQLite error: %s\n",__FILE__,__LINE__, message); - //#todo 鏁版嵁搴搘enjian鍚嶇О + //#todo 鏁版嵁搴撴枃浠跺悕绉� + //鏄惁闇�瑕佷粠閰嶇疆鏂囦欢璇诲彇锛� static std::string file_dbName = "TestFaceDB.db"; //#todo 鏁版嵁搴撳悕绉� static std::string g_dbName = "main"; //#todo 绠$悊琛ㄧ殑琛ㄥ悕 static std::string g_tableName = "sys_o_tables"; - // + /*** + * 鑾峰彇浜鸿劯鐗瑰緛鏌ヨ鐨剆qlite璇彞 + * @param tableName 琛ㄥ悕锛屼笉甯� _fea + * @return + */ std::string getFacesFromTableSql(std::string tableName) { // #todo get monLevel 鑱斿悎鏌ヨ std::string sql = @@ -97,6 +118,11 @@ return sql; } + /*** + * 鏍规嵁琛ㄧ被鍨嬭幏鍙栨暟鎹〃鍒楄〃 + * @param type + * @return + */ std::string getTableListSqlWithType(std::string type) { std::string sql = "select tableName,del_flag from '" + g_tableName + "' where del_flag = 0"; if (type.size() > 0) { @@ -105,12 +131,20 @@ return sql; } + /*** + * 鏌ヨ浠绘剰琛ㄧ殑鎵�鏈夊瓧娈� + * @param tableName + * @return + */ std::string getTableInfosSql(std::string tableName) { std::string sql = "select * from '" + tableName + "';";// + " where del_flag = 0"; return sql; } - + /*** + * 鑾峰彇褰撳墠宸插垱寤虹殑琛� + * @return + */ std::string getTableInfosSql() { //uuid,tableName,tableDesc,tableType,bwType,startTime,endTime std::string sql = @@ -268,7 +302,12 @@ return sql; } - + /*** + * 鑾峰彇鏇存柊浜鸿劯涓氬姟淇℃伅琛ㄧ殑sql璇彞 + * @param tableName + * @param fieldValues + * @return + */ std::string getUpdateFaceTableSql(std::string tableName, FieldValues &fieldValues) { if (tableName.size() == 0) { //#todo errInfo @@ -299,6 +338,11 @@ //#TODO 浜鸿劯琛ㄩ渶瑕佸垹闄や袱涓� + /*** + * 鑾峰彇鍒犻櫎浜鸿劯琛ㄧ殑sql璇彞 + * @param tableName + * @return + */ std::string getDeleteFaceTableSql(std::string tableName) { if (tableName.size() == 0) { //#todo errInfo -- Gitblit v1.8.0