Browse Source

update paozhu

hzq 5 months ago
parent
commit
1516b0344e

+ 91 - 84
frameworks/C++/paozhu/paozhu_benchmark/CMakeLists.txt

@@ -73,7 +73,7 @@ if(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
         endif ()
     else()
         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread -g -fsanitize=address -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/local/mysql/include   -I/usr/include -I/usr/include/mysql " )
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread -g -fsanitize=address -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/include " )
     endif ()
     message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}")
 
@@ -86,7 +86,7 @@ elseif(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
         endif ()
     else ()
         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wextra -O3")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread  -DASIO_STANDALONE ${BOOST_OPEN} ${GD_OPEN} -DBENCHMARK -I/usr/local/include -I/usr/local/mysql/include -I/usr/include -I/usr/include/mysql  " )
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread  -DASIO_STANDALONE ${BOOST_OPEN} ${GD_OPEN} -DBENCHMARK -I/usr/local/include -I/usr/include  " )
         file(MAKE_DIRECTORY /usr/local/etc/paozhu)
         file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/conf/ DESTINATION /usr/local/etc/paozhu/)
     endif ()
@@ -95,7 +95,7 @@ elseif(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
 else()
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
     message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread  -g -fsanitize=address  -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/local/mysql/include   -I/usr/include  -I/usr/include/mysql  " )
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread  -g -fsanitize=address  -DASIO_STANDALONE -DBENCHMARK -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/include " )
 
     if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
@@ -122,6 +122,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/viewsrc/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/websockets/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/orm)
 
 if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_pre)
   file(REMOVE_RECURSE ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_pre)
@@ -191,7 +192,7 @@ include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/libs)
 include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/include)
 include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/common)
 
-add_executable(paozhu_cli ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/http_cli.cpp)
+add_executable(paozhu_cli ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/http_cli.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/mysql_conn.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/mysql_conn_pool.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/clientdatacache.cpp)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
 
 
@@ -230,14 +231,17 @@ if (ENABLE_VCPKG)
     target_link_libraries(paozhu ZLIB::ZLIB)
 
     # find_package(libmysql REQUIRED)
-    find_package(unofficial-libmariadb CONFIG REQUIRED)
-    find_path(MYSQL_ROOT_DIR mysql)
+    # find_package(unofficial-libmariadb CONFIG REQUIRED)
+    # find_path(MYSQL_ROOT_DIR mysql)
     # target_link_libraries(paozhu ${MYSQL_LIBRARIES})
     # target_link_libraries(paozhu_cli ${MYSQL_LIBRARIES})
-    target_link_libraries(paozhu unofficial::libmariadb)
-    target_link_libraries(paozhu_cli unofficial::libmariadb)
-    target_include_directories(paozhu PUBLIC ${MYSQL_ROOT_DIR}/mysql)
-    target_include_directories(paozhu_cli PUBLIC ${MYSQL_ROOT_DIR}/mysql)
+    # target_link_libraries(paozhu unofficial::libmariadb)
+    # target_link_libraries(paozhu_cli unofficial::libmariadb)
+    # target_include_directories(paozhu PUBLIC ${MYSQL_ROOT_DIR}/mysql)
+    # target_include_directories(paozhu_cli PUBLIC ${MYSQL_ROOT_DIR}/mysql)
+
+    target_link_libraries(paozhu_cli asio::asio)
+    target_link_libraries(paozhu_cli OpenSSL::Crypto OpenSSL::SSL)
 
     if (ENABLE_GD STREQUAL "ON")
         find_package(PkgConfig)
@@ -331,6 +335,9 @@ if(OPENSSL_FOUND)
   INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}")
   target_link_libraries (paozhu ${OPENSSL_SSL_LIBRARY})
   target_link_libraries (paozhu ${OPENSSL_CRYPTO_LIBRARY})
+  
+  target_link_libraries (paozhu_cli ${OPENSSL_SSL_LIBRARY})
+  target_link_libraries (paozhu_cli ${OPENSSL_CRYPTO_LIBRARY})
 endif()
 
 
@@ -343,80 +350,80 @@ if(ZLIB_FOUND)
 endif()
 
 
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  if (IS_DIRECTORY "/usr/local/mysql/include")
-  MESSAGE( STATUS "/usr/local/mysql")
-      set(MYSQL_INCLUDE_DIR "/usr/local/mysql/include")
-      include_sub_directories_recursively(/usr/local/mysql/include)
-  endif()
- 
-  if (IS_DIRECTORY "/usr/local/opt/mysql-client")
-        MESSAGE( STATUS "/usr/local/opt/mysql-client")
-      set(MYSQL_INCLUDE_DIR "/usr/local/opt/mysql-client/include")
-      include_sub_directories_recursively(/usr/local/opt/mysql-client/include)
-  endif()
-  
-  if (IS_DIRECTORY "/opt/homebrew/opt/mysql")
-        MESSAGE( STATUS "/opt/homebrew/opt/mysql")
-      set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql/include")
-      include_sub_directories_recursively(/opt/homebrew/opt/mysql/include)
-  endif()
-  
-  
-  if (IS_DIRECTORY "/opt/homebrew/opt/mysql-client")
-        MESSAGE( STATUS "/opt/homebrew/opt/mysql-client")
-      set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql-client/include")
-      include_sub_directories_recursively(/opt/homebrew/opt/mysql-client/include)
-  endif()
-  MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
-else()  
- find_path(MYSQL_ROOT_DIR mysql)
-endif()
-
-
-FIND_PATH(MYSQL_INCLUDE_DIR NAMES mysql.h
-  PATHS /usr/local/include/mysql /usr/include/mysql /opt/homebrew/opt/mysql/include /usr/local/opt/mysql-client/include /opt/homebrew/opt/mysql-client/include
-)
-
-MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
-find_package_handle_standard_args(mysql REQUIRED_VARS MYSQL_ROOT_DIR)
-
-
-if(NOT MYSQL_INCLUDE_DIR)
-  message(STATUS "Could not find \"mysql.h\" from searching ")
-endif()
-
-SET(MYSQL_NAMES mysqlclient)
-FIND_LIBRARY(MYSQL_LIBRARY
-  NAMES ${MYSQL_NAMES}
-  PATHS /usr/lib /usr/local/lib /usr/local/mysql/lib /usr/local/opt/mysql/lib /opt/homebrew/opt/mysql/lib /opt/homebrew/opt/mysql-client/lib
-  PATH_SUFFIXES mysql
-)
-
-IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
-  SET(MYSQL_FOUND TRUE)
-  SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
-ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
-  SET(MYSQL_FOUND FALSE)
-  SET( MYSQL_LIBRARIES )
-ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
-
-IF (MYSQL_FOUND)
-  IF (NOT MYSQL_FIND_QUIETLY)
-    MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
-  ENDIF (NOT MYSQL_FIND_QUIETLY)
-ELSE (MYSQL_FOUND)
-  IF (MYSQL_FIND_REQUIRED)
-    MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
-    MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
-  ENDIF (MYSQL_FIND_REQUIRED)
-ENDIF (MYSQL_FOUND)
-
-target_include_directories(paozhu PUBLIC ${MYSQL_INCLUDE_DIR})
-target_link_libraries(paozhu ${MYSQL_LIBRARY})
-
-target_include_directories(paozhu_cli PUBLIC ${MYSQL_INCLUDE_DIR})
-target_link_libraries(paozhu_cli ${MYSQL_LIBRARY})
+#if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+#  if (IS_DIRECTORY "/usr/local/mysql/include")
+# MESSAGE( STATUS "/usr/local/mysql")
+#     set(MYSQL_INCLUDE_DIR "/usr/local/mysql/include")
+#     include_sub_directories_recursively(/usr/local/mysql/include)
+# endif()
+#
+# if (IS_DIRECTORY "/usr/local/opt/mysql-client")
+#       MESSAGE( STATUS "/usr/local/opt/mysql-client")
+#     set(MYSQL_INCLUDE_DIR "/usr/local/opt/mysql-client/include")
+#     include_sub_directories_recursively(/usr/local/opt/mysql-client/include)
+# endif()
+# 
+# if (IS_DIRECTORY "/opt/homebrew/opt/mysql")
+#       MESSAGE( STATUS "/opt/homebrew/opt/mysql")
+#     set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql/include")
+#     include_sub_directories_recursively(/opt/homebrew/opt/mysql/include)
+# endif()
+#   
+#   
+#   if (IS_DIRECTORY "/opt/homebrew/opt/mysql-client")
+#         MESSAGE( STATUS "/opt/homebrew/opt/mysql-client")
+#       set(MYSQL_INCLUDE_DIR "/opt/homebrew/opt/mysql-client/include")
+#       include_sub_directories_recursively(/opt/homebrew/opt/mysql-client/include)
+#   endif()
+#   MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
+#else()  
+#  find_path(MYSQL_ROOT_DIR mysql)
+#endif()
+# 
+# 
+# FIND_PATH(MYSQL_INCLUDE_DIR NAMES mysql.h
+#   PATHS /usr/local/include/mysql /usr/include/mysql /opt/homebrew/opt/mysql/include /usr/local/opt/mysql-client/include /opt/homebrew/opt/mysql-client/include
+# )
+# 
+# MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ")
+# find_package_handle_standard_args(mysql REQUIRED_VARS MYSQL_ROOT_DIR)
+# 
+# 
+# if(NOT MYSQL_INCLUDE_DIR)
+#   message(STATUS "Could not find \"mysql.h\" from searching ")
+# endif()
+# 
+# SET(MYSQL_NAMES mysqlclient)
+# FIND_LIBRARY(MYSQL_LIBRARY
+#   NAMES ${MYSQL_NAMES}
+#   PATHS /usr/lib /usr/local/lib /usr/local/mysql/lib /usr/local/opt/mysql/lib /opt/homebrew/opt/mysql/lib /opt/homebrew/opt/mysql-client/lib
+#   PATH_SUFFIXES mysql
+# )
+# 
+# IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+#   SET(MYSQL_FOUND TRUE)
+#   SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
+# ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+#   SET(MYSQL_FOUND FALSE)
+#   SET( MYSQL_LIBRARIES )
+# ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY)
+# 
+# IF (MYSQL_FOUND)
+#   IF (NOT MYSQL_FIND_QUIETLY)
+#     MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}")
+#   ENDIF (NOT MYSQL_FIND_QUIETLY)
+# ELSE (MYSQL_FOUND)
+#   IF (MYSQL_FIND_REQUIRED)
+#     MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.")
+#     MESSAGE(FATAL_ERROR "Could NOT find MySQL library")
+#   ENDIF (MYSQL_FIND_REQUIRED)
+# ENDIF (MYSQL_FOUND)
+# 
+# target_include_directories(paozhu PUBLIC ${MYSQL_INCLUDE_DIR})
+# target_link_libraries(paozhu ${MYSQL_LIBRARY})
+# 
+# target_include_directories(paozhu_cli PUBLIC ${MYSQL_INCLUDE_DIR})
+# target_link_libraries(paozhu_cli ${MYSQL_LIBRARY})
 
 
 

+ 3 - 0
frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h

@@ -6,4 +6,7 @@
 #define CONST_HTTP_HEADER_BODY_SIZE 16384
 #define CONST_PHP_BODY_POST_SIZE 16777216
 
+#define CONST_HTTP_BODY_POST_SIZE 33554432
+#define CONST_HTTP_JSON_POST_SIZE 2097152
+
 #endif

+ 13 - 2
frameworks/C++/paozhu/paozhu_benchmark/common/httphook.cpp

@@ -8,13 +8,24 @@
 #include <memory>
 #include <string_view>
 #include "httppeer.h"
+#include "client_session.h"
 namespace http
 {
 std::map<std::string, bool> _block_ip_tables;
 std::map<std::string, bool> _block_host_tables;
-bool check_blockip(const std::string &client_ip)
+std::map<std::string, bool> _passport_ip_tables;
+std::map<std::string, bool> _passport_host_tables;
+bool check_blockip(std::shared_ptr<client_session> peer_session)
 {
-    if (client_ip.size() > 0)
+    if (peer_session->isssl)
+    {
+        return false;
+    }
+    return false;
+}
+bool check_pressl_blockip(std::shared_ptr<client_session> peer_session)
+{
+    if (peer_session->isssl)
     {
         return false;
     }

+ 9 - 7
frameworks/C++/paozhu/paozhu_benchmark/models/Fortune.cpp

@@ -1,14 +1,16 @@
-#include "mysqlorm.hpp"
+
+#include "fortune_mysql.h"
 #include "fortunebase.h"
 #include "Fortune.h"
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
- *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
+*If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 
-namespace orm
-{
+	 
+ namespace orm{
+ 
+			 Fortune::Fortune(std::string dbtag):fortune_mysql(dbtag){ mod=this; }
+			 Fortune::Fortune():fortune_mysql(){ mod=this; }
 
-Fortune::Fortune(std::string dbtag) : mysql_orm(dbtag) {}
-Fortune::Fortune() : mysql_orm() {}
 
-}// namespace orm
+	  }

+ 9 - 7
frameworks/C++/paozhu/paozhu_benchmark/models/World.cpp

@@ -1,14 +1,16 @@
-#include "mysqlorm.hpp"
+
+#include "world_mysql.h"
 #include "worldbase.h"
 #include "World.h"
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
- *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
+*If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 
-namespace orm
-{
+	 
+ namespace orm{
+ 
+			 World::World(std::string dbtag):world_mysql(dbtag){ mod=this; }
+			 World::World():world_mysql(){ mod=this; }
 
-World::World(std::string dbtag) : mysql_orm(dbtag) {}
-World::World() : mysql_orm() {}
 
-}// namespace orm
+	  }

+ 9788 - 0
frameworks/C++/paozhu/paozhu_benchmark/models/fortune_mysql.h

@@ -0,0 +1,9788 @@
+#ifndef _ORM_DEFAULT_FORTUNE_OPERATE_H
+#define _ORM_DEFAULT_FORTUNE_OPERATE_H
+
+#include <iostream>
+#include <mutex>
+#include <string>
+#include <map>
+#include <set>
+#include <string_view>
+#include <thread>
+#include "request.h"
+#include "unicode.h"
+#include "datetime.h"
+#include <stdexcept>
+#include <iostream>
+#include <functional>
+#include <tuple>
+#include <typeinfo>
+#include <memory>
+#include <list>
+#include <queue>
+#include <cmath>
+#include <condition_variable>
+#include <sstream>
+#include <algorithm>
+#include <vector>
+
+#include "mysql_conn.h"
+#include "mysql_conn_pool.h"
+#include "orm_cache.hpp"
+/*baseincludefile*/
+namespace orm
+{
+// mysql Operational SQL middleware
+/*tagnamespace*/
+//{ /*tagnamespace_replace*/
+    template <typename M_MODEL, typename B_BASE>
+    class fortune_mysql : public B_BASE
+    {
+      public:
+        fortune_mysql(const std::string &tag) : dbtag(tag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        fortune_mysql() : dbtag(B_BASE::_rmstag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        M_MODEL &switchDB(const std::string &temptag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(temptag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + temptag;
+            }
+        }
+        M_MODEL &set_table(const std::string &table_name)
+        {
+            if (original_tablename.empty())
+            {
+                original_tablename = B_BASE::tablename;
+            }
+            if (table_name.size() > 0)
+            {
+                B_BASE::tablename = table_name;
+            }
+            return *mod;
+        }
+        M_MODEL &reset_table()
+        {
+            if (original_tablename.empty())
+            {
+                return *mod;
+            }
+            B_BASE::tablename = original_tablename;
+            return *mod;
+        }
+        unsigned int count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                return 0;
+            }
+
+            return 0;
+        }
+        std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>
+        page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+        asio::awaitable<unsigned int> async_count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        asio::awaitable<std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>>
+        async_page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = async_count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            co_return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+
+        unsigned int update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int replace_col(std::string colname, const std::string &old_string, const std::string &new_string)
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+
+            countsql.append(" = REPLACE(");
+            countsql.append(colname);
+            countsql.append(",'");
+            countsql.append(old_string);
+            countsql.append("','");
+            countsql.append(new_string);
+            countsql.append("') ");
+
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        void assign_field_value(unsigned char index_pos, unsigned char *result_temp_data, unsigned int value_size, typename B_BASE::meta &data_temp)
+    {
+        switch(index_pos)
+        {
+            case 0:
+            data_temp.id=0;
+            
+            for(unsigned int i=0; i< value_size; i++)
+            {
+                if(result_temp_data[i]>='0'&&result_temp_data[i]<='9')
+                {
+
+                data_temp.id= data_temp.id * 10 + (result_temp_data[i]-'0');
+                }   
+                if(i>32)
+                {
+                    break;
+                }
+            }
+            break;
+                case 1:
+            data_temp.message.clear();
+            data_temp.message.resize(value_size);
+            
+            std::memcpy(data_temp.message.data(), result_temp_data, value_size);
+            break;
+                
+        }
+    }
+    
+
+M_MODEL& eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+M_MODEL& nullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& nnullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& eqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& l_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& r_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& beMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& leMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nnullMessage()
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != NULL ");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+				wheresql.append(val);
+				wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninMessage(const std::vector<std::string> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(B_BASE::stringaddslash(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninMessage(const std::vector<T> &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i>0)
+            {
+                wheresql.push_back(',');  
+            }
+            wheresql.push_back('\'');  
+            wheresql.append(std::to_string(val[i]));
+            wheresql.push_back('\'');    
+        }
+    
+
+    
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& orl_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '%");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& orr_likeMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message LIKE '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.append("%'");
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leMessage(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(B_BASE::stringaddslash(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& eqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& nqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& btMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& beMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& ltMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+		wheresql.append(std::to_string(val));
+		wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& leMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_eqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message = '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_nqMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message != '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_btMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message > '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_beMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message >= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_ltMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message < '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+template <typename T>
+		requires std::is_floating_point_v<T>||std::is_integral_v<T>
+M_MODEL& or_leMessage(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" message <= '");
+				wheresql.append(std::to_string(val));
+				wheresql.push_back('\'');
+
+        return *mod;   
+    }   
+    
+
+        M_MODEL &select(const std::string &fieldname)
+        {
+            if (selectsql.size() > 0)
+            {
+                selectsql.push_back(',');
+            }
+            selectsql.append(fieldname);
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, char bi, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            wheresql.push_back('\'');
+
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &between(const std::string &wq, const std::string &a, const std::string &b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN '");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << "' AND '";
+            _stream << b;
+            _stream << "' ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &between(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &orBetween(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val.size() > 0 && (val[0] == '%' || val.back() == '%'))
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereLikeLeft(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.push_back('%');
+            wheresql.append(val);
+            wheresql.append("' ");
+            return *mod;
+        }
+        M_MODEL &whereLikeRight(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.append(val);
+            wheresql.append("%' ");
+            return *mod;
+        }
+        M_MODEL &whereOrLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val[0] == '%' || val.back() == '%')
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereAnd(const std::string &wq, _SQL_Value val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOr(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k, const std::string &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            wheresql.append(a);
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &whereIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::list<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &order(const std::string &wq)
+        {
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            return *mod;
+        }
+        M_MODEL &asc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" ASC ");
+            return *mod;
+        }
+
+        M_MODEL &desc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" DESC ");
+            return *mod;
+        }
+
+        M_MODEL &having(const std::string &wq)
+        {
+
+            groupsql.append(" HAVING by ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &group(const std::string &wq)
+        {
+
+            groupsql.append(" GROUP BY ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &orsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &andsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &endsub()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &or_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &and_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &or_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &and_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &limit(unsigned int num)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            return *mod;
+        }
+        M_MODEL &limit(unsigned int num, unsigned int endnum)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            limitsql.push_back(',');
+            limitsql.append(std::to_string(endnum));
+            return *mod;
+        }
+
+        std::vector<std::map<std::string, std::string>> fetch_obj()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::map<std::string, std::string>> temprecord;
+
+            if (iserror)
+            {
+                return temprecord;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return temprecord;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return temprecord;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::map<std::string, std::string> data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if (field_array[ij].name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].name, std::move(temp_str)});
+                                    }
+                                    else if (field_array[ij].org_name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].org_name, std::move(temp_str)});
+                                    }
+
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return temprecord;
+        }
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        fetch_row()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                model_meta_cache<std::vector<std::string>> &temp_cache =
+                    model_meta_cache<std::vector<std::string>>::getinstance();
+                temprecord = temp_cache.get(sqlhashid);
+                if (temprecord.size() > 0)
+                {
+                    iscache                                    = false;
+                    model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                    table_fieldname                            = table_cache.get(sqlhashid);
+
+                    model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                        model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                    table_fieldmap = tablemap_cache.get_obj(sqlhashid);
+
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        if (temprecord.size() > 0)
+                        {
+                            std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                            model_meta_cache<std::vector<std::string>> &temp_cache =
+                                model_meta_cache<std::vector<std::string>>::getinstance();
+                            temp_cache.save(sqlhashid, temprecord, exptime);
+
+                            exptime += 1;
+                            model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                            table_cache.save(sqlhashid, table_fieldname, exptime);
+
+                            model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                                model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                            tablemap_cache.save(sqlhashid, table_fieldmap, exptime);
+                            exptime = 0;
+                            iscache = false;
+                        }
+                    }
+                }
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+        M_MODEL &fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                return *mod;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return *mod;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return *mod;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        M_MODEL &fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            if (iserror)
+            {
+                return *mod;
+            }
+ 
+            try
+            {
+ 
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+                
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 1;
+                }
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                // asio::error_code ec;
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    // std::memset(result_data, 0x00, 4096);
+                    // n      = co_await conn->socket->async_read_some(asio::buffer(result_data), asio::use_awaitable);
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                effect_num++;
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        unsigned int fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        M_MODEL &use_cache(int cache_time = 0)
+        {
+            iscache = true;
+            exptime = cache_time;
+            return *mod;
+        }
+        bool isuse_cache(bool iscachedate = false)
+        {
+            if (iscachedate)
+            {
+                return exptime == 0 && iscache == false;
+            }
+            return iscache;
+        }
+        void set_cache_state(bool isrestatus = false) { iscache = isrestatus; }
+        void remove_exptime_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.remove_exptime();
+        }
+        void clear_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.clear();
+        }
+        bool remove_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.remove(sqlhashid);
+        }
+        bool remove_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.remove(cache_key_name);
+        }
+        int check_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.check(cache_key_name);
+        }
+        std::vector<typename B_BASE::meta> get_cache_data(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get(cache_key_name);
+            return cache_data;
+        }
+        typename B_BASE::meta get_cache_obj(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get_obj(cache_key_name);
+            return cache_data;
+        }
+        M_MODEL &get_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                B_BASE::record_reset();
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+            }
+            return *mod;
+        }
+        int update_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.update(sqlhashid, exp_time);
+        }
+        int update_cache(std::size_t cache_key_name, int exp_time)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.update(cache_key_name, exp_time);
+        }
+        bool save_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            temp_cache.save(sqlhashid, B_BASE::record, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, typename B_BASE::meta &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, std::vector<typename B_BASE::meta> &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+        bool get_cacherecord(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                return false;
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+                return true;
+            }
+        }
+        http::OBJ_VALUE fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return valuetemp;
+        }
+
+        asio::awaitable<http::OBJ_VALUE> async_fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                co_return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return valuetemp;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return valuetemp;
+        }
+
+        long long get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        int update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<int> async_update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+        asio::awaitable<int> async_update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+
+        int update_batch(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (B_BASE::record.size() == 0)
+            {
+                return 0;
+            }
+            if (fieldname.size() > 0)
+            {
+                sqlstring = B_BASE::_make_insert_into_sql(fieldname);
+            }
+            else
+            {
+                sqlstring = B_BASE::_make_replace_into_sql();
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int soft_remove(const std::string &fieldsql)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::soft_remove_sql(fieldsql);
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int soft_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    effect_num = 1;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            if (effect_num == 1)
+            {
+                sqlstring = B_BASE::soft_remove_sql(" ");
+            }
+            else
+            {
+                sqlstring = B_BASE::soft_remove_sql("");
+            }
+            effect_num = 0;
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        long long insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+
+        long long save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    return 0;
+                }
+
+                if (iserror)
+                {
+                    return 0;
+                }
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    co_return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    co_return 0;
+                }
+
+                if (iserror)
+                {
+                    co_return 0;
+                }
+
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                        iserror = true;
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                        co_return effect_num;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                    co_return 0;
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                    co_return 0;
+                }
+                co_return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                    
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                        long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                        co_return insert_last_id;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                }
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        asio::awaitable<std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>>
+        async_query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                co_return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        // long long edit_query(const std::string &rawsql, bool isinsert = false)
+        // {
+        //     if (iserror)
+        //     {
+        //         return 0;
+        //     }
+
+        //     return 0;
+        // }
+        M_MODEL &clear(bool both = true)
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            if (both)
+            {
+                B_BASE::record_reset();
+                B_BASE::data_reset();
+            }
+            return *mod;
+        }
+        M_MODEL &clearWhere()
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            return *mod;
+        }
+        M_MODEL &set_data(typename B_BASE::meta indata)
+        {
+            B_BASE::data = indata;
+            return *mod;
+        }
+        M_MODEL &get() { return *mod; }
+        std::string get_query() { return sqlstring; }
+        M_MODEL &start_commit()
+        {
+            iscommit = true;
+            return *mod;
+        }
+        M_MODEL &end_commit()
+        {
+            iscommit = false;
+            return *mod;
+        }
+
+        unsigned int effect()
+        {
+            return effect_num;
+        }
+        bool conn_empty()
+        {
+            if (conn_obj)
+            {
+                return false; 
+            }
+            error_msg = "conn_obj is null";
+            iserror   = true;
+            return true;
+        }
+
+      public:
+        std::string selectsql;
+        std::string wheresql;
+        std::string ordersql;
+        std::string groupsql;
+        std::string limitsql;
+        std::string sqlstring;
+        std::string dbtag;
+        std::string error_msg;
+        std::string original_tablename;
+
+        // std::list<std::string> commit_sqllist;
+        bool iskuohao           = false;
+        bool iscommit           = false;
+        bool ishascontent       = false;
+        bool iscache            = false;
+        bool iserror            = false;
+        int exptime             = 0;
+        unsigned int effect_num = 0;
+
+        M_MODEL *mod;
+
+        std::shared_ptr<orm_conn_pool> conn_obj;
+    };
+//} /*tagnamespace_replace*/
+}// namespace orm
+#endif

