Parcourir la source

[C++]paozhu update orm files (#9863)

* Paozhu update

* Update orm file

* [Paozhu] update orm file

* update paozhu

* update paozhu

* [C++ paozhu] update ORM

* update orm files

* update orm files
Huang ziquan il y a 4 mois
Parent
commit
9acd664f12

+ 2 - 2
frameworks/C++/paozhu/paozhu.dockerfile

@@ -94,8 +94,8 @@ RUN mkdir ./paozhu/orm/include
 
 
 COPY ./paozhu_benchmark/orm/orm.h ./paozhu/orm/
-COPY ./paozhu_benchmark/orm/include/fortunebase.h ./paozhu/orm/include/
-COPY ./paozhu_benchmark/orm/include/worldbase.h ./paozhu/orm/include/
+COPY ./paozhu_benchmark/orm/include/fortune_base.h ./paozhu/orm/include/
+COPY ./paozhu_benchmark/orm/include/world_base.h ./paozhu/orm/include/
 COPY ./paozhu_benchmark/orm/include/fortune_mysql.h ./paozhu/orm/include/
 COPY ./paozhu_benchmark/orm/include/world_mysql.h ./paozhu/orm/include/
 

+ 3 - 3
frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp

@@ -166,9 +166,9 @@ asio::awaitable<std::string> techempowercached_queries(std::shared_ptr<httppeer>
     auto myworld          = orm::World();
     std::string mycacheid = "alldatacache";
 
-    pzcache<std::vector<orm::worldbase::meta>> &temp_cache = pzcache<std::vector<orm::worldbase::meta>>::conn();
+    pzcache<std::vector<orm::world_base::meta>> &temp_cache = pzcache<std::vector<orm::world_base::meta>>::conn();
 
-    std::vector<orm::worldbase::meta> allcachedata_array;
+    std::vector<orm::world_base::meta> allcachedata_array;
     allcachedata_array.reserve(10000);
     //create rand data to cache
     if (temp_cache.check(mycacheid) > -1)
@@ -227,7 +227,7 @@ asio::awaitable<std::string> techempowercached_db(std::shared_ptr<httppeer> peer
     auto myworld          = orm::World();
     std::string mycacheid = "my" + std::to_string(get_num);
 
-    pzcache<std::vector<orm::worldbase::meta>> &temp_cache = pzcache<std::vector<orm::worldbase::meta>>::conn();
+    pzcache<std::vector<orm::world_base::meta>> &temp_cache = pzcache<std::vector<orm::world_base::meta>>::conn();
 
     myworld.record.reserve(get_num);
     if (temp_cache.check(mycacheid) > -1)

+ 1 - 1
frameworks/C++/paozhu/paozhu_benchmark/models/Fortune.cpp

@@ -1,6 +1,6 @@
 
 #include "fortune_mysql.h"
-#include "fortunebase.h"
+#include "fortune_base.h"
 #include "Fortune.h"
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。

+ 1 - 1
frameworks/C++/paozhu/paozhu_benchmark/models/World.cpp

@@ -1,6 +1,6 @@
 
 #include "world_mysql.h"
-#include "worldbase.h"
+#include "world_base.h"
 #include "World.h"
 
 /* 如果此文件存在不会自动覆盖,没有则会自动生成。

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

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

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

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

+ 15 - 15
frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h → frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_base.h

@@ -2,7 +2,7 @@
 #define ORM_DEFAULT_FORTUNEBASEMATA_H
 /*
 *This file is auto create from paozhu_cli
-*本文件为自动生成 Tue, 08 Apr 2025 07:55:59 GMT
+*本文件为自动生成 Sat, 26 Apr 2025 15:58:21 GMT
 ***/
 #include <iostream>
 #include <cstdio>
@@ -19,19 +19,19 @@
 namespace orm { 
    
     
-struct fortunebase
+struct fortune_base
 {
     struct meta{
      unsigned  int  id = 0; ///**/
  std::string  message = ""; ///**/
  } data;
- std::vector<fortunebase::meta> record;
+ std::vector<fortune_base::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(); }
+std::vector<fortune_base::meta>::iterator begin(){     return record.begin(); }
+std::vector<fortune_base::meta>::iterator end(){     return record.end(); }
+std::vector<fortune_base::meta>::const_iterator begin() const{     return record.begin(); }
+std::vector<fortune_base::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};
@@ -75,7 +75,7 @@ break;
             record.clear();     
       }
       void data_reset(){
-     fortunebase::meta metatemp;    
+     fortune_base::meta metatemp;    
             data = metatemp; 
       }
       
@@ -610,7 +610,7 @@ tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(data.message)<<"\"";
     void from_json(const std::string &json_content)
    {
         record.clear();
-        fortunebase::meta metatemp; 
+        fortune_base::meta metatemp; 
         data=metatemp;
         unsigned int json_offset=0;
         bool isarray=false;
@@ -1057,14 +1057,14 @@ tempsql<<"\"message\":\""<<http::utf8_to_jsonstring(record[n].message)<<"\"";
  void setMessage( std::string  &val){  data.message=val;} 
  void setMessage(std::string_view val){  data.message=val;} 
 
-fortunebase::meta getnewData(){
+fortune_base::meta getnewData(){
  	 struct meta newdata;
 	 return newdata; 
 } 
-fortunebase::meta getData(){
+fortune_base::meta getData(){
  	 return data; 
 } 
-std::vector<fortunebase::meta> getRecord(){
+std::vector<fortune_base::meta> getRecord(){
  	 return record; 
 } 
 
@@ -1145,7 +1145,7 @@ std::vector<fortunebase::meta> getRecord(){
             }  
     
         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)
+        T getVal([[maybe_unused]] fortune_base::meta & iter,[[maybe_unused]] std::string keyname)
         {
 
           
@@ -1179,7 +1179,7 @@ std::vector<fortunebase::meta> getRecord(){
             }  
     
             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)
+            T getVal([[maybe_unused]] fortune_base::meta & iter,std::string keyname)
             {
                 unsigned char kpos;
                 kpos=findcolpos(keyname);
@@ -1211,7 +1211,7 @@ std::vector<fortunebase::meta> getRecord(){
             }  
    
             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)
+            std::string getVal([[maybe_unused]] fortune_base::meta & iter,std::string keyname)
             {
          
                 unsigned char kpos;

+ 546 - 68
frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h

@@ -4005,18 +4005,8 @@ M_MODEL& or_leMessage(T val)
                 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());
+            wheresql.push_back('=');
+            wheresql.append(std::to_string(val));
             return *mod;
         }
 
@@ -4082,14 +4072,7 @@ M_MODEL& or_leMessage(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
-            {
-            }
-            else
-            {
-                wheresql.push_back('=');
-            }
+            wheresql.push_back('=');
 
             if (obj.is_string())
             {
@@ -4131,9 +4114,7 @@ M_MODEL& or_leMessage(T val)
             }
             wheresql.append(wq);
             wheresql.push_back(bi);
-            std::stringstream _stream;
-            _stream << val;
-            wheresql.append(_stream.str());
+            wheresql.append(std::to_string(val));
             return *mod;
         }
 
@@ -4192,14 +4173,135 @@ M_MODEL& or_leMessage(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.push_back('=');
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereBT(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.push_back('>');
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereBE(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(">=");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereLT(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
             }
+            wheresql.append(wq);
+            wheresql.append(" < ");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereLE(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(" <= ");
 
             wheresql.push_back('\'');
             wheresql.append(val);
@@ -4503,19 +4605,167 @@ M_MODEL& or_leMessage(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.push_back('=');
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereBT(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
             }
-            std::stringstream _stream;
-            _stream << val;
-            wheresql.append(_stream.str());
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" > ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereBE(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);
+            wheresql.append(" >= ");
+            wheresql.append(std::to_string(val));
             return *mod;
         }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereLT(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);
+            wheresql.append(" < ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereLE(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);
+            wheresql.append(" <= ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+        //where and 
+        M_MODEL &whereEQ(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.push_back('=');
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+
         M_MODEL &whereAnd(const std::string &wq, const std::string &val)
         {
             if (wheresql.empty())
@@ -4540,22 +4790,80 @@ M_MODEL& or_leMessage(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.push_back('=');
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+        //where string or
+
+        M_MODEL &whereOrBT(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
             }
+            wheresql.append(wq);
+            wheresql.push_back('>');
 
             wheresql.push_back('\'');
             wheresql.append(val);
             wheresql.push_back('\'');
+            return *mod;
+        }
 
+        M_MODEL &whereOrBE(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(">=");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
             return *mod;
         }
-        M_MODEL &whereOr(const std::string &wq)
+
+        M_MODEL &whereOrLT(const std::string &wq, const std::string &val)
         {
             if (wheresql.empty())
             {
@@ -4579,11 +4887,15 @@ M_MODEL& or_leMessage(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
+            wheresql.append(" < ");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
             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)
+
+        M_MODEL &whereOrLE(const std::string &wq, const std::string &val)
         {
             if (wheresql.empty())
             {
@@ -4607,20 +4919,49 @@ M_MODEL& or_leMessage(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.append(" <= ");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        //where or
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrBT(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
             }
-            std::stringstream _stream;
-            _stream << val;
-            wheresql.append(_stream.str());
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" > ");
+            wheresql.append(std::to_string(val));
             return *mod;
         }
-        M_MODEL &whereOr(const std::string &wq, const std::string &val)
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrBE(const std::string &wq, _SQL_Value val)
         {
             if (wheresql.empty())
             {
@@ -4644,15 +4985,154 @@ M_MODEL& or_leMessage(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.append(" >= ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrLT(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
             }
+            wheresql.append(wq);
+            wheresql.append(" < ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
 
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrLE(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);
+            wheresql.append(" <= ");
+            wheresql.append(std::to_string(val));
+            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);
+            wheresql.push_back('=');
+            wheresql.append(std::to_string(val));
+            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);
+            wheresql.push_back('=');
             wheresql.push_back('\'');
             wheresql.append(val);
             wheresql.push_back('\'');
@@ -7021,7 +7501,7 @@ M_MODEL& or_leMessage(T val)
             temp_cache.save(sqlhashid, cache_data, exp_time);
             return true;
         }
-        B_BASE::meta &get_cache(const std::string &cache_key_name)
+        typename B_BASE::meta &get_cache(const std::string &cache_key_name)
         {
             try
             {
@@ -10764,7 +11244,7 @@ M_MODEL& or_leMessage(T val)
                 return *mod;
             }
             islock_conn = true;
-            
+
             if (islock_conn)
             {
                 if (!edit_conn)
@@ -10776,16 +11256,15 @@ M_MODEL& or_leMessage(T val)
             {
                 edit_conn = conn_obj->get_edit_conn();
             }
-            sqlstring="start transaction";
+            sqlstring = "start transaction";
             edit_conn->write_sql(sqlstring);
             iscommit = true;
 
-            
             return *mod;
         }
         M_MODEL &rollback()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10806,16 +11285,16 @@ M_MODEL& or_leMessage(T val)
             {
                 edit_conn = conn_obj->get_edit_conn();
             }
-            sqlstring="rollback";
+            sqlstring = "rollback";
             edit_conn->write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             return *mod;
         }
         M_MODEL &commit()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10834,17 +11313,16 @@ M_MODEL& or_leMessage(T val)
             }
             else
             {
-                edit_conn =conn_obj->get_edit_conn();
+                edit_conn = conn_obj->get_edit_conn();
             }
-            sqlstring="commit";
+            sqlstring = "commit";
             edit_conn->write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             return *mod;
         }
 
-
         asio::awaitable<bool> async_begin_commit()
         {
             if (!conn_empty())
@@ -10864,7 +11342,7 @@ M_MODEL& or_leMessage(T val)
             {
                 edit_conn = co_await conn_obj->async_get_edit_conn();
             }
-            sqlstring="start transaction";
+            sqlstring = "start transaction";
             co_await edit_conn->async_write_sql(sqlstring);
             iscommit = true;
 
@@ -10872,7 +11350,7 @@ M_MODEL& or_leMessage(T val)
         }
         asio::awaitable<bool> async_rollback()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10893,17 +11371,17 @@ M_MODEL& or_leMessage(T val)
             {
                 edit_conn = co_await conn_obj->async_get_edit_conn();
             }
-            sqlstring="rollback";
+            sqlstring = "rollback";
             co_await edit_conn->async_write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             co_return true;
         }
 
         asio::awaitable<bool> async_commit()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10924,10 +11402,10 @@ M_MODEL& or_leMessage(T val)
             {
                 edit_conn = co_await conn_obj->async_get_edit_conn();
             }
-            sqlstring="commit";
+            sqlstring = "commit";
             co_await edit_conn->async_write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             co_return true;
         }

+ 15 - 15
frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h → frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_base.h

@@ -2,7 +2,7 @@
 #define ORM_DEFAULT_WORLDBASEMATA_H
 /*
 *This file is auto create from paozhu_cli
-*本文件为自动生成 Tue, 08 Apr 2025 07:55:59 GMT
+*本文件为自动生成 Sat, 26 Apr 2025 15:58:21 GMT
 ***/
 #include <iostream>
 #include <cstdio>
@@ -19,19 +19,19 @@
 namespace orm { 
    
     
-struct worldbase
+struct world_base
 {
     struct meta{
      unsigned  int  id = 0; ///**/
  int  randomnumber = 0; ///**/
  } data;
- std::vector<worldbase::meta> record;
+ std::vector<world_base::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(); }
+std::vector<world_base::meta>::iterator begin(){     return record.begin(); }
+std::vector<world_base::meta>::iterator end(){     return record.end(); }
+std::vector<world_base::meta>::const_iterator begin() const{     return record.begin(); }
+std::vector<world_base::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};
@@ -75,7 +75,7 @@ break;
             record.clear();     
       }
       void data_reset(){
-     worldbase::meta metatemp;    
+     world_base::meta metatemp;    
             data = metatemp; 
       }
       
@@ -653,7 +653,7 @@ if(data.randomnumber==0){
     void from_json(const std::string &json_content)
    {
         record.clear();
-        worldbase::meta metatemp; 
+        world_base::meta metatemp; 
         data=metatemp;
         unsigned int json_offset=0;
         bool isarray=false;
@@ -1106,14 +1106,14 @@ if(record[n].randomnumber==0){
  int  getRandomnumber(){  return data.randomnumber; } 
  void setRandomnumber( int  val){  data.randomnumber=val;} 
 
-worldbase::meta getnewData(){
+world_base::meta getnewData(){
  	 struct meta newdata;
 	 return newdata; 
 } 
-worldbase::meta getData(){
+world_base::meta getData(){
  	 return data; 
 } 
-std::vector<worldbase::meta> getRecord(){
+std::vector<world_base::meta> getRecord(){
  	 return record; 
 } 
 
@@ -1200,7 +1200,7 @@ std::vector<worldbase::meta> getRecord(){
             }  
     
         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)
+        T getVal([[maybe_unused]] world_base::meta & iter,[[maybe_unused]] std::string keyname)
         {
 
           
@@ -1237,7 +1237,7 @@ std::vector<worldbase::meta> getRecord(){
             }  
     
             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)
+            T getVal([[maybe_unused]] world_base::meta & iter,std::string keyname)
             {
                 unsigned char kpos;
                 kpos=findcolpos(keyname);
@@ -1266,7 +1266,7 @@ std::vector<worldbase::meta> getRecord(){
             }  
    
             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)
+            std::string getVal([[maybe_unused]] world_base::meta & iter,std::string keyname)
             {
          
                 unsigned char kpos;

+ 546 - 68
frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h

@@ -3845,18 +3845,8 @@ M_MODEL& or_leRandomnumber(T val)
                 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());
+            wheresql.push_back('=');
+            wheresql.append(std::to_string(val));
             return *mod;
         }
 
@@ -3922,14 +3912,7 @@ M_MODEL& or_leRandomnumber(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
-            {
-            }
-            else
-            {
-                wheresql.push_back('=');
-            }
+            wheresql.push_back('=');
 
             if (obj.is_string())
             {
@@ -3971,9 +3954,7 @@ M_MODEL& or_leRandomnumber(T val)
             }
             wheresql.append(wq);
             wheresql.push_back(bi);
-            std::stringstream _stream;
-            _stream << val;
-            wheresql.append(_stream.str());
+            wheresql.append(std::to_string(val));
             return *mod;
         }
 
@@ -4032,14 +4013,135 @@ M_MODEL& or_leRandomnumber(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.push_back('=');
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereBT(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.push_back('>');
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereBE(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(">=");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereLT(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
             }
+            wheresql.append(wq);
+            wheresql.append(" < ");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        M_MODEL &whereLE(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(" <= ");
 
             wheresql.push_back('\'');
             wheresql.append(val);
@@ -4343,19 +4445,167 @@ M_MODEL& or_leRandomnumber(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.push_back('=');
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereBT(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" AND ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" AND ");
+                    }
+                }
             }
-            std::stringstream _stream;
-            _stream << val;
-            wheresql.append(_stream.str());
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" > ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereBE(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);
+            wheresql.append(" >= ");
+            wheresql.append(std::to_string(val));
             return *mod;
         }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereLT(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);
+            wheresql.append(" < ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereLE(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);
+            wheresql.append(" <= ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+        //where and 
+        M_MODEL &whereEQ(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.push_back('=');
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+
         M_MODEL &whereAnd(const std::string &wq, const std::string &val)
         {
             if (wheresql.empty())
@@ -4380,22 +4630,80 @@ M_MODEL& or_leRandomnumber(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.push_back('=');
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+
+            return *mod;
+        }
+        //where string or
+
+        M_MODEL &whereOrBT(const std::string &wq, const std::string &val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
             }
+            wheresql.append(wq);
+            wheresql.push_back('>');
 
             wheresql.push_back('\'');
             wheresql.append(val);
             wheresql.push_back('\'');
+            return *mod;
+        }
 
+        M_MODEL &whereOrBE(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(">=");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
             return *mod;
         }
-        M_MODEL &whereOr(const std::string &wq)
+
+        M_MODEL &whereOrLT(const std::string &wq, const std::string &val)
         {
             if (wheresql.empty())
             {
@@ -4419,11 +4727,15 @@ M_MODEL& or_leRandomnumber(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
+            wheresql.append(" < ");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
             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)
+
+        M_MODEL &whereOrLE(const std::string &wq, const std::string &val)
         {
             if (wheresql.empty())
             {
@@ -4447,20 +4759,49 @@ M_MODEL& or_leRandomnumber(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.append(" <= ");
+
+            wheresql.push_back('\'');
+            wheresql.append(val);
+            wheresql.push_back('\'');
+            return *mod;
+        }
+
+        //where or
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrBT(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
             }
-            std::stringstream _stream;
-            _stream << val;
-            wheresql.append(_stream.str());
+            if (iskuohao)
+            {
+                ishascontent = true;
+            }
+            wheresql.append(wq);
+            wheresql.append(" > ");
+            wheresql.append(std::to_string(val));
             return *mod;
         }
-        M_MODEL &whereOr(const std::string &wq, const std::string &val)
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrBE(const std::string &wq, _SQL_Value val)
         {
             if (wheresql.empty())
             {
@@ -4484,15 +4825,154 @@ M_MODEL& or_leRandomnumber(T val)
                 ishascontent = true;
             }
             wheresql.append(wq);
-            char bi = wq.back();
-            if (bi == '=' || bi == '>' || bi == '<')
+            wheresql.append(" >= ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
+
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrLT(const std::string &wq, _SQL_Value val)
+        {
+            if (wheresql.empty())
             {
             }
             else
             {
-                wheresql.push_back('=');
+                if (ishascontent)
+                {
+                    wheresql.append(" OR ");
+                }
+                else
+                {
+                    if (!iskuohao)
+                    {
+                        wheresql.append(" OR ");
+                    }
+                }
+            }
+            if (iskuohao)
+            {
+                ishascontent = true;
             }
+            wheresql.append(wq);
+            wheresql.append(" < ");
+            wheresql.append(std::to_string(val));
+            return *mod;
+        }
 
+        template <typename _SQL_Value>
+        requires std::is_integral_v<_SQL_Value> || std::is_floating_point_v<_SQL_Value>
+        M_MODEL &whereOrLE(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);
+            wheresql.append(" <= ");
+            wheresql.append(std::to_string(val));
+            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);
+            wheresql.push_back('=');
+            wheresql.append(std::to_string(val));
+            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);
+            wheresql.push_back('=');
             wheresql.push_back('\'');
             wheresql.append(val);
             wheresql.push_back('\'');
@@ -6861,7 +7341,7 @@ M_MODEL& or_leRandomnumber(T val)
             temp_cache.save(sqlhashid, cache_data, exp_time);
             return true;
         }
-        B_BASE::meta &get_cache(const std::string &cache_key_name)
+        typename B_BASE::meta &get_cache(const std::string &cache_key_name)
         {
             try
             {
@@ -10604,7 +11084,7 @@ M_MODEL& or_leRandomnumber(T val)
                 return *mod;
             }
             islock_conn = true;
-            
+
             if (islock_conn)
             {
                 if (!edit_conn)
@@ -10616,16 +11096,15 @@ M_MODEL& or_leRandomnumber(T val)
             {
                 edit_conn = conn_obj->get_edit_conn();
             }
-            sqlstring="start transaction";
+            sqlstring = "start transaction";
             edit_conn->write_sql(sqlstring);
             iscommit = true;
 
-            
             return *mod;
         }
         M_MODEL &rollback()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10646,16 +11125,16 @@ M_MODEL& or_leRandomnumber(T val)
             {
                 edit_conn = conn_obj->get_edit_conn();
             }
-            sqlstring="rollback";
+            sqlstring = "rollback";
             edit_conn->write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             return *mod;
         }
         M_MODEL &commit()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10674,17 +11153,16 @@ M_MODEL& or_leRandomnumber(T val)
             }
             else
             {
-                edit_conn =conn_obj->get_edit_conn();
+                edit_conn = conn_obj->get_edit_conn();
             }
-            sqlstring="commit";
+            sqlstring = "commit";
             edit_conn->write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             return *mod;
         }
 
-
         asio::awaitable<bool> async_begin_commit()
         {
             if (!conn_empty())
@@ -10704,7 +11182,7 @@ M_MODEL& or_leRandomnumber(T val)
             {
                 edit_conn = co_await conn_obj->async_get_edit_conn();
             }
-            sqlstring="start transaction";
+            sqlstring = "start transaction";
             co_await edit_conn->async_write_sql(sqlstring);
             iscommit = true;
 
@@ -10712,7 +11190,7 @@ M_MODEL& or_leRandomnumber(T val)
         }
         asio::awaitable<bool> async_rollback()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10733,17 +11211,17 @@ M_MODEL& or_leRandomnumber(T val)
             {
                 edit_conn = co_await conn_obj->async_get_edit_conn();
             }
-            sqlstring="rollback";
+            sqlstring = "rollback";
             co_await edit_conn->async_write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             co_return true;
         }
 
         asio::awaitable<bool> async_commit()
         {
-            if(iscommit==false)
+            if (iscommit == false)
             {
                 error_msg = "not begin_commit";
                 iserror   = true;
@@ -10764,10 +11242,10 @@ M_MODEL& or_leRandomnumber(T val)
             {
                 edit_conn = co_await conn_obj->async_get_edit_conn();
             }
-            sqlstring="commit";
+            sqlstring = "commit";
             co_await edit_conn->async_write_sql(sqlstring);
 
-            iscommit = false;
+            iscommit    = false;
             islock_conn = false;
             co_return true;
         }