mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
搭建PVB架构,实现前端的基础布局、菜单、表格、图示等功能
This commit is contained in:
@@ -192,20 +192,21 @@ bool DaoEntity::queryFields(string keys, const string& sql_c, PageInfo& pageinfo
|
||||
return true;
|
||||
}
|
||||
|
||||
pageinfo.page_max = pageinfo.total / pageinfo.page_size + (pageinfo.total % pageinfo.page_size > 0 ? 1 : 0);
|
||||
pageinfo.pageCount = pageinfo.total / pageinfo.pageSize + (pageinfo.total % pageinfo.pageSize > 0 ? 1 : 0);
|
||||
oss.str("");
|
||||
if (pageinfo.page_id <= 0)
|
||||
if (pageinfo.pageIndex <= 0)
|
||||
{
|
||||
pageinfo.page_id = 1;
|
||||
pageinfo.pageIndex = 1;
|
||||
}
|
||||
int start = (pageinfo.page_id - 1) * pageinfo.page_size;
|
||||
oss << "SELECT " << keys << " FROM `" << tableName_ << "` " << sql_c << " LIMIT " << start << "," << pageinfo.page_size << ";";
|
||||
int start = (pageinfo.pageIndex - 1) * pageinfo.pageSize;
|
||||
oss << "SELECT " << keys << " FROM `" << tableName_ << "` " << sql_c << " LIMIT " << start << "," << pageinfo.pageSize << ";";
|
||||
return this->db_->exec(oss.str().c_str(), result);
|
||||
}
|
||||
|
||||
bool DaoEntity::updateFields(DataFields& fields, const string& sql_c)
|
||||
{
|
||||
string sql = fields.get_update_sql(tableName_, sql_c);
|
||||
std::cout << sql;
|
||||
if (sql_c.empty())
|
||||
{
|
||||
//Spdlogger::error("[DB] update condition is empty, not exec, sql={}", sql);
|
||||
|
||||
Reference in New Issue
Block a user