+ 9 - 11
frameworks/C++/paozhu/paozhu_benchmark/models/include/Fortune.h

@@ -1,18 +1,16 @@
 #ifndef ORM_DEFAULT_FORTUNE_H
 #define ORM_DEFAULT_FORTUNE_H
-#include "mysqlorm.hpp"
+#include "fortune_mysql.h" 
 #include "fortunebase.h"
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
- *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
+*If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 
-namespace orm
-{
-class Fortune : public mysql_orm<Fortune, fortunebase>
-{
-  public:
-    Fortune(std::string dbtag);
-    Fortune();
-};
-};// namespace orm
+ namespace orm {
+		class Fortune : public fortune_mysql<Fortune,fortunebase>{
+		 public:
+		 Fortune(std::string dbtag);
+		 Fortune();
+		};
+}
 #endif

+ 9 - 11
frameworks/C++/paozhu/paozhu_benchmark/models/include/World.h

@@ -1,18 +1,16 @@
 #ifndef ORM_DEFAULT_WORLD_H
 #define ORM_DEFAULT_WORLD_H
-#include "mysqlorm.hpp"
+#include "world_mysql.h" 
 #include "worldbase.h"
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。
- *If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
+*If this file exists, it will not be overwritten automatically. If not, it will be generated automatically. */
 
-namespace orm
-{
-class World : public mysql_orm<World, worldbase>
-{
-  public:
-    World(std::string dbtag);
-    World();
-};
-};// namespace orm
+ namespace orm {
+		class World : public world_mysql<World,worldbase>{
+		 public:
+		 World(std::string dbtag);
+		 World();
+		};
+}
 #endif

+ 9628 - 0
frameworks/C++/paozhu/paozhu_benchmark/models/world_mysql.h

@@ -0,0 +1,9628 @@
+#ifndef _ORM_DEFAULT_WORLD_OPERATE_H
+#define _ORM_DEFAULT_WORLD_OPERATE_H
+
+#include <iostream>
+#include <mutex>
+#include <string>
+#include <map>
+#include <set>
+#include <string_view>
+#include <thread>
+#include "request.h"
+#include "unicode.h"
+#include "datetime.h"
+#include <stdexcept>
+#include <iostream>
+#include <functional>
+#include <tuple>
+#include <typeinfo>
+#include <memory>
+#include <list>
+#include <queue>
+#include <cmath>
+#include <condition_variable>
+#include <sstream>
+#include <algorithm>
+#include <vector>
+
+#include "mysql_conn.h"
+#include "mysql_conn_pool.h"
+#include "orm_cache.hpp"
+/*baseincludefile*/
+namespace orm
+{
+// mysql Operational SQL middleware
+/*tagnamespace*/
+//{ /*tagnamespace_replace*/
+    template <typename M_MODEL, typename B_BASE>
+    class world_mysql : public B_BASE
+    {
+      public:
+        world_mysql(const std::string &tag) : dbtag(tag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        world_mysql() : dbtag(B_BASE::_rmstag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(dbtag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + dbtag;
+            }
+        }
+        M_MODEL &switchDB(const std::string &temptag)
+        {
+            std::map<std::string, std::shared_ptr<orm_conn_pool>> &conn_pool_obj = get_orm_conn_pool_obj();
+            auto iter                                                            = conn_pool_obj.find(temptag);
+            if (iter != conn_pool_obj.end())
+            {
+                conn_obj = iter->second;
+            }
+            else
+            {
+                conn_obj  = nullptr;
+                iserror   = true;
+                error_msg = "conn_pool not found " + temptag;
+            }
+        }
+        M_MODEL &set_table(const std::string &table_name)
+        {
+            if (original_tablename.empty())
+            {
+                original_tablename = B_BASE::tablename;
+            }
+            if (table_name.size() > 0)
+            {
+                B_BASE::tablename = table_name;
+            }
+            return *mod;
+        }
+        M_MODEL &reset_table()
+        {
+            if (original_tablename.empty())
+            {
+                return *mod;
+            }
+            B_BASE::tablename = original_tablename;
+            return *mod;
+        }
+        unsigned int count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                return 0;
+            }
+
+            return 0;
+        }
+        std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>
+        page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+        asio::awaitable<unsigned int> async_count()
+        {
+            std::string countsql;
+            countsql = "SELECT count(*) as total_countnum  FROM ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" WHERE ");
+            if (wheresql.empty())
+            {
+                countsql.append(" 1 ");
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                //std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                querysql_len = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int tempnum = 0;
+
+                                unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                querysql_len = 0;
+                                for (unsigned int ik = 0; ik < name_length; ik++)
+                                {
+                                    if (temp_pack_data.data[tempnum] >= '0' && temp_pack_data.data[tempnum] <= '9')
+                                    {
+                                        querysql_len = querysql_len * 10 + (temp_pack_data.data[tempnum] - '0');
+                                    }
+                                    tempnum++;
+                                }
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return querysql_len;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        asio::awaitable<std::tuple<unsigned int, unsigned int, unsigned int, unsigned int>>
+        async_page(unsigned int page, unsigned int per_page = 10, unsigned int list_num = 5)
+        {
+            unsigned int total_page = async_count();
+            if (per_page == 0)
+            {
+                per_page = 10;
+            }
+            if (list_num < 1)
+            {
+                list_num = 1;
+            }
+            total_page = std::ceil((float)total_page / per_page);
+
+            if (total_page < 1)
+            {
+                total_page = 1;
+            }
+            if (page > total_page)
+            {
+                page = total_page;
+            }
+            if (page < 1)
+            {
+                page = 1;
+            }
+            unsigned int mid_num  = std::floor(list_num / 2);
+            unsigned int last_num = list_num - 1;
+
+            int temp_num = page - mid_num;
+
+            unsigned int minpage = temp_num < 1 ? 1 : temp_num;
+            unsigned int maxpage = minpage + last_num;
+
+            if (maxpage > total_page)
+            {
+                maxpage  = total_page;
+                temp_num = (maxpage - last_num);
+                if (temp_num < 1)
+                {
+                    minpage = 1;
+                }
+                else
+                {
+                    minpage = temp_num;
+                }
+            }
+            limit((page - 1) * per_page, per_page);
+            co_return std::make_tuple(minpage, maxpage, page, total_page);
+        }
+
+        unsigned int update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_update_col(std::string colname, int num, char symbol = '+')
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+            if (num > 0)
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.append(std::to_string(num));
+            }
+            else
+            {
+                countsql.append(" = ");
+                countsql.append(colname);
+                countsql.push_back(' ');
+                countsql.push_back(symbol);
+                countsql.push_back('(');
+                countsql.push_back('-');
+                countsql.append(std::to_string(std::abs(num)));
+                countsql.push_back(')');
+            }
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int replace_col(std::string colname, const std::string &old_string, const std::string &new_string)
+        {
+            effect_num = 0;
+            std::string countsql;
+            countsql = "UPDATE ";
+            countsql.append(B_BASE::tablename);
+            countsql.append(" SET ");
+            countsql.append(colname);
+
+            countsql.append(" = REPLACE(");
+            countsql.append(colname);
+            countsql.append(",'");
+            countsql.append(old_string);
+            countsql.append("','");
+            countsql.append(new_string);
+            countsql.append("') ");
+
+            countsql.append(" where ");
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    countsql.append(tempsql.str());
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            else
+            {
+                countsql.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                countsql.append(groupsql);
+            }
+            if (!limitsql.empty())
+            {
+                countsql.append(limitsql);
+            }
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = countsql.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(countsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    //insertid      = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        void assign_field_value(unsigned char index_pos, unsigned char *result_temp_data, unsigned int value_size, typename B_BASE::meta &data_temp)
+    {
+        switch(index_pos)
+        {
+            case 0:
+            data_temp.id=0;
+            
+            for(unsigned int i=0; i< value_size; i++)
+            {
+                if(result_temp_data[i]>='0'&&result_temp_data[i]<='9')
+                {
+
+                data_temp.id= data_temp.id * 10 + (result_temp_data[i]-'0');
+                }   
+                if(i>32)
+                {
+                    break;
+                }
+            }
+            break;
+                case 1:
+            data_temp.randomnumber=0;
+            
+            for(unsigned int i=0; i< value_size; i++)
+            {
+                if(result_temp_data[i]>='0'&&result_temp_data[i]<='9')
+                {
+
+                data_temp.randomnumber= data_temp.randomnumber * 10 + (result_temp_data[i]-'0');
+                }   
+                if(i>32)
+                {
+                    break;
+                }
+            }
+            break;
+                
+        }
+    }
+    
+
+M_MODEL& eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninId(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninId(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leId(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_eqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_nqId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_btId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_beId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ltId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_leId(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" id <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+M_MODEL& eqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& nqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& inRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& inRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& inRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ninRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& ninRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& btRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& beRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& ltRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& leRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_eqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_nqRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_inRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_inRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        wheresql.append(val);
+        wheresql.push_back(')');
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ninRandomnumber(const std::vector<T>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+            wheresql.append(std::to_string(val[i]));
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ninRandomnumber(const std::vector<std::string>& val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber NOT IN(");
+
+        for(unsigned int i=0;i<val.size(); i++)
+        {
+            if(i > 0)
+            {
+                wheresql.push_back(',');
+            }
+
+            try
+            {
+                wheresql.append(std::to_string(std::stoll(val[i])));
+            }
+            catch (std::invalid_argument const& ex)
+            {
+                wheresql.push_back('0');
+            }
+            catch (std::out_of_range const& ex)
+            {
+                wheresql.push_back('0');
+            }
+        }
+        wheresql.push_back(')');
+
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_btRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_beRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_ltRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+M_MODEL& or_leRandomnumber(const std::string &val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        try
+        {
+            wheresql.append(std::to_string(std::stoll(val)));
+        }
+        catch (std::invalid_argument const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        catch (std::out_of_range const& ex)
+        {
+           wheresql.push_back('0');
+        }
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& eqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& nqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& btRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& beRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& ltRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& leRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" AND ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" AND ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_eqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber = ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_nqRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber != ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_btRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber > ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_beRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber >= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_ltRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber < ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+template <typename T>
+	requires std::is_integral_v<T>
+M_MODEL& or_leRandomnumber(T val)
+	{
+        if (wheresql.empty())
+        {
+        }
+        else
+        {
+            if (ishascontent)
+            {
+                wheresql.append(" OR ");
+            }
+            else
+            {
+                if (!iskuohao)
+                {
+                    wheresql.append(" OR ");
+                }
+            }
+        }
+        if (iskuohao)
+        {
+            ishascontent = true;
+        }
+        wheresql.append(" randomnumber <= ");
+
+        wheresql.append(std::to_string(val));
+        return *mod;   
+    }   
+    
+
+        M_MODEL &select(const std::string &fieldname)
+        {
+            if (selectsql.size() > 0)
+            {
+                selectsql.push_back(',');
+            }
+            selectsql.append(fieldname);
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, http::OBJ_VALUE &obj)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            if (obj.is_string())
+            {
+                wheresql.push_back('\'');
+                wheresql.append(obj.as_string());
+                wheresql.push_back('\'');
+            }
+            else
+            {
+
+                wheresql.append(obj.to_string());
+            }
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &where(const std::string &wq, char bi, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+
+        M_MODEL &where(const std::string &wq, char bi, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.push_back(bi);
+            wheresql.push_back('\'');
+
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &where(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &between(const std::string &wq, const std::string &a, const std::string &b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN '");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << "' AND '";
+            _stream << b;
+            _stream << "' ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &between(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &orBetween(const std::string &wq, _SQL_Value a, _SQL_Value b)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(" (");
+            wheresql.append(wq);
+            wheresql.append(" BETWEEN ");
+            std::stringstream _stream;
+            _stream << a;
+            _stream << " AND ";
+            _stream << b;
+            _stream << " ) ";
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val.size() > 0 && (val[0] == '%' || val.back() == '%'))
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereLikeLeft(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.push_back('%');
+            wheresql.append(val);
+            wheresql.append("' ");
+            return *mod;
+        }
+        M_MODEL &whereLikeRight(const std::string &wq, const std::string &val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            wheresql.append(val);
+            wheresql.append("%' ");
+            return *mod;
+        }
+        M_MODEL &whereOrLike(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" like '");
+            if (val[0] == '%' || val.back() == '%')
+            {
+                wheresql.append(val);
+                wheresql.append("' ");
+            }
+            else
+            {
+                wheresql.push_back('%');
+                wheresql.append(val);
+                wheresql.append("%' ");
+            }
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereAnd(const std::string &wq, _SQL_Value val)
+        {
+
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereAnd(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOr(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+            std::stringstream _stream;
+            _stream << val;
+            wheresql.append(_stream.str());
+            return *mod;
+        }
+        M_MODEL &whereOr(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            char bi = wq.back();
+            if (bi == '=' || bi == '>' || bi == '<')
+            {
+            }
+            else
+            {
+                wheresql.push_back('=');
+            }
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            return *mod;
+        }
+        M_MODEL &whereIn(const std::string &k, const std::string &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            wheresql.append(a);
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &whereIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<std::string> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",\'");
+                }
+                else
+                {
+                    wheresql.append("\'");
+                }
+                wheresql.append(key);
+                wheresql.append("\'");
+                i++;
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::list<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" in(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+        template <typename _SQL_Value>
+            requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereNotIn(const std::string &k, const std::vector<_SQL_Value> &a)
+        {
+            if (wheresql.empty())
+            {
+            }
+            else
+            {
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+
+            wheresql.append(k);
+            wheresql.append(" NOT IN(");
+            int i = 0;
+            std::stringstream _stream;
+            for (auto &key : a)
+            {
+                if (i > 0)
+                {
+                    wheresql.append(",");
+                }
+                _stream << key;
+                wheresql.append(_stream.str());
+                i++;
+                _stream.str("");
+            }
+            wheresql.append(") ");
+            return *mod;
+        }
+
+        M_MODEL &order(const std::string &wq)
+        {
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            return *mod;
+        }
+        M_MODEL &asc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" ASC ");
+            return *mod;
+        }
+
+        M_MODEL &desc(const std::string &wq)
+        {
+
+            ordersql.append(" ORDER by ");
+            ordersql.append(wq);
+            ordersql.append(" DESC ");
+            return *mod;
+        }
+
+        M_MODEL &having(const std::string &wq)
+        {
+
+            groupsql.append(" HAVING by ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &group(const std::string &wq)
+        {
+
+            groupsql.append(" GROUP BY ");
+            groupsql.append(wq);
+            return *mod;
+        }
+
+        M_MODEL &orsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &andsub()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &endsub()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &or_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            else
+            {
+                wheresql.append(" OR (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+            return *mod;
+        }
+        M_MODEL &and_b()
+        {
+
+            if (iskuohao == true)
+            {
+                iskuohao = false;
+                wheresql.append(" )");
+                ishascontent = false;
+            }
+            else
+            {
+                wheresql.append(" AND (");
+                iskuohao     = true;
+                ishascontent = false;
+            }
+
+            return *mod;
+        }
+
+        M_MODEL &or_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &and_e()
+        {
+            if (iskuohao == true)
+            {
+                iskuohao     = false;
+                ishascontent = false;
+                wheresql.append(" )");
+            }
+            return *mod;
+        }
+
+        M_MODEL &limit(unsigned int num)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            return *mod;
+        }
+        M_MODEL &limit(unsigned int num, unsigned int endnum)
+        {
+            limitsql.clear();
+            limitsql.append(" limit ");
+            limitsql.append(std::to_string(num));
+            limitsql.push_back(',');
+            limitsql.append(std::to_string(endnum));
+            return *mod;
+        }
+
+        std::vector<std::map<std::string, std::string>> fetch_obj()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::map<std::string, std::string>> temprecord;
+
+            if (iserror)
+            {
+                return temprecord;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return temprecord;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return temprecord;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::map<std::string, std::string> data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if (field_array[ij].name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].name, std::move(temp_str)});
+                                    }
+                                    else if (field_array[ij].org_name.size() > 0)
+                                    {
+                                        data_temp.insert({field_array[ij].org_name, std::move(temp_str)});
+                                    }
+
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return temprecord;
+        }
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        fetch_row()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                model_meta_cache<std::vector<std::string>> &temp_cache =
+                    model_meta_cache<std::vector<std::string>>::getinstance();
+                temprecord = temp_cache.get(sqlhashid);
+                if (temprecord.size() > 0)
+                {
+                    iscache                                    = false;
+                    model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                    table_fieldname                            = table_cache.get(sqlhashid);
+
+                    model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                        model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                    table_fieldmap = tablemap_cache.get_obj(sqlhashid);
+
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        if (temprecord.size() > 0)
+                        {
+                            std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+
+                            model_meta_cache<std::vector<std::string>> &temp_cache =
+                                model_meta_cache<std::vector<std::string>>::getinstance();
+                            temp_cache.save(sqlhashid, temprecord, exptime);
+
+                            exptime += 1;
+                            model_meta_cache<std::string> &table_cache = model_meta_cache<std::string>::getinstance();
+                            table_cache.save(sqlhashid, table_fieldname, exptime);
+
+                            model_meta_cache<std::map<std::string, unsigned int>> &tablemap_cache =
+                                model_meta_cache<std::map<std::string, unsigned int>>::getinstance();
+                            tablemap_cache.save(sqlhashid, table_fieldmap, exptime);
+                            exptime = 0;
+                            iscache = false;
+                        }
+                    }
+                }
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+        M_MODEL &fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                return *mod;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return *mod;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return *mod;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::record_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        M_MODEL &fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return *mod;
+                }
+            }
+
+            if (iserror)
+            {
+                return *mod;
+            }
+ 
+            try
+            {
+ 
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+                
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return *mod;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return *mod;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return *mod;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_append()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 1;
+                }
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                // asio::error_code ec;
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    // std::memset(result_data, 0x00, 4096);
+                    // n      = co_await conn->socket->async_read_some(asio::buffer(result_data), asio::use_awaitable);
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                typename B_BASE::meta data_temp;
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                    tempnum = tempnum + name_length;
+                                }
+                                effect_num++;
+                                B_BASE::record.emplace_back(std::move(data_temp));
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+        unsigned int fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+                unsigned int offset        = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_fetch_one(bool isappend = false)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+
+            sqlstring.append(" limit 1");
+
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                effect_num = 0;
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+                // std::vector<std::vector<std::string>> field_value;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+                // std::map<unsigned char, std::string> other_col;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                if (isappend)
+                                {
+                                    typename B_BASE::meta data_temp;
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    B_BASE::record.emplace_back(std::move(data_temp));
+                                    effect_num++;
+                                }
+                                else
+                                {
+                                    for (unsigned int ij = 0; ij < column_num; ij++)
+                                    {
+                                        unsigned long long name_length = 0;
+                                        name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                        assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                        tempnum = tempnum + name_length;
+                                    }
+                                    effect_num++;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+
+                conn_obj->back_select_conn(conn);
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        M_MODEL &use_cache(int cache_time = 0)
+        {
+            iscache = true;
+            exptime = cache_time;
+            return *mod;
+        }
+        bool isuse_cache(bool iscachedate = false)
+        {
+            if (iscachedate)
+            {
+                return exptime == 0 && iscache == false;
+            }
+            return iscache;
+        }
+        void set_cache_state(bool isrestatus = false) { iscache = isrestatus; }
+        void remove_exptime_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.remove_exptime();
+        }
+        void clear_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.clear();
+        }
+        bool remove_cache()
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.remove(sqlhashid);
+        }
+        bool remove_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.remove(cache_key_name);
+        }
+        int check_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.check(cache_key_name);
+        }
+        std::vector<typename B_BASE::meta> get_cache_data(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get(cache_key_name);
+            return cache_data;
+        }
+        typename B_BASE::meta get_cache_obj(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            auto cache_data                                     = temp_cache.get_obj(cache_key_name);
+            return cache_data;
+        }
+        M_MODEL &get_cache(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                B_BASE::record_reset();
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+            }
+            return *mod;
+        }
+        int update_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            return temp_cache.update(sqlhashid, exp_time);
+        }
+        int update_cache(std::size_t cache_key_name, int exp_time)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            return temp_cache.update(cache_key_name, exp_time);
+        }
+        bool save_cache(int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            std::size_t sqlhashid                               = std::hash<std::string>{}(sqlstring);
+            temp_cache.save(sqlhashid, B_BASE::record, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, typename B_BASE::meta &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+
+        bool save_cache(std::size_t cache_key_name, std::vector<typename B_BASE::meta> &cache_data, int exp_time = 0)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            temp_cache.save(cache_key_name, cache_data, exp_time);
+            return true;
+        }
+        bool get_cacherecord(std::size_t cache_key_name)
+        {
+            model_meta_cache<typename B_BASE::meta> &temp_cache = model_meta_cache<typename B_BASE::meta>::getinstance();
+            B_BASE::record                                      = temp_cache.get(cache_key_name);
+            if (B_BASE::record.size() == 0)
+            {
+                return false;
+            }
+            else
+            {
+                B_BASE::data = B_BASE::record[0];
+                return true;
+            }
+        }
+        http::OBJ_VALUE fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return valuetemp;
+        }
+
+        asio::awaitable<http::OBJ_VALUE> async_fetch_json()
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                sqlstring.append(" 1 ");
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            http::OBJ_VALUE valuetemp;
+            valuetemp.set_array();
+
+            if (iserror)
+            {
+                co_return valuetemp;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return valuetemp;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+ 
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                http::OBJ_VALUE json_temp_v;  
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    std::string temp_str;    
+                                    temp_str.resize(name_length);
+                                    std::memcpy(temp_str.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    if(field_array[ij].name.size()>0)
+                                    {
+                                        //or alias name
+                                        json_temp_v[field_array[ij].name]=std::move(temp_str);
+                                    }
+                                    else if(field_array[ij].org_name.size()>0)
+                                    {
+                                        json_temp_v[field_array[ij].org_name]=std::move(temp_str);
+                                    }
+                                    tempnum = tempnum + name_length;
+                                }
+                                valuetemp.push(json_temp_v);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return valuetemp;
+        }
+
+        long long get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_get_one(long long id)
+        {
+            effect_num = 0;
+            if (selectsql.empty())
+            {
+                sqlstring = "SELECT *  FROM ";
+            }
+            else
+            {
+                sqlstring = "SELECT ";
+                sqlstring.append(selectsql);
+                sqlstring.append(" FROM ");
+            }
+
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+            sqlstring.append(" limit 1");
+            if (iscache)
+            {
+                std::size_t sqlhashid = std::hash<std::string>{}(sqlstring);
+                if (get_cacherecord(sqlhashid))
+                {
+                    iscache = false;
+                    co_return 0;
+                }
+            }
+
+            B_BASE::data_reset();
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+
+                                    assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data);
+                                    tempnum = tempnum + name_length;
+                                }
+                                 
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);               
+
+                if (iscache)
+                {
+                    if (exptime > 0)
+                    {
+                        save_cache(exptime);
+                        exptime = 0;
+                        iscache = false;
+                    }
+                }
+                co_return effect_num;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        int update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<int> async_update(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql(fieldname);
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+        asio::awaitable<int> async_update()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    error_msg = "warning empty where sql!";
+                    co_return 0;
+                }
+            }
+
+            sqlstring = B_BASE::_makeupdatesql("");
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+            try
+            {
+
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                    iserror = true;
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+
+            }
+            co_return 0;
+        }
+
+        int update_batch(const std::string &fieldname)
+        {
+            effect_num = 0;
+            if (B_BASE::record.size() == 0)
+            {
+                return 0;
+            }
+            if (fieldname.size() > 0)
+            {
+                sqlstring = B_BASE::_make_insert_into_sql(fieldname);
+            }
+            else
+            {
+                sqlstring = B_BASE::_make_replace_into_sql();
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    co_return 0;
+                }
+            }
+
+            sqlstring = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            if (wheresql.empty())
+            {
+                co_return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+
+        asio::awaitable<unsigned int> async_remove(long long id)
+        {
+            effect_num = 0;
+            sqlstring  = "DELETE FROM  ";
+            sqlstring.append(B_BASE::tablename);
+            sqlstring.append(" WHERE ");
+
+            sqlstring.append(B_BASE::getPKname());
+            sqlstring.append("=");
+            sqlstring.append(std::to_string(id));
+
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    co_return effect_num;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                co_return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            co_return 0;
+        }
+
+        int soft_remove(const std::string &fieldsql)
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+
+            sqlstring = B_BASE::soft_remove_sql(fieldsql);
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        int soft_remove()
+        {
+            effect_num = 0;
+            if (wheresql.empty())
+            {
+                if (B_BASE::getPK() > 0)
+                {
+                    std::ostringstream tempsql;
+                    effect_num = 1;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            if (effect_num == 1)
+            {
+                sqlstring = B_BASE::soft_remove_sql(" ");
+            }
+            else
+            {
+                sqlstring = B_BASE::soft_remove_sql("");
+            }
+            effect_num = 0;
+            if (sqlstring.empty())
+            {
+                error_msg = "soft delete field empty.";
+                return 0;
+            }
+            sqlstring.append(" where ");
+            if (wheresql.empty())
+            {
+                return 0;
+            }
+            else
+            {
+                sqlstring.append(wheresql);
+            }
+            if (!groupsql.empty())
+            {
+                sqlstring.append(groupsql);
+            }
+            if (!ordersql.empty())
+            {
+                sqlstring.append(ordersql);
+            }
+            if (!limitsql.empty())
+            {
+                sqlstring.append(limitsql);
+            }
+
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+                return 0;
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+                
+            }
+            return 0;
+        }
+        long long insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(typename B_BASE::meta &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert(std::vector<typename B_BASE::meta> &insert_data)
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makerecordinsertsql(insert_data);
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+        long long insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                return 0;
+            }
+
+            if (iserror)
+            {
+                return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_insert()
+        {
+            effect_num = 0;
+            sqlstring  = B_BASE::_makeinsertsql();
+            if (iscommit)
+            {
+                iscommit = false;
+                co_return 0;
+            }
+
+            if (iserror)
+            {
+                co_return 0;
+            }
+ 
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return 0;
+                }
+                auto conn = co_await conn_obj->async_get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                unsigned int offset = 0;
+                n                   = co_await conn->async_read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    co_return insert_last_id;
+                }
+                co_return 0;
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return 0;
+        }
+
+
+        long long save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    return 0;
+                }
+
+                if (iserror)
+                {
+                    return 0;
+                }
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    return effect_num;
+                }
+                return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                if (conn_empty())
+                {
+                    return 0;
+                }
+                auto conn = conn_obj->get_edit_conn();
+
+                unsigned int querysql_len = sqlstring.length() + 1;
+
+                conn->send_data.clear();
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(sqlstring);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return 0;
+                }
+
+                unsigned int offset = 0;
+                n                   = conn->read_loop();
+
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                conn_obj->back_edit_conn(conn);
+
+                if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                {
+                    error_msg = temp_pack_data.data.substr(3);
+                }
+                else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                {
+
+                    unsigned int d_offset = 1;
+                    effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                    long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                    return insert_last_id;
+                }
+                return 0;
+            }
+            return 0;
+        }
+
+        asio::awaitable<long long> async_save(bool isrealnew = false)
+        {
+            effect_num = 0;
+            if (B_BASE::getPK() > 0 && isrealnew == false)
+            {
+                if (wheresql.empty())
+                {
+                    std::ostringstream tempsql;
+                    tempsql << " ";
+                    tempsql << B_BASE::getPKname();
+                    tempsql << " = '";
+                    tempsql << B_BASE::getPK();
+                    tempsql << "' ";
+                    wheresql = tempsql.str();
+                }
+                sqlstring = B_BASE::_makeupdatesql("");
+                sqlstring.append(" where ");
+                if (wheresql.empty())
+                {
+                    co_return 0;
+                }
+                else
+                {
+                    sqlstring.append(wheresql);
+                }
+                if (!groupsql.empty())
+                {
+                    sqlstring.append(groupsql);
+                }
+                if (!ordersql.empty())
+                {
+                    sqlstring.append(ordersql);
+                }
+                if (!limitsql.empty())
+                {
+                    sqlstring.append(limitsql);
+                }
+                if (iscommit)
+                {
+                    iscommit = false;
+                    co_return 0;
+                }
+
+                if (iserror)
+                {
+                    co_return 0;
+                }
+
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                        iserror = true;
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num            = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+
+                        co_return effect_num;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                    co_return 0;
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                    co_return 0;
+                }
+                co_return 0;
+            }
+            else
+            {
+                sqlstring  = B_BASE::_makeinsertsql();
+                try
+                {
+                    if (conn_empty())
+                    {
+                        co_return 0;
+                    }
+                    auto conn = co_await conn_obj->async_get_edit_conn();
+
+                    unsigned int querysql_len = sqlstring.length() + 1;
+
+                    conn->send_data.clear();
+                    conn->send_data.push_back((querysql_len & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                    conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                    conn->send_data.push_back(0x00);
+                    conn->send_data.push_back(0x03);
+                    conn->send_data.append(sqlstring);
+
+                    std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                    
+                    unsigned int offset = 0;
+                    n                   = co_await conn->async_read_loop();
+
+                    pack_info_t temp_pack_data;
+                    temp_pack_data.seq_id = 1;
+                    conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+
+                    conn_obj->back_edit_conn(conn);
+
+                    if ((unsigned char)temp_pack_data.data[0] == 0xFF)
+                    {
+                        error_msg = temp_pack_data.data.substr(3);
+                    }
+                    else if ((unsigned char)temp_pack_data.data[0] == 0x00)
+                    {
+
+                        unsigned int d_offset = 1;
+                        effect_num      = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);
+                        long long   insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset);    
+
+                        co_return insert_last_id;
+                    }
+                    co_return 0;
+                }
+                catch (const std::exception &e)
+                {
+                    error_msg = std::string(e.what());
+                }
+                catch (const std::string &e)
+                {
+                    error_msg = e;
+                }
+                catch (...)
+                {
+                }
+                co_return 0;
+            }
+            co_return 0;
+        }
+
+        std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>
+        query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = conn_obj->get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec);
+                
+                if(conn->ec)
+                {
+                    error_msg = conn->ec.message();
+                    iserror   = true;
+                    return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = conn->read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        asio::awaitable<std::tuple<std::vector<std::string>, std::map<std::string, unsigned int>, std::vector<std::vector<std::string>>>>
+        async_query(const std::string &rawsql)
+        {
+
+            std::vector<std::vector<std::string>> temprecord;
+            std::vector<std::string> table_fieldname;
+            std::map<std::string, unsigned int> table_fieldmap;
+
+            if(rawsql.size()>10)
+            {
+                unsigned int i=0;
+                for(;i<rawsql.size();i++)
+                {
+                    if(rawsql[i]!=0x20)
+                    {
+                        break;
+                    }
+                }
+                if(i<5)
+                {
+                    //must be select
+                    if(rawsql[i]!='s' && rawsql[i]!='S')
+                    {
+                        iserror = true;   
+                    }
+                }
+                else
+                {
+                    iserror = true;   
+                }
+            }
+            else
+            {
+                iserror = true;   
+            }
+
+            if (iserror)
+            {
+                co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+            }
+
+            try
+            {
+                if (conn_empty())
+                {
+                    co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+                }
+                auto conn = co_await conn_obj->async_get_select_conn();
+
+                unsigned int querysql_len = rawsql.length() + 1;
+
+                conn->send_data.clear();
+
+                conn->send_data.push_back((querysql_len & 0xFF));
+                conn->send_data.push_back((querysql_len >> 8 & 0xFF));
+                conn->send_data.push_back((querysql_len >> 16 & 0xFF));
+                conn->send_data.push_back(0x00);
+                conn->send_data.push_back(0x03);
+                conn->send_data.append(rawsql);
+
+                std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable);
+                
+                
+                pack_info_t temp_pack_data;
+                temp_pack_data.seq_id = 1;
+                bool is_sql_item      = false;
+                std::vector<field_info_t> field_array;
+
+                unsigned char action_setup = 0;
+                unsigned int column_num    = 0;
+
+                unsigned int offset = 0;
+
+                std::vector<unsigned char> field_pos;
+
+                for (; is_sql_item == false;)
+                {
+                    n      = co_await conn->async_read_loop();
+                    offset = 0;
+                    for (; offset < n;)
+                    {
+                        conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data);
+                        if (temp_pack_data.length == temp_pack_data.current_length)
+                        {
+                            if (conn->pack_eof_check(temp_pack_data))
+                            {
+                                is_sql_item = true;
+                                break;
+                            }
+
+                            if (action_setup == 0)
+                            {
+                                if (temp_pack_data.length == 2 && (unsigned char)temp_pack_data.data[0] < 251 && (unsigned char)temp_pack_data.data[0] > 0)
+                                {
+                                    action_setup = 1;
+                                    column_num   = (unsigned char)temp_pack_data.data[0];
+                                }
+                            }
+                            else if (action_setup == 1)
+                            {
+                                field_info_t temp_filed_col;
+                                conn->read_col_info(temp_pack_data.data, temp_filed_col);
+
+                                field_array.emplace_back(std::move(temp_filed_col));
+                                column_num--;
+                                if (column_num == 0)
+                                {
+                                    action_setup = 2;
+                                    for (unsigned int ii = 0; ii < field_array.size(); ii++)
+                                    {
+                                        field_pos.push_back(B_BASE::findcolpos(field_array[ii].org_name));
+                                        table_fieldmap.insert({field_array[ii].org_name,table_fieldname.size()});
+                                        table_fieldname.push_back(field_array[ii].org_name);
+                                    }
+                                }
+                            }
+                            else if (action_setup == 2)
+                            {
+                                unsigned int column_num = field_array.size();
+                                unsigned int tempnum    = 0;
+
+                                std::vector<std::string> temp_v_record; 
+                                for (unsigned int ij = 0; ij < column_num; ij++)
+                                {
+                                    unsigned long long name_length = 0;
+                                    name_length                    = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum);
+                                    std::string tempstr;
+                                    tempstr.resize(name_length);
+                                    std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length);
+                                    temp_v_record.push_back(std::move(tempstr));
+                                    tempnum = tempnum + name_length;
+                                }
+                                temprecord.push_back(temp_v_record);
+                                effect_num++;
+                            }
+                        }
+                        else
+                        {
+                            if (offset >= n)
+                            {
+                                break;
+                            }
+                            is_sql_item = true;
+                            break;
+                        }
+                    }
+                }
+                conn_obj->back_select_conn(conn);
+
+                co_return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord));
+            }
+            catch (const std::exception &e)
+            {
+                error_msg = std::string(e.what());
+            }
+            catch (const std::string &e)
+            {
+                error_msg = e;
+            }
+            catch (...)
+            {
+            }
+            co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord);
+        }
+
+        // long long edit_query(const std::string &rawsql, bool isinsert = false)
+        // {
+        //     if (iserror)
+        //     {
+        //         return 0;
+        //     }
+
+        //     return 0;
+        // }
+        M_MODEL &clear(bool both = true)
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            if (both)
+            {
+                B_BASE::record_reset();
+                B_BASE::data_reset();
+            }
+            return *mod;
+        }
+        M_MODEL &clearWhere()
+        {
+            selectsql.clear();
+            wheresql.clear();
+            ordersql.clear();
+            groupsql.clear();
+            limitsql.clear();
+            sqlstring.clear();
+            error_msg.clear();
+            iskuohao     = false;
+            ishascontent = false;
+            iscommit     = false;
+            iscache      = false;
+            effect_num   = 0;
+            return *mod;
+        }
+        M_MODEL &set_data(typename B_BASE::meta indata)
+        {
+            B_BASE::data = indata;
+            return *mod;
+        }
+        M_MODEL &get() { return *mod; }
+        std::string get_query() { return sqlstring; }
+        M_MODEL &start_commit()
+        {
+            iscommit = true;
+            return *mod;
+        }
+        M_MODEL &end_commit()
+        {
+            iscommit = false;
+            return *mod;
+        }
+
+        unsigned int effect()
+        {
+            return effect_num;
+        }
+        bool conn_empty()
+        {
+            if (conn_obj)
+            {
+                return false; 
+            }
+            error_msg = "conn_obj is null";
+            iserror   = true;
+            return true;
+        }
+
+      public:
+        std::string selectsql;
+        std::string wheresql;
+        std::string ordersql;
+        std::string groupsql;
+        std::string limitsql;
+        std::string sqlstring;
+        std::string dbtag;
+        std::string error_msg;
+        std::string original_tablename;
+
+        // std::list<std::string> commit_sqllist;
+        bool iskuohao           = false;
+        bool iscommit           = false;
+        bool ishascontent       = false;
+        bool iscache            = false;
+        bool iserror            = false;
+        int exptime             = 0;
+        unsigned int effect_num = 0;
+
+        M_MODEL *mod;
+
+        std::shared_ptr<orm_conn_pool> conn_obj;
+    };
+//} /*tagnamespace_replace*/
+}// namespace orm
+#endif

