| | |
| | | std::string uuid; |
| | | FaceFeature feature; |
| | | std::string faceUrl; |
| | | std::string feature_base64; |
| | | }; |
| | | |
| | | struct FaceInfo { |
| | |
| | | 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; |
| | |
| | | std::string uuid; |
| | | std::string faceurl; |
| | | FaceFeature faceFeature; |
| | | std::string enable; |
| | | std::string monLevel; |
| | | }; |
| | | |
| | | typedef std::map<std::string, FaceFeatureWithUrl> FeatureDBWithUrlCache; |
| | |
| | | |
| | | // |
| | | 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 "; |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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 + "','"); |
| | | } |
| | |
| | | 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 + ".'"); |