+ 2216 - 2384
frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h

@@ -1,400 +1,313 @@
 #ifndef ORM_DEFAULT_FORTUNEBASEMATA_H
 #define ORM_DEFAULT_FORTUNEBASEMATA_H
 /*
- *This file is auto create from cli
- *本文件为自动生成 Fri, 26 Jan 2024 02:59:30 GMT
- ***/
+*This file is auto create from cli
+*本文件为自动生成 Sun, 02 Mar 2025 08:24:41 GMT
+***/
 #include <iostream>
 #include <cstdio>
 #include <sstream>
 #include <array>
-#include <map>
-#include <string_view>
-#include <string>
+#include <map> 
+#include <string_view> 
+#include <string> 
 #include <vector>
 #include <ctime>
 #include <array>
+#include "unicode.h"
 
-namespace orm
-{
-
+namespace orm { 
+   
+    
 struct fortunebase
 {
-    struct meta
-    {
-        unsigned int id     = 0; //
-        std::string message = "";//
-    } data;
-    std::vector<fortunebase::meta> record;
-    std::string _rmstag = "default";//this value must be default or tag value, tag in mysqlconnect config file .
-    std::vector<unsigned char> _keypos{0x00};
-
-    std::vector<fortunebase::meta>::iterator begin() { return record.begin(); }
-    std::vector<fortunebase::meta>::iterator end() { return record.end(); }
-    std::vector<fortunebase::meta>::const_iterator begin() const { return record.begin(); }
-    std::vector<fortunebase::meta>::const_iterator end() const { return record.end(); }
-    const std::array<std::string, 2> colnames       = {"id", "message"};
-    const std::array<unsigned char, 2> colnamestype = {3, 253};
-    std::string tablename                           = "fortune";
-    std::string modelname                           = "Fortune";
-
-    unsigned char findcolpos(const std::string &coln)
-    {
-        if (coln.size() == 0)
-        {
-            return 255;
-        }
-        unsigned char bi = coln[0];
-
-        if (bi < 91 && bi > 64)
-        {
-            bi += 32;
-        }
-        switch (coln[0])
-        {
-
-        case 'i':
-            return 0;
-            break;
-        case 'm':
-            return 1;
-            break;
-        }
-        return 255;
-    }
-
-    int size() { return record.size(); }
-
-    void assign_field_value(unsigned char index_pos, unsigned char *result_temp_data, unsigned int value_size, meta &data_temp)
-    {
-        /*
-        unsigned int id     = 0; //
-        std::string message = "";//
-        */
-        //bool is_minus = false;
-        switch (index_pos)
-        {
-        case 0:
-            data_temp.id = 0;
-            for (size_t i = 0; i < value_size; i++)
-            {
-                if (result_temp_data[i] >= '0' && result_temp_data[i] <= '9')
-                {
-                    data_temp.id = data_temp.id * 10 + (result_temp_data[i] - '0');
-                }
-            }
-            break;
-        case 1:
-
-            data_temp.message.clear();
-            data_temp.message.resize(value_size);
-            for (size_t i = 0; i < value_size; i++)
-            {
-                data_temp.message[i] = result_temp_data[i];
-            }
-            break;
-        default:
-            break;
-        }
-    }
-
-    std::string getPKname()
-    {
-        return "id";
-    }
-
-    void record_reset()
-    {
-        record.clear();
-    }
-    void data_reset()
-    {
-        fortunebase::meta metatemp;
-        data = metatemp;
-    }
-
-    std::string soft_remove_sql([[maybe_unused]] const std::string &fieldsql)
-    {
-        std::string temp;
-
-        return temp;
-    }
-
-    inline std::string stringaddslash(std::string &content)
-    {
+    struct meta{
+     unsigned  int  id = 0; ///**/
+ std::string  message = ""; ///**/
+ } data;
+ std::vector<fortunebase::meta> record;
+std::string _rmstag="default";//this value must be default or tag value, tag in mysqlconnect config file .
+unsigned int _offset=0;
+std::vector<fortunebase::meta>::iterator begin(){     return record.begin(); }
+std::vector<fortunebase::meta>::iterator end(){     return record.end(); }
+std::vector<fortunebase::meta>::const_iterator begin() const{     return record.begin(); }
+std::vector<fortunebase::meta>::const_iterator end() const{     return record.end(); }
+static constexpr std::array<std::string_view,2> col_names={"id","message"};
+static constexpr std::array<unsigned char,2> col_types={3,253};
+static constexpr std::array<unsigned char,2> col_length={0,0};
+static constexpr std::array<unsigned char,2> col_decimals={0,0};
+std::string tablename="fortune";
+static constexpr std::string_view modelname="Fortune";
+
+	  unsigned char findcolpos(const std::string &coln){
+            if(coln.size()==0)
+            {
+                return 255;
+            }
+		    unsigned char  bi=coln[0];
+         
+
+	         if(bi<91&&bi>64){
+				bi+=32;
+			}
+            switch(coln[0]){
+
+
+         case 'i':
+   	 return 0;
+break;
+case 'm':
+   	 return 1;
+break;
+
+             }
+             return 255;
+           }
+         
+    int size(){ return record.size(); }   
+
+    std::string getPKname(){ 
+       return "id";
+}
+
+      void record_reset()
+      {
+            record.clear();     
+      }
+      void data_reset(){
+     fortunebase::meta metatemp;    
+            data = metatemp; 
+      }
+      
+      std::string soft_remove_sql([[maybe_unused]] const std::string &fieldsql){
+          std::string temp;
+     
+         return temp;
+     }
+     
+
+  inline  std::string stringaddslash(const std::string &content){
         std::string temp;
-        for (unsigned int i = 0; i < content.size(); i++)
-        {
-            if (content[i] == '\'')
-            {
+        for(unsigned int i=0;i<content.size();i++){
+            if(content[i]=='\''){
                 temp.append("\\'");
                 continue;
-            }
-            else if (content[i] == '"')
-            {
+            }else if(content[i]=='"'){
                 temp.append("\\\"");
                 continue;
-            }
-            else if (content[i] == '\\')
-            {
+            }else if(content[i]=='\\'){
                 temp.append("\\\\");
                 continue;
             }
             temp.push_back(content[i]);
         }
         return temp;
-    }
-    inline std::string jsonaddslash(std::string &content)
-    {
+   }  
+  inline  std::string jsonaddslash(const std::string &content){
         std::string temp;
-        for (unsigned int i = 0; i < content.size(); i++)
-        {
-            if (content[i] == '"')
-            {
+        for(unsigned int i=0;i<content.size();i++){
+            if(content[i]=='"'){
                 temp.append("\\\"");
                 continue;
             }
-            else if (content[i] == '\\')
-            {
+            else if(content[i]=='\\'){
                 temp.append("\\\\");
                 continue;
             }
             temp.push_back(content[i]);
         }
         return temp;
-    }
+   }  
 
-    std::string _makeinsertsql()
-    {
-        unsigned int j = 0;
+   std::string _makeinsertsql(){
+        unsigned int j=0;
         std::ostringstream tempsql;
-        tempsql << "INSERT INTO ";
-        tempsql << tablename;
-        tempsql << " (";
-        for (; j < colnames.size(); j++)
-        {
-            if (j > 0)
-            {
-                tempsql << "`,`";
-            }
-            else
-            {
-                tempsql << "`";
-            }
-            tempsql << colnames[j];
-        }
-        if (j > 0)
-        {
-            tempsql << "`";
-        }
-        tempsql << ") VALUES (";
-
-        if (data.id == 0)
-        {
-            tempsql << "null";
-        }
-        else
-        {
-            tempsql << std::to_string(data.id);
-        }
-        tempsql << ",'" << stringaddslash(data.message) << "'";
-        tempsql << ")";
-
-        return tempsql.str();
-    }
-
-    std::string _makerecordinsertsql(meta &insert_data)
-    {
-        unsigned int j = 0;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
+
+        if(data.id==0){
+tempsql<<"null";
+ }else{ 
+	tempsql<<std::to_string(data.id);
+}
+tempsql<<",'"<<stringaddslash(data.message)<<"'";
+tempsql<<")";
+
+     
+       return tempsql.str();
+   } 
+      
+      std::string _makerecordinsertsql(const meta &insert_data){
+        unsigned int j=0;
         std::ostringstream tempsql;
-        tempsql << "INSERT INTO ";
-        tempsql << tablename;
-        tempsql << " (";
-        for (; j < colnames.size(); j++)
-        {
-            if (j > 0)
-            {
-                tempsql << "`,`";
-            }
-            else
-            {
-                tempsql << "`";
-            }
-            tempsql << colnames[j];
-        }
-        if (j > 0)
-        {
-            tempsql << "`";
-        }
-        tempsql << ") VALUES (";
-
-        if (insert_data.id == 0)
-        {
-            tempsql << "null";
-        }
-        else
-        {
-            tempsql << std::to_string(insert_data.id);
-        }
-        tempsql << ",'" << stringaddslash(insert_data.message) << "'";
-        tempsql << ")";
-
-        return tempsql.str();
-    }
-
-    std::string _makerecordinsertsql(std::vector<meta> &insert_data)
-    {
-        unsigned int j = 0;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
+
+        if(insert_data.id==0){
+tempsql<<"null";
+ }else{ 
+	tempsql<<std::to_string(insert_data.id);
+}
+tempsql<<",'"<<stringaddslash(insert_data.message)<<"'";
+tempsql<<")";
+
+     
+       return tempsql.str();
+   } 
+       
+    std::string _makerecordinsertsql(const std::vector<meta> &insert_data){
+        unsigned int j=0;
         std::ostringstream tempsql;
-        tempsql << "INSERT INTO ";
-        tempsql << tablename;
-        tempsql << " (";
-        for (; j < colnames.size(); j++)
-        {
-            if (j > 0)
-            {
-                tempsql << "`,`";
-            }
-            else
-            {
-                tempsql << "`";
-            }
-            tempsql << colnames[j];
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
         }
-        if (j > 0)
-        {
-            tempsql << "`";
+        if(j>0){
+            tempsql<<"`";
         }
-        tempsql << ") VALUES ";
+        tempsql<<") VALUES ";
 
-        for (unsigned int i = 0; i < insert_data.size(); i++)
+        for(unsigned int i=0;i<insert_data.size();i++)
         {
-            if (i > 0)
+            if(i>0)
             {
-                tempsql << ",";
+                tempsql<<",";	
             }
-            tempsql << "(";
+            tempsql<<"(";
 
-            if (insert_data[i].id == 0)
-            {
-                tempsql << "null";
-            }
-            else
-            {
-                tempsql << std::to_string(insert_data[i].id);
-            }
-            tempsql << ",'" << stringaddslash(insert_data[i].message) << "'";
-            tempsql << ")";
-        }
 
-        return tempsql.str();
-    }
+            	if(insert_data[i].id==0){
+	tempsql<<"null";
+	 }else{ 
+	tempsql<<std::to_string(insert_data[i].id);
+	}
+		tempsql<<",'"<<stringaddslash(insert_data[i].message)<<"'";
+		tempsql<<")";
+	 } 
 
-    std::string _makeupdatesql(const std::string &fileld)
-    {
-        //int j=0;
+     
+       return tempsql.str();
+   } 
+       
+    std::string _makeupdatesql(const std::string &fileld){
         std::ostringstream tempsql;
-        tempsql << "UPDATE ";
-        tempsql << tablename;
-        tempsql << " SET ";
-
-        bool isall = false;
-        if (fileld.empty())
-        {
-            isall = true;
-        }
-        if (isall)
-        {
-
-            if (data.id == 0)
-            {
-                tempsql << "`id`=0";
-            }
-            else
-            {
-                tempsql << "`id`=" << std::to_string(data.id);
-            }
-            tempsql << ",`message`='" << stringaddslash(data.message) << "'";
-        }
-        else
-        {
-
-            unsigned int jj = 0;
-            std::string keyname;
-            std::vector<unsigned char> keypos;
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    unsigned char bpos_i = findcolpos(keyname);
-                    keypos.emplace_back(bpos_i);
+        tempsql<<"UPDATE ";
+        tempsql<<tablename;
+        tempsql<<" SET ";
+
+        bool isall=false;
+        if(fileld.empty()){
+            isall=true;
+        }
+        if(isall){
+
+        if(data.id==0){
+	tempsql<<"`id`=0";
+ }else{ 
+	tempsql<<"`id`="<<std::to_string(data.id);
+}
+tempsql<<",`message`='"<<stringaddslash(data.message)<<"'";
+ }else{ 
+
+     
+  unsigned int jj=0;
+                  std::string keyname;
+                  std::vector<unsigned char> keypos;
+                  for(;jj<fileld.size();jj++){
+                        if(fileld[jj]==','){
+                                unsigned char bpos_i=findcolpos(keyname);
+                               keypos.emplace_back(bpos_i); 
 #ifdef DEBUG
-                    if (bpos_i == 254)
+                    if (bpos_i == 255)
                     {
                         std::cout << "\033[1m\033[31m-----------\n"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
                                   << std::endl;
                     }
-#endif
-                    keyname.clear();
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
+#endif                               
+                               keyname.clear();
+                             continue;   
+                        }
+                        if(fileld[jj]==0x20){
 
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                unsigned char bpos_i = findcolpos(keyname);
-#ifdef DEBUG
-                if (bpos_i == 254)
-                {
-                    std::cout << "\033[1m\033[31m-----------\n"
-                              << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
-                              << std::endl;
-                }
-#endif
-                keypos.emplace_back(bpos_i);
-                keyname.clear();
-            }
-            for (jj = 0; jj < keypos.size(); jj++)
-            {
-                switch (keypos[jj])
-                {
+                             continue;   
+                        }
+                        keyname.push_back(fileld[jj]);
 
-                case 0:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (data.id == 0)
-                    {
-                        tempsql << "`id`=0";
-                    }
-                    else
-                    {
-                        tempsql << "`id`=" << std::to_string(data.id);
-                    }
-                    break;
-                case 1:
-                    if (jj > 0)
+                  }  
+                 if(keyname.size()>0){
+                                unsigned char bpos_i=findcolpos(keyname);
+ #ifdef DEBUG
+                    if (bpos_i == 255)
                     {
-                        tempsql << ",";
+                        std::cout << "\033[1m\033[31m-----------\n"
+                                  << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
+                                  << std::endl;
                     }
-                    tempsql << "`message`='" << stringaddslash(data.message) << "'";
-                    break;
-
-                default:;
-                }
-            }
-        }
+#endif                                       
+                                keypos.emplace_back(bpos_i); 
+                                keyname.clear();
+                 }
+                 for(jj=0;jj<keypos.size();jj++){
+                       switch(keypos[jj]){
+
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(data.id==0){
+	tempsql<<"`id`=0";
+ }else{ 
+	tempsql<<"`id`="<<std::to_string(data.id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+tempsql<<"`message`='"<<stringaddslash(data.message)<<"'";
+ break;
+
+     
+                  default:
+                                ;
+                     }
+                 }   
+
+            }        
 
         return tempsql.str();
-    }
-
+   } 
+   
     std::string _make_replace_into_sql()
     {
         unsigned int j = 0;
@@ -402,7 +315,7 @@ struct fortunebase
         tempsql << "REPLACE INTO ";
         tempsql << tablename;
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
             if (j > 0)
             {
@@ -412,7 +325,7 @@ struct fortunebase
             {
                 tempsql << "`";
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         if (j > 0)
         {
@@ -427,19 +340,17 @@ struct fortunebase
                 tempsql << ",\n";
             }
             tempsql << "(";
-            if (record[i].id == 0)
-            {
-                tempsql << "null";
-            }
-            else
-            {
-                tempsql << std::to_string(record[i].id);
-            }
-            tempsql << ",'" << stringaddslash(record[i].message) << "'";
-            tempsql << ")";
-        }
-        return tempsql.str();
-    }
+            	if(record[i].id==0){
+	tempsql<<"null";
+	 }else{ 
+	tempsql<<std::to_string(record[i].id);
+	}
+	tempsql<<",'"<<stringaddslash(record[i].message)<<"'";
+	tempsql<<")";
+
+ }
+ return tempsql.str();
+}
 
     std::string _make_insert_into_sql(const std::string &fileld)
     {
@@ -448,7 +359,7 @@ struct fortunebase
         tempsql << "INSERT INTO ";
         tempsql << tablename;
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
             if (j > 0)
             {
@@ -458,7 +369,7 @@ struct fortunebase
             {
                 tempsql << "`";
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         if (j > 0)
         {
@@ -473,2322 +384,2243 @@ struct fortunebase
                 tempsql << ",\n";
             }
             tempsql << "(";
-            if (record[i].id == 0)
-            {
-                tempsql << "null";
-            }
-            else
-            {
-                tempsql << std::to_string(record[i].id);
-            }
-            tempsql << ",'" << stringaddslash(record[i].message) << "'";
-            tempsql << ")";
-        }
-        tempsql << " as new ON DUPLICATE KEY UPDATE ";
-
+            	if(record[i].id==0){
+	tempsql<<"null";
+	 }else{ 
+	tempsql<<std::to_string(record[i].id);
+	}
+	tempsql<<",'"<<stringaddslash(record[i].message)<<"'";
+	tempsql<<")";
+	 }
+	 tempsql<<" as new ON DUPLICATE KEY UPDATE ";
+
+     
         std::string keyname;
-        unsigned char jj = 0;
-        j                = 0;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
+        unsigned char jj=0;
+        j=0;
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                if(findcolpos(keyname)<255)
                 {
-                    if (findcolpos(keyname) < 255)
+                    if(j>0)
                     {
-                        if (j > 0)
-                        {
-                            tempsql << ",";
-                        }
-                        tempsql << keyname;
-                        tempsql << "=new.";
-                        tempsql << keyname;
+                        tempsql<<",";
                     }
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
-
-                    continue;
+                    tempsql<<keyname;
+                    tempsql<<"=new.";
+                    tempsql<<keyname;
                 }
-                keyname.push_back(fileld[jj]);
+                continue;   
+            }
+            if(fileld[jj]==0x20){
+                continue;   
             }
-            if (keyname.size() > 0)
+            keyname.push_back(fileld[jj]);
+
+        }  
+        if(keyname.size()>0){
+            if(findcolpos(keyname)<255)
             {
-                if (findcolpos(keyname) < 255)
+                if(j>0)
                 {
-                    if (j > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    tempsql << keyname;
-                    tempsql << "=new.";
-                    tempsql << keyname;
+                    tempsql<<",";
                 }
+                tempsql<<keyname;
+                tempsql<<"=new.";
+                tempsql<<keyname;
+                
             }
         }
 
-        return tempsql.str();
-    }
+    } 
+ 
+ return tempsql.str();
+}
 
-    std::vector<std::string> data_toarray(std::string fileld = "")
-    {
+   std::vector<std::string> data_toarray(std::string fileld=""){
         std::vector<std::string> temparray;
         std::string keyname;
-        unsigned char jj = 0;
+        unsigned char jj=0;
         std::vector<unsigned char> keypos;
-        if (fileld.size() > 1)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
+        if(fileld.size()>1){
+            for(;jj<fileld.size();jj++){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
                     keyname.clear();
-                    continue;
+                    continue;   
                 }
-                if (fileld[jj] == 0x20)
-                {
+                if(fileld[jj]==0x20){
 
-                    continue;
+                    continue;   
                 }
                 keyname.push_back(fileld[jj]);
+
+            }  
+            if(keyname.size()>0){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
             }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+               
+            for(jj=0;jj<keypos.size();jj++){
+                switch(keypos[jj]){
+         case 0:
+if(data.id==0){
+	temparray.push_back("0");
+ }else{ 
+	temparray.push_back(std::to_string(data.id));
+}
+ break;
+ case 1:
+	temparray.push_back(data.message);
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+   
+     return temparray;             
+   }   
+   
+   std::map<std::string,std::string> data_tomap(std::string fileld=""){
+       std::map<std::string,std::string> tempsql;
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>1){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
                 keyname.clear();
+                continue;   
             }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
+            if(fileld[jj]==0x20){
+
+                continue;   
             }
+            keyname.push_back(fileld[jj]);
+
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
         }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
+         case 0:
+if(data.id==0){
+	tempsql.insert({"id","0"});
+ }else{ 
+	tempsql.insert({"id",std::to_string(data.id)});
+}
+ break;
+ case 1:
+	tempsql.insert({"message",data.message});
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+    
+     return tempsql;             
+   }   
+   
+   std::string data_tojson(){
+       std::ostringstream tempsql;
+
+        tempsql<<"{";
+if(data.id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(data.id);
+}
+tempsql<<",\"message\":\""<<http::utf8_to_jsonstring(data.message);
+tempsql<<"\"";
+tempsql<<"}";
+
+     
+     return tempsql.str();             
+   }   
+   
+   std::string data_tojson(std::string fileld){
+        std::ostringstream tempsql;
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
+            }
+            if(fileld[jj]==0x20){
+
+                continue;   
+            }
+            keyname.push_back(fileld[jj]);
 
-        for (jj = 0; jj < keypos.size(); jj++)
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+        tempsql<<"{";
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(data.id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(data.id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(data.message)<<"\"";
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+      tempsql<<"}";  
+     return tempsql.str();             
+   }   
+   
+    void from_json(const std::string &json_content)
+   {
+        record.clear();
+        fortunebase::meta metatemp; 
+        data=metatemp;
+        unsigned int json_offset=0;
+        bool isarray=false;
+        //std::vector<std::string> list_content;
+        for(;json_offset<json_content.size();json_offset++)
         {
-            switch (keypos[jj])
-            {
-            case 0:
-                if (data.id == 0)
-                {
-                    temparray.push_back("0");
-                }
-                else
-                {
-                    temparray.push_back(std::to_string(data.id));
-                }
-                break;
-            case 1:
-                temparray.push_back(data.message);
-                break;
-
-            default:;
-            }
-        }
-
-        return temparray;
-    }
-
-    std::map<std::string, std::string> data_tomap(std::string fileld = "")
-    {
-        std::map<std::string, std::string> tempsql;
-        std::string keyname;
-        unsigned char jj = 0;
-        std::vector<unsigned char> keypos;
-        if (fileld.size() > 1)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
-                    keyname.clear();
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
-
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
-                keyname.clear();
-            }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-
-        for (jj = 0; jj < keypos.size(); jj++)
-        {
-            switch (keypos[jj])
-            {
-            case 0:
-                if (data.id == 0)
-                {
-                    tempsql.insert({"id", "0"});
-                }
-                else
-                {
-                    tempsql.insert({"id", std::to_string(data.id)});
-                }
-                break;
-            case 1:
-                tempsql.insert({"message", data.message});
-                break;
-
-            default:;
-            }
-        }
-
-        return tempsql;
-    }
-
-    std::string data_tojson()
-    {
-        std::ostringstream tempsql;
-
-        tempsql << "{";
-        if (data.id == 0)
-        {
-            tempsql << "\"id\":0";
-        }
-        else
-        {
-            tempsql << "\"id\":" << std::to_string(data.id);
-        }
-        tempsql << ",\"message\":\"" << http::utf8_to_jsonstring(data.message);
-        tempsql << "\"";
-        tempsql << "}";
-
-        return tempsql.str();
-    }
-
-    std::string data_tojson(std::string fileld)
-    {
-        std::ostringstream tempsql;
-        std::string keyname;
-        unsigned char jj = 0;
-        std::vector<unsigned char> keypos;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
-                    keyname.clear();
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
-
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
-                keyname.clear();
-            }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-        tempsql << "{";
-        for (jj = 0; jj < keypos.size(); jj++)
-        {
-            switch (keypos[jj])
-            {
-            case 0:
-                if (jj > 0)
-                {
-                    tempsql << ",";
-                }
-                if (data.id == 0)
-                {
-                    tempsql << "\"id\":0";
-                }
-                else
-                {
-                    tempsql << "\"id\":" << std::to_string(data.id);
-                }
-                break;
-            case 1:
-                if (jj > 0)
-                {
-                    tempsql << ",";
-                }
-                tempsql << "\"message\":\"" << http::utf8_to_jsonstring(data.message) << "\"";
-                break;
-
-            default:;
-            }
-        }
-        tempsql << "}";
-        return tempsql.str();
-    }
-
-    void from_json(const std::string &json_content)
-    {
-        record.clear();
-        fortunebase::meta metatemp;
-        data                     = metatemp;
-        unsigned int json_offset = 0;
-        bool isarray             = false;
-        //std::vector<std::string> list_content;
-        for (; json_offset < json_content.size(); json_offset++)
-        {
-            if (json_content[json_offset] == '{')
+            if(json_content[json_offset]=='{')
             {
                 break;
             }
-            if (json_content[json_offset] == '[')
+            if(json_content[json_offset]=='[')
             {
-                isarray = true;
+                isarray=true;
                 break;
             }
         }
-        if (isarray)
+        if(isarray)
         {
-            json_offset += 1;
-            std::string json_key_name, json_value_name;
-            for (; json_offset < json_content.size(); json_offset++)
+            json_offset+=1; 
+            std::string json_key_name,json_value_name; 
+            for(;json_offset<json_content.size();json_offset++)
             {
-                for (; json_offset < json_content.size(); json_offset++)
+                for(;json_offset<json_content.size();json_offset++)
                 {
-                    if (json_content[json_offset] == '{')
+                    if(json_content[json_offset]=='{')
                     {
-                        json_offset += 1;
+                        json_offset+=1;
                         break;
                     }
                 }
-                if (record.size() > 0)
+                if(record.size()>0)
                 {
-                    data = metatemp;
+                    data=metatemp;
                 }
-                if (json_offset >= json_content.size())
+                if(json_offset>=json_content.size())
                 {
                     break;
                 }
-                for (; json_offset < json_content.size(); json_offset++)
+                for(;json_offset<json_content.size();json_offset++)
                 {
-
-                    if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                    {
-                        continue;
-                    }
-                    else
-                    {
-                        if (json_content[json_offset] == 0x22)
-                        {
-                            unsigned int temp_offset = json_offset;
-                            json_key_name            = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                            json_offset              = temp_offset;
-                            if (json_content[json_offset] == 0x22)
-                            {
-                                json_offset += 1;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
-                            {
-
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                                {
-                                    continue;
-                                }
-                                break;
-                            }
-                            if (json_content[json_offset] != ':')
-                            {
-                                break;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
-                            {
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                                {
-                                    continue;
-                                }
-                                break;
-                            }
-                            json_offset += 1;
-                            if (json_offset >= json_content.size())
-                            {
-                                break;
-                            }
-                            json_value_name.clear();
-                            if (json_content[json_offset] == 0x22)
+    
+                            if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
                             {
-
-                                temp_offset     = json_offset;
-                                json_value_name = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                                json_offset     = temp_offset;
-                                if (json_content[json_offset] == 0x22)
-                                {
-                                    json_offset += 1;
-                                }
+                                continue;
                             }
                             else
                             {
-                                if (json_content[json_offset] != '{' && json_content[json_offset] != ']')
+                                if(json_content[json_offset]==0x22)
                                 {
-                                    for (; json_offset < json_content.size(); json_offset++)
+                                    unsigned int temp_offset=json_offset;
+                                    json_key_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                    json_offset=temp_offset;
+                                    if(json_content[json_offset]==0x22)
+                                    {
+                                        json_offset+=1;
+                                    }
+                                    for(;json_offset<json_content.size();json_offset++)
+                                    {
+                                    
+                                        if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                        {
+                                            continue;
+                                        }
+                                        break;
+                                    }       
+                                    if(json_content[json_offset]!=':')
+                                    {
+                                        break;
+                                    }
+                                    for(;json_offset<json_content.size();json_offset++)
                                     {
-                                        if (json_content[json_offset] == 0x5D || json_content[json_offset] == 0x7D || json_content[json_offset] == 0x22 || json_content[json_offset] == 0x2C || json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                        if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
                                         {
-                                            if (json_content[json_offset] == 0x7D)
+                                            continue;
+                                        }
+                                        break;
+                                    } 
+                                    json_offset+=1;
+                                    if(json_offset>=json_content.size())
+                                    {
+                                        break;
+                                    }
+                                    json_value_name.clear();
+                                    if(json_content[json_offset]==0x22)
+                                    {
+                                        
+                                        temp_offset=json_offset;
+                                        json_value_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                        json_offset=temp_offset;
+                                        if(json_content[json_offset]==0x22)
+                                        {
+                                            json_offset+=1;
+                                        }
+                                    }
+                                    else
+                                    {
+                                        if(json_content[json_offset]!='{'&&json_content[json_offset]!=']')
+                                        {
+                                            for(;json_offset<json_content.size();json_offset++)
                                             {
-                                                json_offset -= 1;
-                                            }
-                                            break;
+                                                if(json_content[json_offset]==0x5D||json_content[json_offset]==0x7D||json_content[json_offset]==0x22||json_content[json_offset]==0x2C||json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                                {
+                                                    if(json_content[json_offset]==0x7D)
+                                                    {
+                                                        json_offset-=1;
+                                                    } 
+                                                    break;
+                                                }
+                                                json_value_name.push_back(json_content[json_offset]);
+                                            }   
                                         }
-                                        json_value_name.push_back(json_content[json_offset]);
                                     }
+                                    //////////////////////////
+                                    set_val(json_key_name,json_value_name);
+                                    continue;
+                                }
+                                else
+                                {
+                                    break;
                                 }
                             }
-                            //////////////////////////
-                            set_val(json_key_name, json_value_name);
-                            continue;
-                        }
-                        else
-                        {
-                            break;
-                        }
-                    }
+    
                 }
                 record.emplace_back(data);
-
-                json_offset += 1;
+                
+                json_offset+=1;
             }
-            if (record.size() > 1)
+            if(record.size()>1)
             {
-                data = record[0];
+                data=record[0];
             }
         }
         else
         {
-            if (json_content[json_offset] == '{')
+           if(json_content[json_offset]=='{')
             {
-                json_offset += 1;
-                std::string json_key_name, json_value_name;
-
-                for (; json_offset < json_content.size(); json_offset++)
+                json_offset+=1; 
+                std::string json_key_name,json_value_name; 
+                 
+                
+                for(;json_offset<json_content.size();json_offset++)
                 {
-
-                    if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                    {
-                        continue;
-                    }
-                    else
-                    {
-                        if (json_content[json_offset] == 0x22)
+ 
+                        if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
                         {
-                            unsigned int temp_offset = json_offset;
-                            json_key_name            = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                            json_offset              = temp_offset;
-                            if (json_content[json_offset] == 0x22)
-                            {
-                                json_offset += 1;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
+                            continue;
+                        }
+                        else
+                        {
+                            if(json_content[json_offset]==0x22)
                             {
-
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                 unsigned int temp_offset=json_offset;
+                                 json_key_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                 json_offset=temp_offset;
+                                 if(json_content[json_offset]==0x22)
+                                 {
+                                    json_offset+=1;
+                                 }
+                                for(;json_offset<json_content.size();json_offset++)
                                 {
-                                    continue;
+                                
+                                    if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                    {
+                                        continue;
+                                    }
+                                    break;
+                                }       
+                                if(json_content[json_offset]!=':')
+                                {
+                                    break;
                                 }
-                                break;
-                            }
-                            if (json_content[json_offset] != ':')
-                            {
-                                break;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
-                            {
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                for(;json_offset<json_content.size();json_offset++)
                                 {
-                                    continue;
+                                    if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                    {
+                                        continue;
+                                    }
+                                    break;
+                                } 
+                                json_offset+=1;
+                                if(json_offset>=json_content.size())
+                                {
+                                    break;
                                 }
-                                break;
-                            }
-                            json_offset += 1;
-                            if (json_offset >= json_content.size())
-                            {
-                                break;
-                            }
-                            json_value_name.clear();
-                            if (json_content[json_offset] == 0x22)
-                            {
-
-                                temp_offset     = json_offset;
-                                json_value_name = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                                json_offset     = temp_offset;
-                                if (json_content[json_offset] == 0x22)
+                                json_value_name.clear();
+                                if(json_content[json_offset]==0x22)
                                 {
-                                    json_offset += 1;
+                                    
+                                    temp_offset=json_offset;
+                                    json_value_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                    json_offset=temp_offset;
+                                    if(json_content[json_offset]==0x22)
+                                    {
+                                        json_offset+=1;
+                                    }
                                 }
-                            }
-                            else
-                            {
-                                if (json_content[json_offset] != '{' && json_content[json_offset] != ']')
+                                else
                                 {
-                                    for (; json_offset < json_content.size(); json_offset++)
+                                    if(json_content[json_offset]!='{'&&json_content[json_offset]!=']')
                                     {
-                                        if (json_content[json_offset] == 0x5D || json_content[json_offset] == 0x7D || json_content[json_offset] == 0x22 || json_content[json_offset] == 0x2C || json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                        for(;json_offset<json_content.size();json_offset++)
                                         {
-                                            if (json_content[json_offset] == 0x7D)
+                                            if(json_content[json_offset]==0x5D||json_content[json_offset]==0x7D||json_content[json_offset]==0x22||json_content[json_offset]==0x2C||json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
                                             {
-                                                json_offset -= 1;
+                                               if(json_content[json_offset]==0x7D)
+                                               {
+                                                   json_offset-=1;
+                                               } 
+                                               break;
                                             }
-                                            break;
-                                        }
-                                        json_value_name.push_back(json_content[json_offset]);
+                                            json_value_name.push_back(json_content[json_offset]);
+                                        }   
                                     }
                                 }
+                                //////////////////////////
+                                set_val(json_key_name,json_value_name);
+                                continue;
+                            }
+                            else
+                            {
+                                break;
                             }
-                            //////////////////////////
-                            set_val(json_key_name, json_value_name);
-                            continue;
-                        }
-                        else
-                        {
-                            break;
                         }
-                    }
+ 
                 }
                 record.emplace_back(data);
+            } 
+        }
+   }   
+    
+    void set_val(const std::string& set_key_name,const std::string& set_value_name)
+    {
+        switch(findcolpos(set_key_name))
+        {
+    		case 0:
+		 try{
+			data.id=std::stoul(set_value_name);
+		}catch (...) { 
+			data.id=0;
+			 }
+			break;
+		case 1:
+		 try{
+			data.message.append(set_value_name);
+		}catch (...) { 
+			data.message.clear();
+			 }
+			break;
+	default:
+		 { }
+			
+
+
+        }
+   } 
+    
+    void set_val(const std::string& set_key_name,const long long set_value_name)
+    {
+        switch(findcolpos(set_key_name))
+        {
+    		case 0:
+		 try{
+			data.id=set_value_name;
+		}catch (...) { 
+			data.id=0;
+			 }
+			break;
+		case 1:
+		 try{
+			data.message=std::to_string(set_value_name);
+		}catch (...) { 
+			data.message.clear();
+			 }
+			break;
+	default:
+		 { }
+			
+
+
+        }
+   } 
+    
+    void set_val(const std::string& set_key_name,const double set_value_name)
+    {
+        switch(findcolpos(set_key_name))
+        {
+    		case 0:
+		 try{
+			data.id=(unsigned int)set_value_name;
+		}catch (...) { 
+			data.id=0;
+			 }
+			break;
+		case 1:
+		 try{
+			data.message=std::to_string(set_value_name);
+		}catch (...) { 
+			data.message.clear();
+			 }
+			break;
+	default:
+		 { }
+			
+
+
+        }
+   } 
+    
+   std::string to_json(std::string fileld=""){
+    std::ostringstream tempsql;
+    std::string keyname;
+    unsigned char jj=0;
+    std::vector<unsigned char> keypos;
+    if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
             }
-        }
-    }
+            if(fileld[jj]==0x20){
 
-    void set_val(const std::string &set_key_name, const std::string &set_value_name)
-    {
-        switch (findcolpos(set_key_name))
-        {
-        case 0:
-            try
-            {
-                data.id = std::stoul(set_value_name);
-            }
-            catch (...)
-            {
-                data.id = 0;
-            }
-            break;
-        case 1:
-            try
-            {
-                data.message.append(set_value_name);
-            }
-            catch (...)
-            {
-                data.message.clear();
+                continue;   
             }
-            break;
-        default:
-        {
-        }
+            keyname.push_back(fileld[jj]);
+
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
         }
-    }
+    }else{
+        for(jj=0;jj<col_names.size();jj++){
+            keypos.emplace_back(jj); 
+        }
+    }
+    tempsql<<"[";
+    for(size_t n=0;n<record.size();n++){
+        if(n>0){
+            tempsql<<",{";
+        }else{
+            tempsql<<"{";
+        }  
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(record[n].id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(record[n].id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(record[n].message)<<"\"";
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+      tempsql<<"}";  
+            }
+      tempsql<<"]";
+     return tempsql.str();             
+   }   
+   
+   std::string to_json(std::function<bool(std::string&,meta&)> func,std::string fileld=""){
+       std::ostringstream tempsql;
+        std::string keyname;
+        unsigned char jj=0;
+        std::vector<unsigned char> keypos;
+        if(fileld.size()>0){
+            for(;jj<fileld.size();jj++){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
+                    keyname.clear();
+                    continue;   
+                }
+                if(fileld[jj]==0x20){
 
-    void set_val(const std::string &set_key_name, const long long set_value_name)
-    {
-        switch (findcolpos(set_key_name))
-        {
-        case 0:
-            try
-            {
-                data.id = set_value_name;
-            }
-            catch (...)
-            {
-                data.id = 0;
-            }
-            break;
-        case 1:
-            try
-            {
-                data.message = std::to_string(set_value_name);
+                    continue;   
+                }
+                keyname.push_back(fileld[jj]);
+
+            }  
+            if(keyname.size()>0){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
             }
-            catch (...)
-            {
-                data.message.clear();
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
             }
-            break;
-        default:
-        {
         }
-        }
-    }
+        tempsql<<"[";
+        for(size_t n=0;n<record.size();n++){
+            keyname.clear();
+            if(func(keyname,record[n])){ 
+                if(n>0){
+                    tempsql<<",{";
+                }else{
+                    tempsql<<"{";
+                } 
+                tempsql<<keyname;
+            }else{
+            continue;
+            } 
+        
+        for(jj=0;jj<keypos.size();jj++){
+            
+            switch(keypos[jj]){
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(record[n].id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(record[n].id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(record[n].message)<<"\"";
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+      tempsql<<"}";  
+            }
+      tempsql<<"]";
+     return tempsql.str();             
+   }   
+   long long getPK(){  return data.id; } 
+ void setPK(long long val){  data.id=val;} 
+ unsigned  int  getId(){  return data.id; } 
+ void setId( unsigned  int  val){  data.id=val;} 
+
+ std::string  getMessage(){  return data.message; } 
+ std::string & getRefMessage(){  return std::ref(data.message); } 
+ void setMessage( std::string  &val){  data.message=val;} 
+ void setMessage(std::string_view val){  data.message=val;} 
+
+fortunebase::meta getnewData(){
+ 	 struct meta newdata;
+	 return newdata; 
+} 
+fortunebase::meta getData(){
+ 	 return data; 
+} 
+std::vector<fortunebase::meta> getRecord(){
+ 	 return record; 
+} 
+
+
+    template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true>
+    T& ref_meta([[maybe_unused]] std::string key_name)
+    {
+   		 if(key_name=="message")
+		{
+			return data.message;
+		}
+		return nullptr; 
+	}
+
+
+    template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true>
+    T& ref_meta([[maybe_unused]] std::string key_name)
+    {
+   		 if(key_name=="id")
+		{
+			return data.id;
+		}
+		return nullptr; 
+	}
+
+
+    template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true >
+    T& ref_meta([[maybe_unused]] std::string key_name)
+    {
+   		return nullptr; 
+	}
+
+            template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >  
+            std::vector<T> getCol([[maybe_unused]] std::string keyname)
+            {
+                std::vector<T> a;
+                
+   
+                unsigned char kpos;
+                kpos=findcolpos(keyname);               
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
+   			case 0: 
+ 				 a.emplace_back(iter.id);
+				 break;
 
-    void set_val(const std::string &set_key_name, const double set_value_name)
-    {
-        switch (findcolpos(set_key_name))
+                    }
+                }
+    
+                return a;
+            }
+    
+            template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true >    
+			std::vector<T> getCol([[maybe_unused]] std::string keyname)
+			{
+				std::vector<T> a;
+				
+
+                return a;
+            }
+    
+            template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >   
+            T getVal([[maybe_unused]] std::string keyname)
+            {
+   
+                    unsigned char kpos;
+                    kpos=findcolpos(keyname);                   
+                    switch(kpos)
+                    {
+
+   			case 0: 
+ 				 return data.id;
+				 break;
+			}
+                return 0;
+            }  
+    
+        template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true > 
+        T getVal([[maybe_unused]] fortunebase::meta & iter,[[maybe_unused]] std::string keyname)
         {
-        case 0:
-            try
-            {
-                data.id = (unsigned int)set_value_name;
-            }
-            catch (...)
-            {
-                data.id = 0;
-            }
-            break;
-        case 1:
-            try
-            {
-                data.message = std::to_string(set_value_name);
-            }
-            catch (...)
-            {
-                data.message.clear();
-            }
-            break;
-        default:
-        {
-        }
-        }
-    }
 
-    std::string to_json(std::string fileld = "")
-    {
-        std::ostringstream tempsql;
-        std::string keyname;
-        unsigned char jj = 0;
-        std::vector<unsigned char> keypos;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
+          
+            unsigned char kpos;
+            kpos=findcolpos(keyname);   
+            switch(kpos)
             {
-                if (fileld[jj] == ',')
+   			case 0: 
+ 				 return iter.id;
+				 break;
+
+			}
+
+            return 0;
+        }  
+    
+            template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true > 
+            T getVal(std::string keyname)
+            {
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+            
+                switch(kpos)
                 {
-                    keypos.emplace_back(findcolpos(keyname));
-                    keyname.clear();
-                    continue;
+
+    
+                    }
+                   
+    
+                    return 0.0;
+            }  
+    
+            template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true > 
+            T getVal([[maybe_unused]] fortunebase::meta & iter,std::string keyname)
+            {
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+                switch(kpos)
+                {
+   
                 }
-                if (fileld[jj] == 0x20)
+                 
+    
+            
+                return 0.0;
+            }  
+    
+            template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true > 
+            std::string getVal(std::string keyname)
+            {
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+        
+                switch(kpos)
                 {
 
-                    continue;
+   			case 1: 
+ 				 return data.message;
+				 break;
+
                 }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
-                keyname.clear();
-            }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-        tempsql << "[";
-        for (size_t n = 0; n < record.size(); n++)
+                return "";
+            }  
+   
+            template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true > 
+            std::string getVal([[maybe_unused]] fortunebase::meta & iter,std::string keyname)
+            {
+         
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+       
+                switch(kpos)
+                {
+
+   			case 1: 
+ 				 return iter.message;
+				 break;
+
+                }
+                
+    
+                 
+                return "";
+            }  
+     
+            template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true >   
+            std::vector<std::string> getCol([[maybe_unused]] std::string keyname)
+            {
+                std::vector<std::string> a;
+
+           
+                unsigned char kpos;
+                kpos=findcolpos(keyname);                    
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
+
+    			case 1: 
+ 				 a.emplace_back(iter.message);
+					 break;
+					}
+				}
+
+        return a;
+    }
+     
+        std::string getstrCol(std::string keyname,[[maybe_unused]] bool isyinhao=false)
         {
-            if (n > 0)
-            {
-                tempsql << ",{";
-            }
-            else
+            std::ostringstream a;
+    
+            unsigned char kpos;
+            kpos=findcolpos(keyname);   
+            int j=0;
+            if(isyinhao&&record.size()>0)
             {
-                tempsql << "{";
+                a<<'"';
             }
-
-            for (jj = 0; jj < keypos.size(); jj++)
+            for(auto &iter:record)
             {
-                switch (keypos[jj])
-                {
-                case 0:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (record[n].id == 0)
-                    {
-                        tempsql << "\"id\":0";
-                    }
-                    else
+                    if(j>0)
                     {
-                        tempsql << "\"id\":" << std::to_string(record[n].id);
+                        if(isyinhao)
+                        {
+                            a<<"\",\"";
+                        }else{
+                            a<<',';    
+                        }
                     }
-                    break;
-                case 1:
-                    if (jj > 0)
+                    switch(kpos)
                     {
-                        tempsql << ",";
+
+   			case 0: 
+ 				 a<<std::to_string(iter.id);
+				 break;
+			case 1: 
+ 				 if(isyinhao){ a<<jsonaddslash(iter.message); 
+				 }else{
+				 a<<iter.message;
+				 }
+				 break;
+
                     }
-                    tempsql << "\"message\":\"" << http::utf8_to_jsonstring(record[n].message) << "\"";
-                    break;
+                    j++;
+            } 
+            if(isyinhao&&j>0){
+                a<<'"';
+            }      
+    
+                return a.str();
+        }
+    
+    template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>     
+    std::map<std::string,std::string> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+    {
+        std::map<std::string,std::string> a;
+    
+        unsigned char kpos,vpos;
+        kpos=findcolpos(keyname);
+        vpos=findcolpos(valname);        
+         std::string ktemp,vtemp;
+         for(auto &iter:record)
+         {
+                switch(kpos)
+                {
 
-                default:;
-                }
-            }
-            tempsql << "}";
-        }
-        tempsql << "]";
-        return tempsql.str();
-    }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+				 } 
+			switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
 
-    std::string to_json(std::function<bool(std::string &, meta &)> func, std::string fileld = "")
-    {
-        std::ostringstream tempsql;
-        std::string keyname;
-        unsigned char jj = 0;
-        std::vector<unsigned char> keypos;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
+                }
+                if(ktemp.size()>0)
                 {
-                    keypos.emplace_back(findcolpos(keyname));
-                    keyname.clear();
-                    continue;
+                    a.emplace(ktemp,vtemp);
                 }
-                if (fileld[jj] == 0x20)
+            }       
+
+        
+            return a;
+        } 
+    
+
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::map<std::string,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::map<std::string,U> a;
+      
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);            
+                std::string ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {    
+                    switch(kpos)
+                    {
+ 
+       			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			 } 
+		 switch(vpos){
+
+                    }
+                    if(ktemp.size()>0)
+                    {
+                        a.emplace(ktemp,vtemp);
+                    }
+                }       
+        
+            return a;
+        } 
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>       
+        std::map<T,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,U> a;
+       
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);        
+            T ktemp;
+            U vtemp;
+            for(auto &iter:record)
+            {
+                switch(kpos)
                 {
+ 
+       case 0: 
+ 	 ktemp=iter.id;
+	 break;
+	 } 
+ 		  switch(vpos){
 
-                    continue;
                 }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
-                keyname.clear();
-            }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-        tempsql << "[";
-        for (size_t n = 0; n < record.size(); n++)
-        {
-            keyname.clear();
-            if (func(keyname, record[n]))
-            {
-                if (n > 0)
+                if(ktemp.size()>0)
                 {
-                    tempsql << ",{";
+                    a.emplace(ktemp,vtemp);
                 }
-                else
+            }       
+     
+        return a;
+    }  
+            template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>      
+            std::map<T,std::string> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+            {
+                std::map<T,std::string> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);         
+                T ktemp;
+                std::string vtemp;
+                for(auto &iter:record)
                 {
-                    tempsql << "{";
-                }
-                tempsql << keyname;
-            }
-            else
-            {
-                continue;
-            }
+                    switch(kpos)
+                    {
 
-            for (jj = 0; jj < keypos.size(); jj++)
-            {
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
+ 			switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
 
-                switch (keypos[jj])
-                {
-                case 0:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (record[n].id == 0)
-                    {
-                        tempsql << "\"id\":0";
-                    }
-                    else
-                    {
-                        tempsql << "\"id\":" << std::to_string(record[n].id);
                     }
-                    break;
-                case 1:
-                    if (jj > 0)
+                    if(ktemp.size()>0)
                     {
-                        tempsql << ",";
+                        a.emplace(ktemp,vtemp);
                     }
-                    tempsql << "\"message\":\"" << http::utf8_to_jsonstring(record[n].message) << "\"";
-                    break;
-
-                default:;
-                }
-            }
-            tempsql << "}";
-        }
-        tempsql << "]";
-        return tempsql.str();
-    }
-    long long getPK() { return data.id; }
-    void setPK(long long val) { data.id = val; }
-    unsigned int getId() { return data.id; }
-    void setId(unsigned int val) { data.id = val; }
-
-    std::string getMessage() { return data.message; }
-    std::string &getRefMessage() { return std::ref(data.message); }
-    void setMessage(std::string &val) { data.message = val; }
-    void setMessage(std::string_view val) { data.message = val; }
-
-    fortunebase::meta getnewData()
-    {
-        struct meta newdata;
-        return newdata;
-    }
-    fortunebase::meta getData()
-    {
-        return data;
-    }
-    std::vector<fortunebase::meta> getRecord()
-    {
-        return record;
-    }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    T &ref_meta([[maybe_unused]] std::string key_name)
-    {
-        if (key_name == "message")
-        {
-            return data.message;
-        }
-        return nullptr;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    T &ref_meta([[maybe_unused]] std::string key_name)
-    {
-        if (key_name == "id")
-        {
-            return data.id;
-        }
-        return nullptr;
-    }
-
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    T &ref_meta([[maybe_unused]] std::string key_name)
-    {
-        return nullptr;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::vector<T> getCol([[maybe_unused]] std::string keyname)
-    {
-        std::vector<T> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-            case 0:
-                a.emplace_back(iter.id);
-                break;
-            }
-        }
-
-        return a;
-    }
+                } 
+         
+                return a;
+            }     
+        
+        template<typename T,typename U, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>       
+        std::map<std::string,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<std::string,U> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            std::string  ktemp;
+            U  vtemp;
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    std::vector<T> getCol([[maybe_unused]] std::string keyname)
-    {
-        std::vector<T> a;
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			  }
+ 			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
 
+                }
+                if(ktemp.size()>0)
+                {
+                    a.emplace(ktemp,vtemp);
+                }
+            }       
+      
         return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    T getVal([[maybe_unused]] std::string keyname)
-    {
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        switch (kpos)
-        {
-
-        case 0:
-            return data.id;
-            break;
-        }
-        return 0;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    T getVal([[maybe_unused]] fortunebase::meta &iter, [[maybe_unused]] std::string keyname)
-    {
+    }  
+    
+        template<typename T,typename U, typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>   
+        std::map<T,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,U> a;
+    
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            T ktemp;
+            U vtemp;
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        switch (kpos)
-        {
-        case 0:
-            return iter.id;
-            break;
-        }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
+ 			switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
 
-        return 0;
-    }
+                }
+                if(ktemp.size()>0)
+                {
+                    a.emplace(ktemp,vtemp);
+                }
+            }       
+    
+            return a;
+        }   
+    
+        template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >         
+        std::map<T,meta> getmapRows([[maybe_unused]] std::string keyname)
+        {
+            std::map<T,meta> a;
+    
+            unsigned char kpos;
+            kpos=findcolpos(keyname);                        
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    T getVal(std::string keyname)
-    {
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
+   			case 0: 
+ 				 a.emplace(iter.id,iter);
+				 break;
 
-        switch (kpos)
-        {
-        }
+                }
+            }       
+     
+            return a;
+        }     
+    
+        template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true >    
+        std::map<std::string,meta> getmapRows([[maybe_unused]] std::string keyname)
+        {
+            std::map<std::string,meta> a;
+
+    
+            unsigned char kpos;
+            kpos=findcolpos(keyname);            
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        return 0.0;
-    }
+   			case 1: 
+ 				 a.emplace(iter.message,iter);
+			 break;
 
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    T getVal([[maybe_unused]] fortunebase::meta &iter, std::string keyname)
-    {
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        switch (kpos)
-        {
-        }
+                }
+                //a.emplace(ktemp,iter);
+            }       
+    
 
-        return 0.0;
+        return a;
     }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::string getVal(std::string keyname)
-    {
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-
-        switch (kpos)
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>  
+        std::vector<std::pair<std::string,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
         {
+            std::vector<std::pair<std::string,U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);                   
+            std::string ktemp;
+            U vtemp;
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        case 1:
-            return data.message;
-            break;
-        }
-        return "";
-    }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::string getVal([[maybe_unused]] fortunebase::meta &iter, std::string keyname)
-    {
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+	 		 }
+ 			switch(vpos){
+
+                   }
+
+                 a.emplace_back(ktemp,vtemp);
+            }       
+
+     
+
+            return a;
+        }   
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-        switch (kpos)
-        {
+   			case 0: 
+ 				 ktemp=iter.id;
+			 break;
+			  }
+			 switch(vpos){
 
-        case 1:
-            return iter.message;
-            break;
-        }
+                   }
 
-        return "";
-    }
+                   a.emplace_back(ktemp,vtemp);
+                }       
 
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::vector<std::string> getCol([[maybe_unused]] std::string keyname)
-    {
-        std::vector<std::string> a;
+    
 
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
+            return a;
+        }   
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
         {
-            switch (kpos)
-            {
-
-            case 1:
-                a.emplace_back(iter.message);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    std::string getstrCol(std::string keyname, [[maybe_unused]] bool isyinhao = false)
-    {
-        std::ostringstream a;
+                std::vector<std::pair<T,U>> a;
 
-        unsigned char kpos;
-        kpos  = findcolpos(keyname);
-        int j = 0;
-        if (isyinhao && record.size() > 0)
-        {
-            a << '"';
-        }
-        for (auto &iter : record)
-        {
-            if (j > 0)
-            {
-                if (isyinhao)
-                {
-                    a << "\",\"";
-                }
-                else
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
                 {
-                    a << ',';
-                }
-            }
-            switch (kpos)
-            {
+                    switch(kpos)
+                    {
 
-            case 0:
-                a << std::to_string(iter.id);
-                break;
-            case 1:
-                if (isyinhao)
-                {
-                    a << jsonaddslash(iter.message);
-                }
-                else
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
+ 			switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
+
+                   }
+
+                    a.emplace_back(ktemp,vtemp);
+                }       
+    
+            return a;
+        }  
+    
+        template<typename T,typename U, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>     
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);                
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
                 {
-                    a << iter.message;
-                }
-                break;
-            }
-            j++;
-        }
-        if (isyinhao && j > 0)
-        {
-            a << '"';
-        }
-
-        return a.str();
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<std::string, std::string> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<std::string, std::string> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        std::string ktemp, vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
+                    
+                    switch(kpos)
+                    {
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			  }
+ 			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+
+                   }
+                    a.emplace_back(ktemp,vtemp);
+                }       
+    
+            return a;
+        }  
+    
+        template<typename T,typename U, typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-        return a;
-    }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+
+                   }
+                    a.emplace_back(ktemp,vtemp);
+                }       
+      
+            return a;
+        }   
+    
+        template<typename T,typename U, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true>     
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<std::string, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<std::string, U> a;
+   case 1: 
+ 	 ktemp=iter.message;
+	 break;
+	  }
+ switch(vpos){
+case 1: 
+ 	 vtemp=iter.message;
+	 break;
+
+                   }
+
+                    a.emplace_back(ktemp,vtemp);
+                }       
+    
+            return a;
+        }  
+    
+        template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >   
+        std::vector<std::pair<T,meta>> getvecRows([[maybe_unused]] std::string keyname)
+        {
+            std::vector<std::pair<T,meta>> a;
+     
+            unsigned char kpos;
+            kpos=findcolpos(keyname);                  
+            for(auto &iter:record)
+            { 
+                switch(kpos)
+                {
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        std::string ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<T, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, U> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::string> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::string> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        std::string vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<std::string, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<std::string, U> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        std::string ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, U> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::map<T, meta> getmapRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<T, meta> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                a.emplace(iter.id, iter);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::map<std::string, meta> getmapRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<std::string, meta> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 1:
-                a.emplace(iter.message, iter);
-                break;
-            }
-            //a.emplace(ktemp,iter);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::vector<std::pair<std::string, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<std::string, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        std::string ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
-
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
-
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::vector<std::pair<T, meta>> getvecRows([[maybe_unused]] std::string keyname)
-    {
-        std::vector<std::pair<T, meta>> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                a.emplace_back(iter.id, iter);
-                break;
-            }
-        }
-
-        return a;
-    }
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::vector<std::pair<std::string, meta>> getvecRows([[maybe_unused]] std::string keyname)
-    {
-        std::vector<std::pair<std::string, meta>> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 1:
-                a.emplace_back(iter.message, iter);
-                break;
-            }
-        }
-
-        return a;
-    }
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-
-            switch (dpos)
-            {
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        //D vtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-
-            switch (dpos)
-            {
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.message);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
-
-            switch (dpos)
-            {
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
-
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            }
-        }
-
-        return a;
-    }
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
-
-            switch (dpos)
-            {
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.message);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        //D vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-
-            switch (dpos)
-            {
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        //D vtemp;
-
-        for (auto &iter : record)
-        {
-
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
-
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
+   case 0: 
+ 	 a.emplace_back(iter.id,iter);
+	 break;
 
-        for (auto &iter : record)
+                }
+            }       
+    
+        return a;
+    }
+        template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true >  
+        std::vector<std::pair<std::string,meta>> getvecRows([[maybe_unused]] std::string keyname)
         {
-
-            switch (kpos)
+            std::vector<std::pair<std::string,meta>> a;
+      
+            unsigned char kpos;
+            kpos=findcolpos(keyname);                     
+            for(auto &iter:record)
             {
+                switch(kpos)
+                {
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            }
+   case 1: 
+ 	 a.emplace_back(iter.message,iter);
+	 break;
 
-            switch (dpos)
-            {
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.message);
-                break;
-            }
-        }
+                }
+            }       
+    
 
         return a;
     }
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+    
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);      
+            T ktemp;
+            U vtemp;
+            for(auto &iter:record)
+            { 
+                switch(kpos)
+                {
 
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
 
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			  }
+
+			 switch(dpos){
+
+                }
+            }       
 
-        for (auto &iter : record)
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
         {
-            switch (kpos)
+            std::map<T,std::map<U,std::vector<D>>> a;
+    
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);          
+            T ktemp;
+            U vtemp;
+            //D vtemp;
+
+            for(auto &iter:record)
             {
+                switch(kpos)
+                {
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
 
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			  }
 
-            switch (dpos)
-            {
-            }
-        }
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
 
-        return a;
-    }
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);       
+            T ktemp;
+            U vtemp;
+            // D dtemp;
+
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+				  }
 
-        for (auto &iter : record)
-        {
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			 }
 
-            switch (kpos)
-            {
+			 switch(dpos){
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.message);
+				 break;
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+                std::map<T,std::map<U,std::vector<D>>> a;
+   
+                unsigned char kpos,vpos,dpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                dpos=findcolpos(dataname);
+                T ktemp;
+                U vtemp;
+            // D dtemp;
+
+                for(auto &iter:record)
+                {
+                    
+                    switch(kpos)
+                    {
 
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			 }
 
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            }
-        }
+			 switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
+			  }
 
-        return a;
-    }
+			 switch(dpos){
 
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
+                   }
+                }       
+    
+            return a;
+        }
+    
+    template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+    std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
     {
-        std::map<T, std::map<U, std::vector<D>>> a;
+        std::map<T,std::map<U,std::vector<D>>> a;
 
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
+   
+        unsigned char kpos,vpos,dpos;
+        kpos=findcolpos(keyname);
+        vpos=findcolpos(valname);
+        dpos=findcolpos(dataname);             
         T ktemp;
         U vtemp;
-        // D dtemp;
+       // D dtemp;
 
-        for (auto &iter : record)
-        {
-            switch (kpos)
+         for(auto &iter:record)
+         {
+            switch(kpos)
             {
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			 }
 
-            switch (vpos)
-            {
-            case 1:
-                vtemp = iter.message;
-                break;
-            }
+			 switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
+			 }
 
-            switch (dpos)
-            {
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.message);
-                break;
-            }
-        }
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
 
+            }
+         }       
+    
         return a;
     }
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);
+            T ktemp;
+            U vtemp;
+            // D dtemp;
+
+            for(auto &iter:record)
+            { 
+                switch(kpos)
+                {
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+			 switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
+			  }
 
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
+			 switch(dpos){
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.message);
+				 break;
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+                std::map<T,std::map<U,std::vector<D>>> a;
+   
+                unsigned char kpos,vpos,dpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                dpos=findcolpos(dataname);               
+                T ktemp;
+                U vtemp;
+                //D vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-            switch (vpos)
-            {
-            case 1:
-                a[ktemp].emplace_back(iter.message);
-                break;
-            }
-        }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			 }
 
-        return a;
-    }
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			  }
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+			 switch(dpos){
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+                    }
+                }       
+    
 
-        for (auto &iter : record)
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
         {
-            switch (kpos)
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);            
+            T ktemp;
+            U vtemp;
+            //D vtemp;
+
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			  }
 
-            switch (vpos)
-            {
-            }
-        }
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			 }
 
-        return a;
-    }
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
+                }
+            }       
+    
+            return a;
+        }
+    
+    template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+    std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
     {
-        std::map<T, std::vector<U>> a;
+        std::map<T,std::map<U,std::vector<D>>> a;
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
+   
+        unsigned char kpos,vpos,dpos;
+        kpos=findcolpos(keyname);
+        vpos=findcolpos(valname);
+        dpos=findcolpos(dataname);
         T ktemp;
-        //U vtemp;
-
-        for (auto &iter : record)
-        {
-
-            switch (kpos)
-            {
-
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+        U vtemp;
+        // D dtemp;
 
-            switch (vpos)
+         for(auto &iter:record)
+         {
+             
+            switch(kpos)
             {
-            case 0:
-                a[ktemp].emplace_back(iter.id);
-                break;
-            }
-        }
 
-        return a;
-    }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			 }
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+			switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			 }
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+			switch(dpos){
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.message);
+				 break;
 
-        for (auto &iter : record)
+            }
+         }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
         {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);        
+            T ktemp;
+            U vtemp;
+            // D dtemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                switch(kpos)
+                {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 1:
-                a[ktemp].emplace_back(iter.message);
-                break;
-            }
-        }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			 }
 
-        return a;
-    }
+			 switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
+			  }
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+			 switch(dpos){
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+                }
+            }       
 
-        for (auto &iter : record)
+    
+            return a;
+        }
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
         {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);
+            T ktemp;
+            U vtemp;
+            // D dtemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
-
-            switch (vpos)
-            {
-            }
-        }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			  }
 
-        return a;
-    }
+			 switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
+			 }
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);        
+            T ktemp;
+            U vtemp;
+            // D dtemp;
+
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        for (auto &iter : record)
-        {
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			  }
 
-            switch (kpos)
-            {
+			 switch(vpos){
+			case 1: 
+ 				 vtemp=iter.message;
+				 break;
+			  }
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
+			 switch(dpos){
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.message);
+				 break;
 
-            switch (vpos)
-            {
-            case 0:
-                a[ktemp].emplace_back(iter.id);
-                break;
-            }
+                }
+            }       
+    
+            return a;
         }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
 
-        return a;
-    }
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
 
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::map<T, std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<T, std::vector<meta>> a;
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			  }
 
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
+			 switch(vpos){
+			case 1: 
+ 				 a[ktemp].emplace_back(iter.message);
+				 break;
 
-            case 0:
-                a[iter.id].emplace_back(iter);
-                break;
-            }
+                }
+            }       
+    
+            return a;
         }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
 
-        return a;
-    }
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::map<T, std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<T, std::vector<meta>> a;
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			 }
+
+			 switch(vpos){
 
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
+                }
+            }       
 
-        for (auto &iter : record)
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
         {
+            std::map<T,std::vector<U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 1:
-                a[iter.message].emplace_back(iter);
-                break;
-            }
-        }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			  }
 
-        return a;
-    }
+			 switch(vpos){
+			case 0: 
+ 				 a[ktemp].emplace_back(iter.id);
+				 break;
 
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
+
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			 }
+
+			 switch(vpos){
+			case 1: 
+ 				 a[ktemp].emplace_back(iter.message);
+				 break;
+
+                }
+            }       
 
-        for (auto &iter : record)
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
         {
+            std::map<T,std::vector<U>> a;
+               
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
 
-            switch (vpos)
-            {
-            case 1:
-                a[ktemp][iter.message].emplace_back(iter);
-                break;
-            }
-        }
+			 switch(vpos){
 
-        return a;
-    }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
+
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			 }
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
+			 switch(vpos){
+			case 0: 
+ 				 a[ktemp].emplace_back(iter.id);
+				 break;
 
-        for (auto &iter : record)
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename std::enable_if<std::is_integral_v<T>,bool>::type = true>    
+        std::map<T,std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
         {
+            std::map<T,std::vector<meta>> a;
+   
+            unsigned char kpos;
+            kpos=findcolpos(keyname);
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                switch(kpos)
+                {
 
-            case 1:
-                ktemp = iter.message;
-                break;
-            }
+   			case 0: 
+ 				 a[iter.id].emplace_back(iter);
+				 break;
 
-            switch (vpos)
-            {
-            case 0:
-                a[ktemp][iter.id].emplace_back(iter);
-                break;
-            }
+                }
+            }       
+    
+            return a;
         }
+    
+        template<typename T,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true>    
+        std::map<T,std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
+        {
+            std::map<T,std::vector<meta>> a;
+   
+            unsigned char kpos;
+            kpos=findcolpos(keyname);
 
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
+   			case 1: 
+ 				 a[iter.message].emplace_back(iter);
+				 break;
 
-        for (auto &iter : record)
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
         {
+            std::map<T,std::map<U,std::vector<meta>>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+			 }
 
-            switch (vpos)
-            {
-            case 0:
-                a[ktemp][iter.id].emplace_back(iter);
-                break;
-            }
-        }
+			 switch(vpos){
+			case 1: 
+ 				 a[ktemp][iter.message].emplace_back(iter);
+				 break;
 
-        return a;
-    }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::map<U,std::vector<meta>>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            T ktemp;
+            
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+   			case 1: 
+ 				 ktemp=iter.message;
+				 break;
+	  }
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
+ switch(vpos){
+			case 0: 
+ 				 a[ktemp][iter.id].emplace_back(iter);
+				 break;
 
-        for (auto &iter : record)
-        {
+                }
+            }       
 
-            switch (kpos)
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<U>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::map<U,std::vector<meta>>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);        
+        T ktemp;
+        
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			 }
 
-            switch (vpos)
-            {
-            case 1:
-                a[ktemp][iter.message].emplace_back(iter);
-                break;
-            }
-        }
+			 switch(vpos){
+			case 0: 
+ 				 a[ktemp][iter.id].emplace_back(iter);
+				 break;
 
-        return a;
-    }
-};
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::map<U,std::vector<meta>>> a;
+
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            T ktemp;
+            
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
+
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			  }
+
+			 switch(vpos){
+			case 1: 
+ 				 a[ktemp][iter.message].emplace_back(iter);
+				 break;
+
+                }
+            }       
+    
+            return a;
+        }
+    
+  };
+    
 
-}// namespace orm
+}
 #endif
+   

+ 2075 - 2287
frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h

@@ -1,450 +1,333 @@
 #ifndef ORM_DEFAULT_WORLDBASEMATA_H
 #define ORM_DEFAULT_WORLDBASEMATA_H
 /*
- *This file is auto create from cli
- *本文件为自动生成 Fri, 26 Jan 2024 02:59:30 GMT
- ***/
+*This file is auto create from cli
+*本文件为自动生成 Sun, 02 Mar 2025 08:24:41 GMT
+***/
 #include <iostream>
 #include <cstdio>
 #include <sstream>
 #include <array>
-#include <map>
-#include <string_view>
-#include <string>
+#include <map> 
+#include <string_view> 
+#include <string> 
 #include <vector>
 #include <ctime>
 #include <array>
+#include "unicode.h"
 
-namespace orm
-{
-
+namespace orm { 
+   
+    
 struct worldbase
 {
-    struct meta
-    {
-        unsigned int id  = 0;//
-        int randomnumber = 0;//
-    } data;
-    std::vector<worldbase::meta> record;
-    std::string _rmstag = "default";//this value must be default or tag value, tag in mysqlconnect config file .
-    std::vector<unsigned char> _keypos{0x00};
-
-    std::vector<worldbase::meta>::iterator begin() { return record.begin(); }
-    std::vector<worldbase::meta>::iterator end() { return record.end(); }
-    std::vector<worldbase::meta>::const_iterator begin() const { return record.begin(); }
-    std::vector<worldbase::meta>::const_iterator end() const { return record.end(); }
-    const std::array<std::string, 2> colnames       = {"id", "randomnumber"};
-    const std::array<unsigned char, 2> colnamestype = {3, 3};
-    std::string tablename                           = "world";
-    std::string modelname                           = "World";
-
-    unsigned char findcolpos(const std::string &coln)
-    {
-        if (coln.size() == 0)
-        {
-            return 255;
-        }
-        unsigned char bi = coln[0];
-
-        if (bi < 91 && bi > 64)
-        {
-            bi += 32;
-        }
-        switch (coln[0])
-        {
-
-        case 'i':
-            return 0;
-            break;
-        case 'r':
-            return 1;
-            break;
-        }
-        return 255;
-    }
-
-    int size() { return record.size(); }
-
-    void assign_field_value(unsigned char index_pos, unsigned char *result_temp_data, unsigned int value_size, meta &data_temp)
-    {
-        /*
-        unsigned int id  = 0;//
-        int randomnumber = 0;//
-        */
-        bool is_minus = false;
-        switch (index_pos)
-        {
-        case 0:
-            data_temp.id = 0;
-            for (size_t i = 0; i < value_size; i++)
-            {
-                if (result_temp_data[i] >= '0' && result_temp_data[i] <= '9')
-                {
-                    data_temp.id = data_temp.id * 10 + (result_temp_data[i] - '0');
-                }
-            }
-            break;
-        case 1:
-
-            data_temp.randomnumber = 0;
-
-            is_minus = false;
-            if (value_size > 0)
-            {
-                if (result_temp_data[0] == '-')
-                {
-                    is_minus = true;
-                }
-            }
-            for (std::size_t i = 0; i < value_size; i++)
-            {
-                if (result_temp_data[i] >= '0' && result_temp_data[i] <= '9')
-                {
-                    data_temp.randomnumber = data_temp.randomnumber * 10 + (result_temp_data[i] - '0');
-                }
-            }
-            if (is_minus)
-            {
-                data_temp.randomnumber = ~(data_temp.randomnumber - 1);
-            }
-            break;
-        default:
-            break;
-        }
-    }
-
-    std::string getPKname()
-    {
-        return "id";
-    }
-
-    void record_reset()
-    {
-        record.clear();
-    }
-    void data_reset()
-    {
-        worldbase::meta metatemp;
-        data = metatemp;
-    }
-
-    std::string soft_remove_sql([[maybe_unused]] const std::string &fieldsql)
-    {
-        std::string temp;
-
-        return temp;
-    }
-
-    inline std::string stringaddslash(std::string &content)
-    {
+    struct meta{
+     unsigned  int  id = 0; ///**/
+ int  randomnumber = 0; ///**/
+ } data;
+ std::vector<worldbase::meta> record;
+std::string _rmstag="default";//this value must be default or tag value, tag in mysqlconnect config file .
+unsigned int _offset=0;
+std::vector<worldbase::meta>::iterator begin(){     return record.begin(); }
+std::vector<worldbase::meta>::iterator end(){     return record.end(); }
+std::vector<worldbase::meta>::const_iterator begin() const{     return record.begin(); }
+std::vector<worldbase::meta>::const_iterator end() const{     return record.end(); }
+static constexpr std::array<std::string_view,2> col_names={"id","randomnumber"};
+static constexpr std::array<unsigned char,2> col_types={3,3};
+static constexpr std::array<unsigned char,2> col_length={0,0};
+static constexpr std::array<unsigned char,2> col_decimals={0,0};
+std::string tablename="world";
+static constexpr std::string_view modelname="World";
+
+	  unsigned char findcolpos(const std::string &coln){
+            if(coln.size()==0)
+            {
+                return 255;
+            }
+		    unsigned char  bi=coln[0];
+         
+
+	         if(bi<91&&bi>64){
+				bi+=32;
+			}
+            switch(coln[0]){
+
+
+         case 'i':
+   	 return 0;
+break;
+case 'r':
+   	 return 1;
+break;
+
+             }
+             return 255;
+           }
+         
+    int size(){ return record.size(); }   
+
+    std::string getPKname(){ 
+       return "id";
+}
+
+      void record_reset()
+      {
+            record.clear();     
+      }
+      void data_reset(){
+     worldbase::meta metatemp;    
+            data = metatemp; 
+      }
+      
+      std::string soft_remove_sql([[maybe_unused]] const std::string &fieldsql){
+          std::string temp;
+     
+         return temp;
+     }
+     
+
+  inline  std::string stringaddslash(const std::string &content){
         std::string temp;
-        for (unsigned int i = 0; i < content.size(); i++)
-        {
-            if (content[i] == '\'')
-            {
+        for(unsigned int i=0;i<content.size();i++){
+            if(content[i]=='\''){
                 temp.append("\\'");
                 continue;
-            }
-            else if (content[i] == '"')
-            {
+            }else if(content[i]=='"'){
                 temp.append("\\\"");
                 continue;
-            }
-            else if (content[i] == '\\')
-            {
+            }else if(content[i]=='\\'){
                 temp.append("\\\\");
                 continue;
             }
             temp.push_back(content[i]);
         }
         return temp;
-    }
-    inline std::string jsonaddslash(std::string &content)
-    {
+   }  
+  inline  std::string jsonaddslash(const std::string &content){
         std::string temp;
-        for (unsigned int i = 0; i < content.size(); i++)
-        {
-            if (content[i] == '"')
-            {
+        for(unsigned int i=0;i<content.size();i++){
+            if(content[i]=='"'){
                 temp.append("\\\"");
                 continue;
             }
-            else if (content[i] == '\\')
-            {
+            else if(content[i]=='\\'){
                 temp.append("\\\\");
                 continue;
             }
             temp.push_back(content[i]);
         }
         return temp;
-    }
+   }  
 
-    std::string _makeinsertsql()
-    {
-        unsigned int j = 0;
+   std::string _makeinsertsql(){
+        unsigned int j=0;
         std::ostringstream tempsql;
-        tempsql << "INSERT INTO ";
-        tempsql << tablename;
-        tempsql << " (";
-        for (; j < colnames.size(); j++)
-        {
-            if (j > 0)
-            {
-                tempsql << "`,`";
-            }
-            else
-            {
-                tempsql << "`";
-            }
-            tempsql << colnames[j];
-        }
-        if (j > 0)
-        {
-            tempsql << "`";
-        }
-        tempsql << ") VALUES (";
-
-        if (data.id == 0)
-        {
-            tempsql << "null";
-        }
-        else
-        {
-            tempsql << std::to_string(data.id);
-        }
-        if (data.randomnumber == 0)
-        {
-            tempsql << ",0";
-        }
-        else
-        {
-            tempsql << "," << std::to_string(data.randomnumber);
-        }
-        tempsql << ")";
-
-        return tempsql.str();
-    }
-
-    std::string _makerecordinsertsql(meta &insert_data)
-    {
-        unsigned int j = 0;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
+
+        if(data.id==0){
+tempsql<<"null";
+ }else{ 
+	tempsql<<std::to_string(data.id);
+}
+if(data.randomnumber==0){
+	tempsql<<",0";
+ }else{ 
+	tempsql<<","<<std::to_string(data.randomnumber);
+}
+tempsql<<")";
+
+     
+       return tempsql.str();
+   } 
+      
+      std::string _makerecordinsertsql(const meta &insert_data){
+        unsigned int j=0;
         std::ostringstream tempsql;
-        tempsql << "INSERT INTO ";
-        tempsql << tablename;
-        tempsql << " (";
-        for (; j < colnames.size(); j++)
-        {
-            if (j > 0)
-            {
-                tempsql << "`,`";
-            }
-            else
-            {
-                tempsql << "`";
-            }
-            tempsql << colnames[j];
-        }
-        if (j > 0)
-        {
-            tempsql << "`";
-        }
-        tempsql << ") VALUES (";
-
-        if (insert_data.id == 0)
-        {
-            tempsql << "null";
-        }
-        else
-        {
-            tempsql << std::to_string(insert_data.id);
-        }
-        if (insert_data.randomnumber == 0)
-        {
-            tempsql << ",0";
-        }
-        else
-        {
-            tempsql << "," << std::to_string(insert_data.randomnumber);
-        }
-        tempsql << ")";
-
-        return tempsql.str();
-    }
-
-    std::string _makerecordinsertsql(std::vector<meta> &insert_data)
-    {
-        unsigned int j = 0;
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
+        }
+        if(j>0){
+            tempsql<<"`";
+        }
+        tempsql<<") VALUES (";
+
+        if(insert_data.id==0){
+tempsql<<"null";
+ }else{ 
+	tempsql<<std::to_string(insert_data.id);
+}
+if(insert_data.randomnumber==0){
+	tempsql<<",0";
+ }else{ 
+	tempsql<<","<<std::to_string(insert_data.randomnumber);
+}
+tempsql<<")";
+
+     
+       return tempsql.str();
+   } 
+       
+    std::string _makerecordinsertsql(const std::vector<meta> &insert_data){
+        unsigned int j=0;
         std::ostringstream tempsql;
-        tempsql << "INSERT INTO ";
-        tempsql << tablename;
-        tempsql << " (";
-        for (; j < colnames.size(); j++)
-        {
-            if (j > 0)
-            {
-                tempsql << "`,`";
-            }
-            else
-            {
-                tempsql << "`";
-            }
-            tempsql << colnames[j];
+        tempsql<<"INSERT INTO ";
+        tempsql<<tablename;
+        tempsql<<" (";
+        for(;j<col_names.size();j++){
+                if(j>0){
+                    tempsql<<"`,`";
+                }else{
+                    tempsql<<"`";
+                }
+                tempsql<<col_names[j];
         }
-        if (j > 0)
-        {
-            tempsql << "`";
+        if(j>0){
+            tempsql<<"`";
         }
-        tempsql << ") VALUES ";
+        tempsql<<") VALUES ";
 
-        for (unsigned int i = 0; i < insert_data.size(); i++)
+        for(unsigned int i=0;i<insert_data.size();i++)
         {
-            if (i > 0)
+            if(i>0)
             {
-                tempsql << ",";
+                tempsql<<",";	
             }
-            tempsql << "(";
+            tempsql<<"(";
 
-            if (insert_data[i].id == 0)
-            {
-                tempsql << "null";
-            }
-            else
-            {
-                tempsql << std::to_string(insert_data[i].id);
-            }
-            if (insert_data[i].randomnumber == 0)
-            {
-                tempsql << ",0";
-            }
-            else
-            {
-                tempsql << "," << std::to_string(insert_data[i].randomnumber);
-            }
-            tempsql << ")";
-        }
 
-        return tempsql.str();
-    }
+            	if(insert_data[i].id==0){
+	tempsql<<"null";
+	 }else{ 
+	tempsql<<std::to_string(insert_data[i].id);
+	}
+	if(insert_data[i].randomnumber==0){
+	tempsql<<",0";
+	 }else{ 
+	tempsql<<","<<std::to_string(insert_data[i].randomnumber);
+	}
+		tempsql<<")";
+	 } 
 
-    std::string _makeupdatesql(const std::string &fileld)
-    {
-        //int j=0;
+     
+       return tempsql.str();
+   } 
+       
+    std::string _makeupdatesql(const std::string &fileld){
         std::ostringstream tempsql;
-        tempsql << "UPDATE ";
-        tempsql << tablename;
-        tempsql << " SET ";
-
-        bool isall = false;
-        if (fileld.empty())
-        {
-            isall = true;
-        }
-        if (isall)
-        {
-
-            if (data.id == 0)
-            {
-                tempsql << "`id`=0";
-            }
-            else
-            {
-                tempsql << "`id`=" << std::to_string(data.id);
-            }
-            if (data.randomnumber == 0)
-            {
-                tempsql << ",`randomnumber`=0";
-            }
-            else
-            {
-                tempsql << ",`randomnumber`=" << std::to_string(data.randomnumber);
-            }
-        }
-        else
-        {
-
-            unsigned int jj = 0;
-            std::string keyname;
-            std::vector<unsigned char> keypos;
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    unsigned char bpos_i = findcolpos(keyname);
-                    keypos.emplace_back(bpos_i);
+        tempsql<<"UPDATE ";
+        tempsql<<tablename;
+        tempsql<<" SET ";
+
+        bool isall=false;
+        if(fileld.empty()){
+            isall=true;
+        }
+        if(isall){
+
+        if(data.id==0){
+	tempsql<<"`id`=0";
+ }else{ 
+	tempsql<<"`id`="<<std::to_string(data.id);
+}
+if(data.randomnumber==0){
+	tempsql<<",`randomnumber`=0";
+ }else{ 
+	tempsql<<",`randomnumber`="<<std::to_string(data.randomnumber);
+}
+ }else{ 
+
+     
+  unsigned int jj=0;
+                  std::string keyname;
+                  std::vector<unsigned char> keypos;
+                  for(;jj<fileld.size();jj++){
+                        if(fileld[jj]==','){
+                                unsigned char bpos_i=findcolpos(keyname);
+                               keypos.emplace_back(bpos_i); 
 #ifdef DEBUG
-                    if (bpos_i == 254)
+                    if (bpos_i == 255)
                     {
                         std::cout << "\033[1m\033[31m-----------\n"
                                   << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
                                   << std::endl;
                     }
-#endif
-                    keyname.clear();
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
+#endif                               
+                               keyname.clear();
+                             continue;   
+                        }
+                        if(fileld[jj]==0x20){
 
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                unsigned char bpos_i = findcolpos(keyname);
-#ifdef DEBUG
-                if (bpos_i == 254)
-                {
-                    std::cout << "\033[1m\033[31m-----------\n"
-                              << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
-                              << std::endl;
-                }
-#endif
-                keypos.emplace_back(bpos_i);
-                keyname.clear();
-            }
-            for (jj = 0; jj < keypos.size(); jj++)
-            {
-                switch (keypos[jj])
-                {
+                             continue;   
+                        }
+                        keyname.push_back(fileld[jj]);
 
-                case 0:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (data.id == 0)
-                    {
-                        tempsql << "`id`=0";
-                    }
-                    else
-                    {
-                        tempsql << "`id`=" << std::to_string(data.id);
-                    }
-                    break;
-                case 1:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (data.randomnumber == 0)
-                    {
-                        tempsql << "`randomnumber`=0";
-                    }
-                    else
+                  }  
+                 if(keyname.size()>0){
+                                unsigned char bpos_i=findcolpos(keyname);
+ #ifdef DEBUG
+                    if (bpos_i == 255)
                     {
-                        tempsql << "`randomnumber`=" << std::to_string(data.randomnumber);
+                        std::cout << "\033[1m\033[31m-----------\n"
+                                  << keyname << " not in " << tablename << " table Field.\n-----------\033[0m"
+                                  << std::endl;
                     }
-                    break;
-
-                default:;
-                }
-            }
-        }
+#endif                                       
+                                keypos.emplace_back(bpos_i); 
+                                keyname.clear();
+                 }
+                 for(jj=0;jj<keypos.size();jj++){
+                       switch(keypos[jj]){
+
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(data.id==0){
+	tempsql<<"`id`=0";
+ }else{ 
+	tempsql<<"`id`="<<std::to_string(data.id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+if(data.randomnumber==0){
+	tempsql<<"`randomnumber`=0";
+ }else{ 
+	tempsql<<"`randomnumber`="<<std::to_string(data.randomnumber);
+}
+ break;
+
+     
+                  default:
+                                ;
+                     }
+                 }   
+
+            }        
 
         return tempsql.str();
-    }
-
+   } 
+   
     std::string _make_replace_into_sql()
     {
         unsigned int j = 0;
@@ -452,7 +335,7 @@ struct worldbase
         tempsql << "REPLACE INTO ";
         tempsql << tablename;
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
             if (j > 0)
             {
@@ -462,7 +345,7 @@ struct worldbase
             {
                 tempsql << "`";
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         if (j > 0)
         {
@@ -477,26 +360,21 @@ struct worldbase
                 tempsql << ",\n";
             }
             tempsql << "(";
-            if (record[i].id == 0)
-            {
-                tempsql << "null";
-            }
-            else
-            {
-                tempsql << std::to_string(record[i].id);
-            }
-            if (record[i].randomnumber == 0)
-            {
-                tempsql << ",0";
-            }
-            else
-            {
-                tempsql << "," << std::to_string(record[i].randomnumber);
-            }
-            tempsql << ")";
-        }
-        return tempsql.str();
-    }
+            	if(record[i].id==0){
+	tempsql<<"null";
+	 }else{ 
+	tempsql<<std::to_string(record[i].id);
+	}
+	if(record[i].randomnumber==0){
+	tempsql<<",0";
+	 }else{ 
+	tempsql<<","<<std::to_string(record[i].randomnumber);
+	}
+	tempsql<<")";
+
+ }
+ return tempsql.str();
+}
 
     std::string _make_insert_into_sql(const std::string &fileld)
     {
@@ -505,7 +383,7 @@ struct worldbase
         tempsql << "INSERT INTO ";
         tempsql << tablename;
         tempsql << " (";
-        for (; j < colnames.size(); j++)
+        for (; j < col_names.size(); j++)
         {
             if (j > 0)
             {
@@ -515,7 +393,7 @@ struct worldbase
             {
                 tempsql << "`";
             }
-            tempsql << colnames[j];
+            tempsql << col_names[j];
         }
         if (j > 0)
         {
@@ -530,2131 +408,2041 @@ struct worldbase
                 tempsql << ",\n";
             }
             tempsql << "(";
-            if (record[i].id == 0)
-            {
-                tempsql << "null";
+            	if(record[i].id==0){
+	tempsql<<"null";
+	 }else{ 
+	tempsql<<std::to_string(record[i].id);
+	}
+	if(record[i].randomnumber==0){
+	tempsql<<",0";
+	 }else{ 
+	tempsql<<","<<std::to_string(record[i].randomnumber);
+	}
+	tempsql<<")";
+	 }
+	 tempsql<<" as new ON DUPLICATE KEY UPDATE ";
+
+     
+        std::string keyname;
+        unsigned char jj=0;
+        j=0;
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                if(findcolpos(keyname)<255)
+                {
+                    if(j>0)
+                    {
+                        tempsql<<",";
+                    }
+                    tempsql<<keyname;
+                    tempsql<<"=new.";
+                    tempsql<<keyname;
+                }
+                continue;   
             }
-            else
-            {
-                tempsql << std::to_string(record[i].id);
+            if(fileld[jj]==0x20){
+                continue;   
             }
-            if (record[i].randomnumber == 0)
+            keyname.push_back(fileld[jj]);
+
+        }  
+        if(keyname.size()>0){
+            if(findcolpos(keyname)<255)
             {
-                tempsql << ",0";
-            }
-            else
-            {
-                tempsql << "," << std::to_string(record[i].randomnumber);
-            }
-            tempsql << ")";
-        }
-        tempsql << " as new ON DUPLICATE KEY UPDATE ";
-
-        std::string keyname;
-        unsigned char jj = 0;
-        j                = 0;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    if (findcolpos(keyname) < 255)
-                    {
-                        if (j > 0)
-                        {
-                            tempsql << ",";
-                        }
-                        tempsql << keyname;
-                        tempsql << "=new.";
-                        tempsql << keyname;
-                    }
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
-
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                if (findcolpos(keyname) < 255)
-                {
-                    if (j > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    tempsql << keyname;
-                    tempsql << "=new.";
-                    tempsql << keyname;
-                }
+                if(j>0)
+                {
+                    tempsql<<",";
+                }
+                tempsql<<keyname;
+                tempsql<<"=new.";
+                tempsql<<keyname;
+                
             }
         }
 
-        return tempsql.str();
-    }
+    } 
+ 
+ return tempsql.str();
+}
 
-    std::vector<std::string> data_toarray(std::string fileld = "")
-    {
+   std::vector<std::string> data_toarray(std::string fileld=""){
         std::vector<std::string> temparray;
         std::string keyname;
-        unsigned char jj = 0;
+        unsigned char jj=0;
         std::vector<unsigned char> keypos;
-        if (fileld.size() > 1)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
+        if(fileld.size()>1){
+            for(;jj<fileld.size();jj++){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
                     keyname.clear();
-                    continue;
+                    continue;   
                 }
-                if (fileld[jj] == 0x20)
-                {
+                if(fileld[jj]==0x20){
 
-                    continue;
+                    continue;   
                 }
                 keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
-                keyname.clear();
-            }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-
-        for (jj = 0; jj < keypos.size(); jj++)
-        {
-            switch (keypos[jj])
-            {
-            case 0:
-                if (data.id == 0)
-                {
-                    temparray.push_back("0");
-                }
-                else
-                {
-                    temparray.push_back(std::to_string(data.id));
-                }
-                break;
-            case 1:
-                if (data.randomnumber == 0)
-                {
-                    temparray.push_back("0");
-                }
-                else
-                {
-                    temparray.push_back(std::to_string(data.randomnumber));
-                }
-                break;
 
-            default:;
+            }  
+            if(keyname.size()>0){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
             }
-        }
-
-        return temparray;
-    }
-
-    std::map<std::string, std::string> data_tomap(std::string fileld = "")
-    {
-        std::map<std::string, std::string> tempsql;
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+               
+            for(jj=0;jj<keypos.size();jj++){
+                switch(keypos[jj]){
+         case 0:
+if(data.id==0){
+	temparray.push_back("0");
+ }else{ 
+	temparray.push_back(std::to_string(data.id));
+}
+ break;
+ case 1:
+if(data.randomnumber==0){
+	temparray.push_back("0");
+ }else{ 
+	temparray.push_back(std::to_string(data.randomnumber));
+}
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+   
+     return temparray;             
+   }   
+   
+   std::map<std::string,std::string> data_tomap(std::string fileld=""){
+       std::map<std::string,std::string> tempsql;
         std::string keyname;
-        unsigned char jj = 0;
+        unsigned char jj=0;
         std::vector<unsigned char> keypos;
-        if (fileld.size() > 1)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
-                    keyname.clear();
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
-
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
+        if(fileld.size()>1){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
                 keyname.clear();
+                continue;   
             }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-
-        for (jj = 0; jj < keypos.size(); jj++)
-        {
-            switch (keypos[jj])
-            {
-            case 0:
-                if (data.id == 0)
-                {
-                    tempsql.insert({"id", "0"});
-                }
-                else
-                {
-                    tempsql.insert({"id", std::to_string(data.id)});
-                }
-                break;
-            case 1:
-                if (data.randomnumber == 0)
-                {
-                    tempsql.insert({"randomnumber", "0"});
-                }
-                else
-                {
-                    tempsql.insert({"randomnumber", std::to_string(data.randomnumber)});
-                }
-                break;
+            if(fileld[jj]==0x20){
 
-            default:;
+                continue;   
             }
-        }
-
-        return tempsql;
-    }
-
-    std::string data_tojson()
-    {
-        std::ostringstream tempsql;
+            keyname.push_back(fileld[jj]);
 
-        tempsql << "{";
-        if (data.id == 0)
-        {
-            tempsql << "\"id\":0";
-        }
-        else
-        {
-            tempsql << "\"id\":" << std::to_string(data.id);
-        }
-        if (data.randomnumber == 0)
-        {
-            tempsql << ",\"randomnumber\":0";
-        }
-        else
-        {
-            tempsql << ",\"randomnumber\":" << std::to_string(data.randomnumber);
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
         }
-        tempsql << "}";
-
-        return tempsql.str();
-    }
-
-    std::string data_tojson(std::string fileld)
-    {
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
+         case 0:
+if(data.id==0){
+	tempsql.insert({"id","0"});
+ }else{ 
+	tempsql.insert({"id",std::to_string(data.id)});
+}
+ break;
+ case 1:
+if(data.randomnumber==0){
+	tempsql.insert({"randomnumber","0"});
+ }else{ 
+	tempsql.insert({"randomnumber",std::to_string(data.randomnumber)});
+}
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+    
+     return tempsql;             
+   }   
+   
+   std::string data_tojson(){
+       std::ostringstream tempsql;
+
+        tempsql<<"{";
+if(data.id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(data.id);
+}
+if(data.randomnumber==0){
+	tempsql<<",\"randomnumber\":0";
+ }else{ 
+	tempsql<<",\"randomnumber\":"<<std::to_string(data.randomnumber);
+}
+tempsql<<"}";
+
+     
+     return tempsql.str();             
+   }   
+   
+   std::string data_tojson(std::string fileld){
         std::ostringstream tempsql;
         std::string keyname;
-        unsigned char jj = 0;
+        unsigned char jj=0;
         std::vector<unsigned char> keypos;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
-                    keyname.clear();
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
-                {
-
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
+        if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
                 keyname.clear();
+                continue;   
             }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-        tempsql << "{";
-        for (jj = 0; jj < keypos.size(); jj++)
-        {
-            switch (keypos[jj])
-            {
-            case 0:
-                if (jj > 0)
-                {
-                    tempsql << ",";
-                }
-                if (data.id == 0)
-                {
-                    tempsql << "\"id\":0";
-                }
-                else
-                {
-                    tempsql << "\"id\":" << std::to_string(data.id);
-                }
-                break;
-            case 1:
-                if (jj > 0)
-                {
-                    tempsql << ",";
-                }
-                if (data.randomnumber == 0)
-                {
-                    tempsql << "\"randomnumber\":0";
-                }
-                else
-                {
-                    tempsql << "\"randomnumber\":" << std::to_string(data.randomnumber);
-                }
-                break;
+            if(fileld[jj]==0x20){
 
-            default:;
+                continue;   
             }
-        }
-        tempsql << "}";
-        return tempsql.str();
-    }
+            keyname.push_back(fileld[jj]);
 
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
+        }
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
+            }
+        }
+        tempsql<<"{";
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(data.id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(data.id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+if(data.randomnumber==0){
+	tempsql<<"\"randomnumber\":0";
+ }else{ 
+	tempsql<<"\"randomnumber\":"<<std::to_string(data.randomnumber);
+}
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+      tempsql<<"}";  
+     return tempsql.str();             
+   }   
+   
     void from_json(const std::string &json_content)
-    {
+   {
         record.clear();
-        worldbase::meta metatemp;
-        data                     = metatemp;
-        unsigned int json_offset = 0;
-        bool isarray             = false;
+        worldbase::meta metatemp; 
+        data=metatemp;
+        unsigned int json_offset=0;
+        bool isarray=false;
         //std::vector<std::string> list_content;
-        for (; json_offset < json_content.size(); json_offset++)
+        for(;json_offset<json_content.size();json_offset++)
         {
-            if (json_content[json_offset] == '{')
+            if(json_content[json_offset]=='{')
             {
                 break;
             }
-            if (json_content[json_offset] == '[')
+            if(json_content[json_offset]=='[')
             {
-                isarray = true;
+                isarray=true;
                 break;
             }
         }
-        if (isarray)
+        if(isarray)
         {
-            json_offset += 1;
-            std::string json_key_name, json_value_name;
-            for (; json_offset < json_content.size(); json_offset++)
+            json_offset+=1; 
+            std::string json_key_name,json_value_name; 
+            for(;json_offset<json_content.size();json_offset++)
             {
-                for (; json_offset < json_content.size(); json_offset++)
+                for(;json_offset<json_content.size();json_offset++)
                 {
-                    if (json_content[json_offset] == '{')
+                    if(json_content[json_offset]=='{')
                     {
-                        json_offset += 1;
+                        json_offset+=1;
                         break;
                     }
                 }
-                if (record.size() > 0)
+                if(record.size()>0)
                 {
-                    data = metatemp;
+                    data=metatemp;
                 }
-                if (json_offset >= json_content.size())
+                if(json_offset>=json_content.size())
                 {
                     break;
                 }
-                for (; json_offset < json_content.size(); json_offset++)
+                for(;json_offset<json_content.size();json_offset++)
                 {
-
-                    if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                    {
-                        continue;
-                    }
-                    else
-                    {
-                        if (json_content[json_offset] == 0x22)
-                        {
-                            unsigned int temp_offset = json_offset;
-                            json_key_name            = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                            json_offset              = temp_offset;
-                            if (json_content[json_offset] == 0x22)
-                            {
-                                json_offset += 1;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
-                            {
-
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                                {
-                                    continue;
-                                }
-                                break;
-                            }
-                            if (json_content[json_offset] != ':')
-                            {
-                                break;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
-                            {
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                                {
-                                    continue;
-                                }
-                                break;
-                            }
-                            json_offset += 1;
-                            if (json_offset >= json_content.size())
-                            {
-                                break;
-                            }
-                            json_value_name.clear();
-                            if (json_content[json_offset] == 0x22)
+    
+                            if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
                             {
-
-                                temp_offset     = json_offset;
-                                json_value_name = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                                json_offset     = temp_offset;
-                                if (json_content[json_offset] == 0x22)
-                                {
-                                    json_offset += 1;
-                                }
+                                continue;
                             }
                             else
                             {
-                                if (json_content[json_offset] != '{' && json_content[json_offset] != ']')
+                                if(json_content[json_offset]==0x22)
                                 {
-                                    for (; json_offset < json_content.size(); json_offset++)
+                                    unsigned int temp_offset=json_offset;
+                                    json_key_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                    json_offset=temp_offset;
+                                    if(json_content[json_offset]==0x22)
+                                    {
+                                        json_offset+=1;
+                                    }
+                                    for(;json_offset<json_content.size();json_offset++)
+                                    {
+                                    
+                                        if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                        {
+                                            continue;
+                                        }
+                                        break;
+                                    }       
+                                    if(json_content[json_offset]!=':')
+                                    {
+                                        break;
+                                    }
+                                    for(;json_offset<json_content.size();json_offset++)
+                                    {
+                                        if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                        {
+                                            continue;
+                                        }
+                                        break;
+                                    } 
+                                    json_offset+=1;
+                                    if(json_offset>=json_content.size())
+                                    {
+                                        break;
+                                    }
+                                    json_value_name.clear();
+                                    if(json_content[json_offset]==0x22)
+                                    {
+                                        
+                                        temp_offset=json_offset;
+                                        json_value_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                        json_offset=temp_offset;
+                                        if(json_content[json_offset]==0x22)
+                                        {
+                                            json_offset+=1;
+                                        }
+                                    }
+                                    else
                                     {
-                                        if (json_content[json_offset] == 0x5D || json_content[json_offset] == 0x7D || json_content[json_offset] == 0x22 || json_content[json_offset] == 0x2C || json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                        if(json_content[json_offset]!='{'&&json_content[json_offset]!=']')
                                         {
-                                            if (json_content[json_offset] == 0x7D)
+                                            for(;json_offset<json_content.size();json_offset++)
                                             {
-                                                json_offset -= 1;
-                                            }
-                                            break;
+                                                if(json_content[json_offset]==0x5D||json_content[json_offset]==0x7D||json_content[json_offset]==0x22||json_content[json_offset]==0x2C||json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                                {
+                                                    if(json_content[json_offset]==0x7D)
+                                                    {
+                                                        json_offset-=1;
+                                                    } 
+                                                    break;
+                                                }
+                                                json_value_name.push_back(json_content[json_offset]);
+                                            }   
                                         }
-                                        json_value_name.push_back(json_content[json_offset]);
                                     }
+                                    //////////////////////////
+                                    set_val(json_key_name,json_value_name);
+                                    continue;
+                                }
+                                else
+                                {
+                                    break;
                                 }
                             }
-                            //////////////////////////
-                            set_val(json_key_name, json_value_name);
-                            continue;
-                        }
-                        else
-                        {
-                            break;
-                        }
-                    }
+    
                 }
                 record.emplace_back(data);
-
-                json_offset += 1;
+                
+                json_offset+=1;
             }
-            if (record.size() > 1)
+            if(record.size()>1)
             {
-                data = record[0];
+                data=record[0];
             }
         }
         else
         {
-            if (json_content[json_offset] == '{')
+           if(json_content[json_offset]=='{')
             {
-                json_offset += 1;
-                std::string json_key_name, json_value_name;
-
-                for (; json_offset < json_content.size(); json_offset++)
+                json_offset+=1; 
+                std::string json_key_name,json_value_name; 
+                 
+                
+                for(;json_offset<json_content.size();json_offset++)
                 {
-
-                    if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
-                    {
-                        continue;
-                    }
-                    else
-                    {
-                        if (json_content[json_offset] == 0x22)
+ 
+                        if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
                         {
-                            unsigned int temp_offset = json_offset;
-                            json_key_name            = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                            json_offset              = temp_offset;
-                            if (json_content[json_offset] == 0x22)
-                            {
-                                json_offset += 1;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
+                            continue;
+                        }
+                        else
+                        {
+                            if(json_content[json_offset]==0x22)
                             {
-
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                 unsigned int temp_offset=json_offset;
+                                 json_key_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                 json_offset=temp_offset;
+                                 if(json_content[json_offset]==0x22)
+                                 {
+                                    json_offset+=1;
+                                 }
+                                for(;json_offset<json_content.size();json_offset++)
                                 {
-                                    continue;
+                                
+                                    if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                    {
+                                        continue;
+                                    }
+                                    break;
+                                }       
+                                if(json_content[json_offset]!=':')
+                                {
+                                    break;
                                 }
-                                break;
-                            }
-                            if (json_content[json_offset] != ':')
-                            {
-                                break;
-                            }
-                            for (; json_offset < json_content.size(); json_offset++)
-                            {
-                                if (json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                for(;json_offset<json_content.size();json_offset++)
                                 {
-                                    continue;
+                                    if(json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
+                                    {
+                                        continue;
+                                    }
+                                    break;
+                                } 
+                                json_offset+=1;
+                                if(json_offset>=json_content.size())
+                                {
+                                    break;
                                 }
-                                break;
-                            }
-                            json_offset += 1;
-                            if (json_offset >= json_content.size())
-                            {
-                                break;
-                            }
-                            json_value_name.clear();
-                            if (json_content[json_offset] == 0x22)
-                            {
-
-                                temp_offset     = json_offset;
-                                json_value_name = http::jsonstring_to_utf8(&json_content[json_offset], json_content.size() - json_offset, temp_offset);
-                                json_offset     = temp_offset;
-                                if (json_content[json_offset] == 0x22)
+                                json_value_name.clear();
+                                if(json_content[json_offset]==0x22)
                                 {
-                                    json_offset += 1;
+                                    
+                                    temp_offset=json_offset;
+                                    json_value_name=http::jsonstring_to_utf8(&json_content[json_offset],json_content.size()-json_offset,temp_offset);
+                                    json_offset=temp_offset;
+                                    if(json_content[json_offset]==0x22)
+                                    {
+                                        json_offset+=1;
+                                    }
                                 }
-                            }
-                            else
-                            {
-                                if (json_content[json_offset] != '{' && json_content[json_offset] != ']')
+                                else
                                 {
-                                    for (; json_offset < json_content.size(); json_offset++)
+                                    if(json_content[json_offset]!='{'&&json_content[json_offset]!=']')
                                     {
-                                        if (json_content[json_offset] == 0x5D || json_content[json_offset] == 0x7D || json_content[json_offset] == 0x22 || json_content[json_offset] == 0x2C || json_content[json_offset] == 0x20 || json_content[json_offset] == 0x0A || json_content[json_offset] == 0x0D || json_content[json_offset] == '\t')
+                                        for(;json_offset<json_content.size();json_offset++)
                                         {
-                                            if (json_content[json_offset] == 0x7D)
+                                            if(json_content[json_offset]==0x5D||json_content[json_offset]==0x7D||json_content[json_offset]==0x22||json_content[json_offset]==0x2C||json_content[json_offset]==0x20||json_content[json_offset]==0x0A||json_content[json_offset]==0x0D||json_content[json_offset]=='\t')
                                             {
-                                                json_offset -= 1;
+                                               if(json_content[json_offset]==0x7D)
+                                               {
+                                                   json_offset-=1;
+                                               } 
+                                               break;
                                             }
-                                            break;
-                                        }
-                                        json_value_name.push_back(json_content[json_offset]);
+                                            json_value_name.push_back(json_content[json_offset]);
+                                        }   
                                     }
                                 }
+                                //////////////////////////
+                                set_val(json_key_name,json_value_name);
+                                continue;
+                            }
+                            else
+                            {
+                                break;
                             }
-                            //////////////////////////
-                            set_val(json_key_name, json_value_name);
-                            continue;
-                        }
-                        else
-                        {
-                            break;
                         }
-                    }
+ 
                 }
                 record.emplace_back(data);
+            } 
+        }
+   }   
+    
+    void set_val(const std::string& set_key_name,const std::string& set_value_name)
+    {
+        switch(findcolpos(set_key_name))
+        {
+    		case 0:
+		 try{
+			data.id=std::stoul(set_value_name);
+		}catch (...) { 
+			data.id=0;
+			 }
+			break;
+		case 1:
+		 try{
+			data.randomnumber=std::stoi(set_value_name);
+		}catch (...) { 
+			data.randomnumber=0;
+			 }
+			break;
+	default:
+		 { }
+			
+
+
+        }
+   } 
+    
+    void set_val(const std::string& set_key_name,const long long set_value_name)
+    {
+        switch(findcolpos(set_key_name))
+        {
+    		case 0:
+		 try{
+			data.id=set_value_name;
+		}catch (...) { 
+			data.id=0;
+			 }
+			break;
+		case 1:
+		 try{
+			data.randomnumber=set_value_name;
+		}catch (...) { 
+			data.randomnumber=0;
+			 }
+			break;
+	default:
+		 { }
+			
+
+
+        }
+   } 
+    
+    void set_val(const std::string& set_key_name,const double set_value_name)
+    {
+        switch(findcolpos(set_key_name))
+        {
+    		case 0:
+		 try{
+			data.id=(unsigned int)set_value_name;
+		}catch (...) { 
+			data.id=0;
+			 }
+			break;
+		case 1:
+		 try{
+			data.randomnumber=(int)set_value_name;
+		}catch (...) { 
+			data.randomnumber=0;
+			 }
+			break;
+	default:
+		 { }
+			
+
+
+        }
+   } 
+    
+   std::string to_json(std::string fileld=""){
+    std::ostringstream tempsql;
+    std::string keyname;
+    unsigned char jj=0;
+    std::vector<unsigned char> keypos;
+    if(fileld.size()>0){
+        for(;jj<fileld.size();jj++){
+            if(fileld[jj]==','){
+                keypos.emplace_back(findcolpos(keyname)); 
+                keyname.clear();
+                continue;   
             }
-        }
-    }
-
-    void set_val(const std::string &set_key_name, const std::string &set_value_name)
-    {
-        switch (findcolpos(set_key_name))
-        {
-        case 0:
-            try
-            {
-                data.id = std::stoul(set_value_name);
-            }
-            catch (...)
-            {
-                data.id = 0;
-            }
-            break;
-        case 1:
-            try
-            {
-                data.randomnumber = std::stoi(set_value_name);
-            }
-            catch (...)
-            {
-                data.randomnumber = 0;
-            }
-            break;
-        default:
-        {
-        }
-        }
-    }
+            if(fileld[jj]==0x20){
 
-    void set_val(const std::string &set_key_name, const long long set_value_name)
-    {
-        switch (findcolpos(set_key_name))
-        {
-        case 0:
-            try
-            {
-                data.id = set_value_name;
-            }
-            catch (...)
-            {
-                data.id = 0;
-            }
-            break;
-        case 1:
-            try
-            {
-                data.randomnumber = set_value_name;
-            }
-            catch (...)
-            {
-                data.randomnumber = 0;
+                continue;   
             }
-            break;
-        default:
-        {
-        }
-        }
-    }
+            keyname.push_back(fileld[jj]);
 
-    void set_val(const std::string &set_key_name, const double set_value_name)
-    {
-        switch (findcolpos(set_key_name))
-        {
-        case 0:
-            try
-            {
-                data.id = (unsigned int)set_value_name;
-            }
-            catch (...)
-            {
-                data.id = 0;
-            }
-            break;
-        case 1:
-            try
-            {
-                data.randomnumber = (int)set_value_name;
-            }
-            catch (...)
-            {
-                data.randomnumber = 0;
-            }
-            break;
-        default:
-        {
-        }
+        }  
+        if(keyname.size()>0){
+            keypos.emplace_back(findcolpos(keyname)); 
+            keyname.clear();
         }
-    }
-
-    std::string to_json(std::string fileld = "")
-    {
-        std::ostringstream tempsql;
+    }else{
+        for(jj=0;jj<col_names.size();jj++){
+            keypos.emplace_back(jj); 
+        }
+    }
+    tempsql<<"[";
+    for(size_t n=0;n<record.size();n++){
+        if(n>0){
+            tempsql<<",{";
+        }else{
+            tempsql<<"{";
+        }  
+    
+        for(jj=0;jj<keypos.size();jj++){
+            switch(keypos[jj]){
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(record[n].id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(record[n].id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+if(record[n].randomnumber==0){
+	tempsql<<"\"randomnumber\":0";
+ }else{ 
+	tempsql<<"\"randomnumber\":"<<std::to_string(record[n].randomnumber);
+}
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+      tempsql<<"}";  
+            }
+      tempsql<<"]";
+     return tempsql.str();             
+   }   
+   
+   std::string to_json(std::function<bool(std::string&,meta&)> func,std::string fileld=""){
+       std::ostringstream tempsql;
         std::string keyname;
-        unsigned char jj = 0;
+        unsigned char jj=0;
         std::vector<unsigned char> keypos;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
+        if(fileld.size()>0){
+            for(;jj<fileld.size();jj++){
+                if(fileld[jj]==','){
+                    keypos.emplace_back(findcolpos(keyname)); 
                     keyname.clear();
-                    continue;
+                    continue;   
                 }
-                if (fileld[jj] == 0x20)
-                {
+                if(fileld[jj]==0x20){
 
-                    continue;
+                    continue;   
                 }
                 keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
+
+            }  
+            if(keyname.size()>0){
+                keypos.emplace_back(findcolpos(keyname)); 
                 keyname.clear();
             }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
+        }else{
+            for(jj=0;jj<col_names.size();jj++){
+                keypos.emplace_back(jj); 
             }
         }
-        tempsql << "[";
-        for (size_t n = 0; n < record.size(); n++)
-        {
-            if (n > 0)
-            {
-                tempsql << ",{";
-            }
-            else
-            {
-                tempsql << "{";
-            }
-
-            for (jj = 0; jj < keypos.size(); jj++)
-            {
-                switch (keypos[jj])
+        tempsql<<"[";
+        for(size_t n=0;n<record.size();n++){
+            keyname.clear();
+            if(func(keyname,record[n])){ 
+                if(n>0){
+                    tempsql<<",{";
+                }else{
+                    tempsql<<"{";
+                } 
+                tempsql<<keyname;
+            }else{
+            continue;
+            } 
+        
+        for(jj=0;jj<keypos.size();jj++){
+            
+            switch(keypos[jj]){
+         case 0:
+ if(jj>0){ tempsql<<","; } 
+if(record[n].id==0){
+	tempsql<<"\"id\":0";
+ }else{ 
+	tempsql<<"\"id\":"<<std::to_string(record[n].id);
+}
+ break;
+ case 1:
+ if(jj>0){ tempsql<<","; } 
+if(record[n].randomnumber==0){
+	tempsql<<"\"randomnumber\":0";
+ }else{ 
+	tempsql<<"\"randomnumber\":"<<std::to_string(record[n].randomnumber);
+}
+ break;
+
+                             default:
+                                ;
+                     }
+                 }   
+      tempsql<<"}";  
+            }
+      tempsql<<"]";
+     return tempsql.str();             
+   }   
+   long long getPK(){  return data.id; } 
+ void setPK(long long val){  data.id=val;} 
+ unsigned  int  getId(){  return data.id; } 
+ void setId( unsigned  int  val){  data.id=val;} 
+
+ int  getRandomnumber(){  return data.randomnumber; } 
+ void setRandomnumber( int  val){  data.randomnumber=val;} 
+
+worldbase::meta getnewData(){
+ 	 struct meta newdata;
+	 return newdata; 
+} 
+worldbase::meta getData(){
+ 	 return data; 
+} 
+std::vector<worldbase::meta> getRecord(){
+ 	 return record; 
+} 
+
+
+    template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true>
+    T& ref_meta([[maybe_unused]] std::string key_name)
+    {
+   		return nullptr; 
+	}
+
+
+    template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true>
+    T& ref_meta([[maybe_unused]] std::string key_name)
+    {
+   		 if(key_name=="id")
+		{
+			return data.id;
+		}
+		 if(key_name=="randomnumber")
+		{
+			return data.randomnumber;
+		}
+		return nullptr; 
+	}
+
+
+    template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true >
+    T& ref_meta([[maybe_unused]] std::string key_name)
+    {
+   		return nullptr; 
+	}
+
+            template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >  
+            std::vector<T> getCol([[maybe_unused]] std::string keyname)
+            {
+                std::vector<T> a;
+                
+   
+                unsigned char kpos;
+                kpos=findcolpos(keyname);               
+                for(auto &iter:record)
                 {
-                case 0:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (record[n].id == 0)
-                    {
-                        tempsql << "\"id\":0";
-                    }
-                    else
-                    {
-                        tempsql << "\"id\":" << std::to_string(record[n].id);
-                    }
-                    break;
-                case 1:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (record[n].randomnumber == 0)
+                    switch(kpos)
                     {
-                        tempsql << "\"randomnumber\":0";
+   			case 0: 
+ 				 a.emplace_back(iter.id);
+				 break;
+			case 1: 
+ 				 a.emplace_back(iter.randomnumber);
+				 break;
+
                     }
-                    else
+                }
+    
+                return a;
+            }
+    
+            template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true >    
+			std::vector<T> getCol([[maybe_unused]] std::string keyname)
+			{
+				std::vector<T> a;
+				
+
+                return a;
+            }
+    
+            template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >   
+            T getVal([[maybe_unused]] std::string keyname)
+            {
+   
+                    unsigned char kpos;
+                    kpos=findcolpos(keyname);                   
+                    switch(kpos)
                     {
-                        tempsql << "\"randomnumber\":" << std::to_string(record[n].randomnumber);
-                    }
-                    break;
 
-                default:;
-                }
-            }
-            tempsql << "}";
-        }
-        tempsql << "]";
-        return tempsql.str();
-    }
+   			case 0: 
+ 				 return data.id;
+				 break;
+			case 1: 
+ 				 return data.randomnumber;
+				 break;
+			}
+                return 0;
+            }  
+    
+        template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true > 
+        T getVal([[maybe_unused]] worldbase::meta & iter,[[maybe_unused]] std::string keyname)
+        {
+
+          
+            unsigned char kpos;
+            kpos=findcolpos(keyname);   
+            switch(kpos)
+            {
+   			case 0: 
+ 				 return iter.id;
+				 break;
+			case 1: 
+ 				 return iter.randomnumber;
+				 break;
+
+			}
 
-    std::string to_json(std::function<bool(std::string &, meta &)> func, std::string fileld = "")
-    {
-        std::ostringstream tempsql;
-        std::string keyname;
-        unsigned char jj = 0;
-        std::vector<unsigned char> keypos;
-        if (fileld.size() > 0)
-        {
-            for (; jj < fileld.size(); jj++)
-            {
-                if (fileld[jj] == ',')
-                {
-                    keypos.emplace_back(findcolpos(keyname));
-                    keyname.clear();
-                    continue;
-                }
-                if (fileld[jj] == 0x20)
+            return 0;
+        }  
+    
+            template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true > 
+            T getVal(std::string keyname)
+            {
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+            
+                switch(kpos)
                 {
 
-                    continue;
-                }
-                keyname.push_back(fileld[jj]);
-            }
-            if (keyname.size() > 0)
-            {
-                keypos.emplace_back(findcolpos(keyname));
-                keyname.clear();
-            }
-        }
-        else
-        {
-            for (jj = 0; jj < colnames.size(); jj++)
-            {
-                keypos.emplace_back(jj);
-            }
-        }
-        tempsql << "[";
-        for (size_t n = 0; n < record.size(); n++)
-        {
-            keyname.clear();
-            if (func(keyname, record[n]))
-            {
-                if (n > 0)
+    
+                    }
+                   
+    
+                    return 0.0;
+            }  
+    
+            template<typename T, typename std::enable_if<std::is_floating_point_v<T>,bool>::type = true > 
+            T getVal([[maybe_unused]] worldbase::meta & iter,std::string keyname)
+            {
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+                switch(kpos)
                 {
-                    tempsql << ",{";
+   
                 }
-                else
+                 
+    
+            
+                return 0.0;
+            }  
+    
+            template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true > 
+            std::string getVal(std::string keyname)
+            {
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+        
+                switch(kpos)
                 {
-                    tempsql << "{";
-                }
-                tempsql << keyname;
-            }
-            else
-            {
-                continue;
-            }
 
-            for (jj = 0; jj < keypos.size(); jj++)
-            {
-
-                switch (keypos[jj])
+   
+                }
+                return "";
+            }  
+   
+            template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true > 
+            std::string getVal([[maybe_unused]] worldbase::meta & iter,std::string keyname)
+            {
+         
+                unsigned char kpos;
+                kpos=findcolpos(keyname);
+       
+                switch(kpos)
                 {
-                case 0:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (record[n].id == 0)
-                    {
-                        tempsql << "\"id\":0";
-                    }
-                    else
-                    {
-                        tempsql << "\"id\":" << std::to_string(record[n].id);
-                    }
-                    break;
-                case 1:
-                    if (jj > 0)
-                    {
-                        tempsql << ",";
-                    }
-                    if (record[n].randomnumber == 0)
-                    {
-                        tempsql << "\"randomnumber\":0";
-                    }
-                    else
-                    {
-                        tempsql << "\"randomnumber\":" << std::to_string(record[n].randomnumber);
-                    }
-                    break;
 
-                default:;
+   
                 }
-            }
-            tempsql << "}";
-        }
-        tempsql << "]";
-        return tempsql.str();
-    }
-    long long getPK() { return data.id; }
-    void setPK(long long val) { data.id = val; }
-    unsigned int getId() { return data.id; }
-    void setId(unsigned int val) { data.id = val; }
-
-    int getRandomnumber() { return data.randomnumber; }
-    void setRandomnumber(int val) { data.randomnumber = val; }
-
-    worldbase::meta getnewData()
-    {
-        struct meta newdata;
-        return newdata;
-    }
-    worldbase::meta getData()
-    {
-        return data;
-    }
-    std::vector<worldbase::meta> getRecord()
-    {
-        return record;
-    }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    T &ref_meta([[maybe_unused]] std::string key_name)
-    {
-        return nullptr;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    T &ref_meta([[maybe_unused]] std::string key_name)
-    {
-        if (key_name == "id")
-        {
-            return data.id;
-        }
-        if (key_name == "randomnumber")
-        {
-            return data.randomnumber;
-        }
-        return nullptr;
-    }
-
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    T &ref_meta([[maybe_unused]] std::string key_name)
-    {
-        return nullptr;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::vector<T> getCol([[maybe_unused]] std::string keyname)
-    {
-        std::vector<T> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
+                
+    
+                 
+                return "";
+            }  
+     
+            template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true >   
+            std::vector<std::string> getCol([[maybe_unused]] std::string keyname)
             {
-            case 0:
-                a.emplace_back(iter.id);
-                break;
-            case 1:
-                a.emplace_back(iter.randomnumber);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    std::vector<T> getCol([[maybe_unused]] std::string keyname)
-    {
-        std::vector<T> a;
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    T getVal([[maybe_unused]] std::string keyname)
-    {
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        switch (kpos)
-        {
-
-        case 0:
-            return data.id;
-            break;
-        case 1:
-            return data.randomnumber;
-            break;
-        }
-        return 0;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    T getVal([[maybe_unused]] worldbase::meta &iter, [[maybe_unused]] std::string keyname)
-    {
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        switch (kpos)
-        {
-        case 0:
-            return iter.id;
-            break;
-        case 1:
-            return iter.randomnumber;
-            break;
-        }
-
-        return 0;
-    }
-
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    T getVal(std::string keyname)
-    {
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-
-        switch (kpos)
-        {
-        }
-
-        return 0.0;
-    }
-
-    template <typename T, typename std::enable_if<std::is_floating_point_v<T>, bool>::type = true>
-    T getVal([[maybe_unused]] worldbase::meta &iter, std::string keyname)
-    {
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        switch (kpos)
-        {
-        }
-
-        return 0.0;
-    }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::string getVal(std::string keyname)
-    {
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-
-        switch (kpos)
-        {
-        }
-        return "";
-    }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::string getVal([[maybe_unused]] worldbase::meta &iter, std::string keyname)
-    {
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-
-        switch (kpos)
-        {
-        }
-
-        return "";
-    }
+                std::vector<std::string> a;
 
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::vector<std::string> getCol([[maybe_unused]] std::string keyname)
-    {
-        std::vector<std::string> a;
+           
 
         return a;
     }
-
-    std::string getstrCol(std::string keyname, [[maybe_unused]] bool isyinhao = false)
-    {
-        std::ostringstream a;
-
-        unsigned char kpos;
-        kpos  = findcolpos(keyname);
-        int j = 0;
-        if (isyinhao && record.size() > 0)
-        {
-            a << '"';
-        }
-        for (auto &iter : record)
+     
+        std::string getstrCol(std::string keyname,[[maybe_unused]] bool isyinhao=false)
         {
-            if (j > 0)
+            std::ostringstream a;
+    
+            unsigned char kpos;
+            kpos=findcolpos(keyname);   
+            int j=0;
+            if(isyinhao&&record.size()>0)
             {
-                if (isyinhao)
-                {
-                    a << "\",\"";
-                }
-                else
-                {
-                    a << ',';
-                }
+                a<<'"';
             }
-            switch (kpos)
+            for(auto &iter:record)
             {
+                    if(j>0)
+                    {
+                        if(isyinhao)
+                        {
+                            a<<"\",\"";
+                        }else{
+                            a<<',';    
+                        }
+                    }
+                    switch(kpos)
+                    {
 
-            case 0:
-                a << std::to_string(iter.id);
-                break;
-            case 1:
-                a << std::to_string(iter.randomnumber);
-                break;
-            }
-            j++;
-        }
-        if (isyinhao && j > 0)
-        {
-            a << '"';
-        }
-
-        return a.str();
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<std::string, std::string> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<std::string, std::string> a;
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<std::string, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<std::string, U> a;
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<T, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, U> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
+   			case 0: 
+ 				 a<<std::to_string(iter.id);
+				 break;
+			case 1: 
+ 				 a<<std::to_string(iter.randomnumber);
+				 break;
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::string> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::string> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        std::string vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<std::string, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<std::string, U> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        std::string ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, U> getCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, U> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
-            if (ktemp.size() > 0)
-            {
-                a.emplace(ktemp, vtemp);
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::map<T, meta> getmapRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<T, meta> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                a.emplace(iter.id, iter);
-                break;
-            case 1:
-                a.emplace(iter.randomnumber, iter);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::map<std::string, meta> getmapRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<std::string, meta> a;
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::vector<std::pair<std::string, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<std::string, U>> a;
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-            switch (vpos)
-            {
-            }
-
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-
-            switch (kpos)
-            {
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
-            a.emplace_back(ktemp, vtemp);
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::vector<std::pair<T, U>> getvecCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::vector<std::pair<T, U>> a;
-
-        return a;
-    }
-
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::vector<std::pair<T, meta>> getvecRows([[maybe_unused]] std::string keyname)
-    {
-        std::vector<std::pair<T, meta>> a;
-
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                a.emplace_back(iter.id, iter);
-                break;
-            case 1:
-                a.emplace_back(iter.randomnumber, iter);
-                break;
-            }
-        }
-
-        return a;
-    }
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::vector<std::pair<std::string, meta>> getvecRows([[maybe_unused]] std::string keyname)
-    {
-        std::vector<std::pair<std::string, meta>> a;
-
-        return a;
-    }
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
-
-            switch (dpos)
-            {
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        //D vtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
-
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.randomnumber);
-                break;
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
-
-            switch (dpos)
-            {
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-
-            switch (vpos)
-            {
-            }
-
-            switch (dpos)
-            {
-            }
-        }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-
-            switch (vpos)
-            {
-            }
-
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.randomnumber);
-                break;
-            }
-        }
-
-        return a;
-    }
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
-
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
-
-            switch (vpos)
-            {
-            }
-
-            switch (dpos)
-            {
-            }
-        }
+                    }
+                    j++;
+            } 
+            if(isyinhao&&j>0){
+                a<<'"';
+            }      
+    
+                return a.str();
+        }
+    
+    template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>     
+    std::map<std::string,std::string> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+    {
+        std::map<std::string,std::string> a;
+         
+            return a;
+        } 
+    
+
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::map<std::string,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::map<std::string,U> a;
+         
+            return a;
+        } 
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>       
+        std::map<T,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,U> a;
+       
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);        
+            T ktemp;
+            U vtemp;
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
+ 
+       case 0: 
+ 	 ktemp=iter.id;
+	 break;
+case 1: 
+ 	 ktemp=iter.randomnumber;
+	 break;
+	 } 
+ 		  switch(vpos){
 
+                }
+                if(ktemp.size()>0)
+                {
+                    a.emplace(ktemp,vtemp);
+                }
+            }       
+     
         return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
+    }  
+            template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>      
+            std::map<T,std::string> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+            {
+                std::map<T,std::string> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);         
+                T ktemp;
+                std::string vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        //D vtemp;
-        for (auto &iter : record)
-        {
-            switch (kpos)
-            {
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
+ 			switch(vpos){
 
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
+                    }
+                    if(ktemp.size()>0)
+                    {
+                        a.emplace(ktemp,vtemp);
+                    }
+                } 
+         
+                return a;
+            }     
+        
+        template<typename T,typename U, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>       
+        std::map<std::string,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<std::string,U> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            std::string  ktemp;
+            U  vtemp;
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-            switch (dpos)
-            {
-            }
-        }
+   			  }
+ 			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
 
+                }
+                if(ktemp.size()>0)
+                {
+                    a.emplace(ktemp,vtemp);
+                }
+            }       
+      
         return a;
-    }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
+    }  
+    
+        template<typename T,typename U, typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>   
+        std::map<T,U> getCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,U> a;
+    
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            T ktemp;
+            U vtemp;
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        //D vtemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
+ 			switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
 
-        for (auto &iter : record)
-        {
+                }
+                if(ktemp.size()>0)
+                {
+                    a.emplace(ktemp,vtemp);
+                }
+            }       
+    
+            return a;
+        }   
+    
+        template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >         
+        std::map<T,meta> getmapRows([[maybe_unused]] std::string keyname)
+        {
+            std::map<T,meta> a;
+    
+            unsigned char kpos;
+            kpos=findcolpos(keyname);                        
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-            switch (kpos)
-            {
-            }
+   			case 0: 
+ 				 a.emplace(iter.id,iter);
+				 break;
+			case 1: 
+ 				 a.emplace(iter.randomnumber,iter);
+				 break;
 
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
+                }
+            }       
+     
+            return a;
+        }     
+    
+        template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true >    
+        std::map<std::string,meta> getmapRows([[maybe_unused]] std::string keyname)
+        {
+            std::map<std::string,meta> a;
 
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.randomnumber);
-                break;
-            }
-        }
+    
 
         return a;
     }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>  
+        std::vector<std::pair<std::string,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::vector<std::pair<std::string,U>> a;
+   
+
+            return a;
+        }   
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
-
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+			 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+			 break;
+			  }
+			 switch(vpos){
+
+                   }
+
+                   a.emplace_back(ktemp,vtemp);
+                }       
+
+    
+
+            return a;
+        }   
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-        for (auto &iter : record)
-        {
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
+ 			switch(vpos){
+
+                   }
+
+                    a.emplace_back(ktemp,vtemp);
+                }       
+    
+            return a;
+        }  
+    
+        template<typename T,typename U, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>     
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);                
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {
+                    
+                    switch(kpos)
+                    {
 
-            switch (kpos)
-            {
-            }
+   			  }
+ 			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+
+                   }
+                    a.emplace_back(ktemp,vtemp);
+                }       
+    
+            return a;
+        }  
+    
+        template<typename T,typename U, typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+                unsigned char kpos,vpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                T ktemp;
+                U vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-            switch (vpos)
-            {
-            case 0:
-                vtemp = iter.id;
-                break;
-            case 1:
-                vtemp = iter.randomnumber;
-                break;
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+
+                   }
+                    a.emplace_back(ktemp,vtemp);
+                }       
+      
+            return a;
+        }   
+    
+        template<typename T,typename U, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true>     
+        std::vector<std::pair<T,U>> getvecCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+                std::vector<std::pair<T,U>> a;
+   
+            return a;
+        }  
+    
+        template<typename T, typename std::enable_if<std::is_integral_v<T>,bool>::type = true >   
+        std::vector<std::pair<T,meta>> getvecRows([[maybe_unused]] std::string keyname)
+        {
+            std::vector<std::pair<T,meta>> a;
+     
+            unsigned char kpos;
+            kpos=findcolpos(keyname);                  
+            for(auto &iter:record)
+            { 
+                switch(kpos)
+                {
 
-            switch (dpos)
-            {
-            }
-        }
+   case 0: 
+ 	 a.emplace_back(iter.id,iter);
+	 break;
+case 1: 
+ 	 a.emplace_back(iter.randomnumber,iter);
+	 break;
 
+                }
+            }       
+    
         return a;
     }
-
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
+        template<typename T, typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true >  
+        std::vector<std::pair<std::string,meta>> getvecRows([[maybe_unused]] std::string keyname)
+        {
+            std::vector<std::pair<std::string,meta>> a;
+      
 
         return a;
     }
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<D>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+    
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);      
+            T ktemp;
+            U vtemp;
+            for(auto &iter:record)
+            { 
+                switch(kpos)
+                {
 
-        unsigned char kpos, vpos, dpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        dpos = findcolpos(dataname);
-        T ktemp;
-        U vtemp;
-        // D dtemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
+
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+			  }
+
+			 switch(dpos){
+
+                }
+            }       
 
-        for (auto &iter : record)
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
         {
+            std::map<T,std::map<U,std::vector<D>>> a;
+    
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);          
+            T ktemp;
+            U vtemp;
+            //D vtemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
-            }
+                switch(kpos)
+                {
 
-            switch (vpos)
-            {
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
+
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+			  }
+
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.randomnumber);
+				 break;
 
-            switch (dpos)
-            {
-            case 0:
-                a[ktemp][vtemp].emplace_back(iter.id);
-                break;
-            case 1:
-                a[ktemp][vtemp].emplace_back(iter.randomnumber);
-                break;
-            }
-        }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);       
+            T ktemp;
+            U vtemp;
+            // D dtemp;
+
+            for(auto &iter:record)
+            {
+                switch(kpos)
+                {
 
-        return a;
-    }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+				  }
+
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+			 }
+
+			 switch(dpos){
 
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<D, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname, [[maybe_unused]] std::string dataname)
-    {
-        std::map<T, std::map<U, std::vector<D>>> a;
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+                std::map<T,std::map<U,std::vector<D>>> a;
+   
+                unsigned char kpos,vpos,dpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                dpos=findcolpos(dataname);
+                T ktemp;
+                U vtemp;
+            // D dtemp;
+
+                for(auto &iter:record)
+                {
+                    
+                    switch(kpos)
+                    {
 
-        return a;
-    }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			 }
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+			 switch(vpos){
+			  }
 
-        return a;
-    }
+			 switch(dpos){
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
+                   }
+                }       
+    
+            return a;
+        }
+    
+    template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+    std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
     {
-        std::map<T, std::vector<U>> a;
+        std::map<T,std::map<U,std::vector<D>>> a;
 
-        return a;
-    }
+   
+        unsigned char kpos,vpos,dpos;
+        kpos=findcolpos(keyname);
+        vpos=findcolpos(valname);
+        dpos=findcolpos(dataname);             
+        T ktemp;
+        U vtemp;
+       // D dtemp;
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+         for(auto &iter:record)
+         {
+            switch(kpos)
+            {
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			 }
 
-        for (auto &iter : record)
-        {
+			 switch(vpos){
+			 }
 
-            switch (kpos)
-            {
-            }
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.randomnumber);
+				 break;
 
-            switch (vpos)
-            {
-            case 0:
-                a[ktemp].emplace_back(iter.id);
-                break;
-            case 1:
-                a[ktemp].emplace_back(iter.randomnumber);
-                break;
             }
-        }
-
+         }       
+    
         return a;
     }
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);
+            T ktemp;
+            U vtemp;
+            // D dtemp;
+
+            for(auto &iter:record)
+            { 
+                switch(kpos)
+                {
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
-
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
 
-        for (auto &iter : record)
-        {
+			 switch(vpos){
+			  }
 
-            switch (kpos)
-            {
+			 switch(dpos){
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+                std::map<T,std::map<U,std::vector<D>>> a;
+   
+                unsigned char kpos,vpos,dpos;
+                kpos=findcolpos(keyname);
+                vpos=findcolpos(valname);
+                dpos=findcolpos(dataname);               
+                T ktemp;
+                U vtemp;
+                //D vtemp;
+                for(auto &iter:record)
+                {
+                    switch(kpos)
+                    {
 
-            switch (vpos)
-            {
-            }
-        }
+   			 }
 
-        return a;
-    }
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+			  }
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_floating_point<U>::value, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::vector<U>> a;
+			 switch(dpos){
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
-        //U vtemp;
+                    }
+                }       
+    
 
-        for (auto &iter : record)
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
         {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);            
+            T ktemp;
+            U vtemp;
+            //D vtemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
+   			  }
+
+			 switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+			 }
+
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.randomnumber);
+				 break;
 
-            switch (vpos)
-            {
-            }
+                }
+            }       
+    
+            return a;
         }
-
-        return a;
-    }
-
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
+    
+    template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+    std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
     {
-        std::map<T, std::vector<U>> a;
+        std::map<T,std::map<U,std::vector<D>>> a;
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
+   
+        unsigned char kpos,vpos,dpos;
+        kpos=findcolpos(keyname);
+        vpos=findcolpos(valname);
+        dpos=findcolpos(dataname);
         T ktemp;
-        //U vtemp;
-
-        for (auto &iter : record)
-        {
+        U vtemp;
+        // D dtemp;
 
-            switch (kpos)
+         for(auto &iter:record)
+         {
+             
+            switch(kpos)
             {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
+   			 }
+
+			switch(vpos){
+			case 0: 
+ 				 vtemp=iter.id;
+				 break;
+			case 1: 
+ 				 vtemp=iter.randomnumber;
+				 break;
+			 }
+
+			switch(dpos){
 
-            switch (vpos)
-            {
-            case 0:
-                a[ktemp].emplace_back(iter.id);
-                break;
-            case 1:
-                a[ktemp].emplace_back(iter.randomnumber);
-                break;
             }
+         }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_floating_point<D>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            return a;
         }
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_integral_v<D>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
+        {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            unsigned char kpos,vpos,dpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            dpos=findcolpos(dataname);
+            T ktemp;
+            U vtemp;
+            // D dtemp;
 
-        return a;
-    }
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-    template <typename T, typename std::enable_if<std::is_integral_v<T>, bool>::type = true>
-    std::map<T, std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<T, std::vector<meta>> a;
+   			  }
+
+			 switch(vpos){
+			 }
 
-        unsigned char kpos;
-        kpos = findcolpos(keyname);
+			 switch(dpos){
+			case 0: 
+ 				 a[ktemp][vtemp].emplace_back(iter.id);
+				 break;
+			case 1: 
+ 				 a[ktemp][vtemp].emplace_back(iter.randomnumber);
+				 break;
 
-        for (auto &iter : record)
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<D,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<D>>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname,[[maybe_unused]] std::string dataname)
         {
-            switch (kpos)
-            {
+            std::map<T,std::map<U,std::vector<D>>> a;
+   
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
 
-            case 0:
-                a[iter.id].emplace_back(iter);
-                break;
-            case 1:
-                a[iter.randomnumber].emplace_back(iter);
-                break;
-            }
+   
+            return a;
         }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
+   
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
 
-        return a;
-    }
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-    template <typename T, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true>
-    std::map<T, std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
-    {
-        std::map<T, std::vector<meta>> a;
+   			  }
 
-        return a;
-    }
+			 switch(vpos){
+			case 0: 
+ 				 a[ktemp].emplace_back(iter.id);
+				 break;
+			case 1: 
+ 				 a[ktemp].emplace_back(iter.randomnumber);
+				 break;
 
-    template <typename T, typename U, typename D, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
+
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-        return a;
-    }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			 }
 
-    template <typename T, typename U, typename std::enable_if<std::is_same<T, std::string>::value, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+			 switch(vpos){
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
+                }
+            }       
 
-        for (auto &iter : record)
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_floating_point<U>::value,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
         {
+            std::map<T,std::vector<U>> a;
+               
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
 
-            switch (kpos)
+            for(auto &iter:record)
             {
-            }
+                
+                switch(kpos)
+                {
 
-            switch (vpos)
-            {
-            case 0:
-                a[ktemp][iter.id].emplace_back(iter);
-                break;
-            case 1:
-                a[ktemp][iter.randomnumber].emplace_back(iter);
-                break;
-            }
-        }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
 
-        return a;
-    }
+			 switch(vpos){
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<U>, bool>::type = true, typename std::enable_if<std::is_integral_v<U>, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::vector<U>> getgroupCols([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::vector<U>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);
+            T ktemp;
+            //U vtemp;
+
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			 }
+
+			 switch(vpos){
+			case 0: 
+ 				 a[ktemp].emplace_back(iter.id);
+				 break;
+			case 1: 
+ 				 a[ktemp].emplace_back(iter.randomnumber);
+				 break;
 
-        for (auto &iter : record)
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename std::enable_if<std::is_integral_v<T>,bool>::type = true>    
+        std::map<T,std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
         {
+            std::map<T,std::vector<meta>> a;
+   
+            unsigned char kpos;
+            kpos=findcolpos(keyname);
 
-            switch (kpos)
+            for(auto &iter:record)
             {
+                switch(kpos)
+                {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
+   			case 0: 
+ 				 a[iter.id].emplace_back(iter);
+				 break;
+			case 1: 
+ 				 a[iter.randomnumber].emplace_back(iter);
+				 break;
 
-            switch (vpos)
-            {
-            case 0:
-                a[ktemp][iter.id].emplace_back(iter);
-                break;
-            case 1:
-                a[ktemp][iter.randomnumber].emplace_back(iter);
-                break;
-            }
-        }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true>    
+        std::map<T,std::vector<meta>> getgroupRows([[maybe_unused]] std::string keyname)
+        {
+            std::map<T,std::vector<meta>> a;
+   
+            return a;
+        }
+    
+        template<typename T,typename U,typename D,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true, typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::map<U,std::vector<meta>>> a;
+   
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_same<T,std::string>::value,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::map<U,std::vector<meta>>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            T ktemp;
+            
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-        return a;
-    }
+   	  }
 
-    template <typename T, typename U, typename std::enable_if<std::is_integral_v<T>, bool>::type = true, typename std::enable_if<std::is_same<U, std::string>::value, bool>::type = true>
-    std::map<T, std::map<U, std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname, [[maybe_unused]] std::string valname)
-    {
-        std::map<T, std::map<U, std::vector<meta>>> a;
+ switch(vpos){
+			case 0: 
+ 				 a[ktemp][iter.id].emplace_back(iter);
+				 break;
+			case 1: 
+ 				 a[ktemp][iter.randomnumber].emplace_back(iter);
+				 break;
 
-        unsigned char kpos, vpos;
-        kpos = findcolpos(keyname);
-        vpos = findcolpos(valname);
-        T ktemp;
+                }
+            }       
 
-        for (auto &iter : record)
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<U>,bool>::type = true,typename std::enable_if<std::is_integral_v<U>,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
         {
-
-            switch (kpos)
+            std::map<T,std::map<U,std::vector<meta>>> a;
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);        
+        T ktemp;
+        
+            for(auto &iter:record)
             {
+                
+                switch(kpos)
+                {
 
-            case 0:
-                ktemp = iter.id;
-                break;
-            case 1:
-                ktemp = iter.randomnumber;
-                break;
-            }
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			 }
+
+			 switch(vpos){
+			case 0: 
+ 				 a[ktemp][iter.id].emplace_back(iter);
+				 break;
+			case 1: 
+ 				 a[ktemp][iter.randomnumber].emplace_back(iter);
+				 break;
 
-            switch (vpos)
-            {
-            }
-        }
+                }
+            }       
+    
+            return a;
+        }
+    
+        template<typename T,typename U,typename std::enable_if<std::is_integral_v<T>,bool>::type = true,typename std::enable_if<std::is_same<U,std::string>::value,bool>::type = true>    
+        std::map<T,std::map<U,std::vector<meta>>> getgroupRows([[maybe_unused]] std::string keyname,[[maybe_unused]] std::string valname)
+        {
+            std::map<T,std::map<U,std::vector<meta>>> a;
+
+   
+            unsigned char kpos,vpos;
+            kpos=findcolpos(keyname);
+            vpos=findcolpos(valname);            
+            T ktemp;
+            
+            for(auto &iter:record)
+            {
+                
+                switch(kpos)
+                {
 
-        return a;
-    }
-};
+   			case 0: 
+ 				 ktemp=iter.id;
+				 break;
+			case 1: 
+ 				 ktemp=iter.randomnumber;
+				 break;
+			  }
+
+			 switch(vpos){
+
+                }
+            }       
+    
+            return a;
+        }
+    
+  };
+    
 
-}// namespace orm
+}
 #endif
+