GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 分组后再分页,发现total数量不对,后台sql发现统计的是组内数量,请问有其他查询方法吗? · Issue #624 · APIJSON/APIJSON

分组后再分页,发现total数量不对,后台sql发现统计的是组内数量,请问有其他查询方法吗? #624

New issue
Copy link
New issue
Copy link
Open
#884
Open
分组后再分页,发现total数量不对,后台sql发现统计的是组内数量,请问有其他查询方法吗?#624
#884
Copy link
Labels
Bug 漏洞help wanted请求帮助请求帮助

Description

@vchenhao
vchenhao
opened on Oct 26, 2023
Issue body actions

Description

{
"[]": {

    "VehicleList_count": {
        //数据源
        "@ds": "etcmj",
        "vehicleclass{}": [
            "0"
        ],
        "vehicletype{}": [
            "1"
        ],
        "@order": "maxcnt-",
        "vehicleid$":"鄂QD24S8_0%",
        //汇总日期,范围
        "sumdate%": "2023-10-15,2023-10-17",
        "cntss>=": "3",
        "@group": "vehicleid,sumdate",
        "@column": "vehicleid;sumdate;max(vehicletype):vt;max(vehicleclass):vc;max(cnt):maxcnt;max(cntss):maxcntss",
    },
    // 页码
    "page": 0,
    //每页数量
    "count": 5,
    "query": 2
},
//总数量
"total@": "/[]/total"

以上是我的查询

{
"msg": "success",
"total": 18,
"code": 200,
"data": [
{
"VehicleList_count": {
"maxcnt": 18,
"vehicleid": "鄂QD24S8_0",
"sumdate": "2023-10-17",
"vc": 0,
"maxcntss": 3,
"vt": 1,
"@ds": "etcmj"
}
}
],
"depth:count|max": "3|5",
"time:start|duration|end|parse|sql": "1698283826663|136|1698283826799|7|129",
"debug:info|help": " \n提 bug 请发请求和响应的【完整截屏】,没图的自行解决! \n开发者有限的时间和精力主要放在【维护项目源码和文档】上! \n【描述不详细】 或 【文档/常见问题 已有答案】 的问题可能会被忽略!! \n【态度 不文明/不友善】的可能会被踢出群,问题也可能不予解答!!! \n\n 环境信息 \n系统: Linux 3.10.0-1160.el7.x86_64 \n数据库: DEFAULT_DATABASE = MYSQL \nJDK: 1.8.0_222 amd64 \nAPIJSON: 6.1.0 \n \n【常见问题】:#36 \n【通用文档】:https://github.com/Tencent/APIJSON/blob/master/Document.md \n【视频教程】:https://search.bilibili.com/all?keyword=APIJSON",
"ok": true,
"sql:generate|cache|execute|maxExecute": "2|0|2|1000000"
}

以上是我的查询结果,total 数量显示18 ,想要的结果应该是1,因为聚合后只有一个分组。

Activity

  1. vchenhao commented on Oct 26, 2023

    @vchenhao
    vchenhao
    on Oct 26, 2023
    Author
    More actions

    通过@from@解决

  2. vchenhao
    closed this as completedon Oct 26, 2023
  3. TommyLemon
    added
    Bug 漏洞
    on Nov 12, 2023
  4. TommyLemon commented on Nov 12, 2023

    @TommyLemon
    TommyLemon
    on Nov 12, 2023
    Member
    More actions

    [] 内传 compat 更方便。

    不过这也是一个 bug,需要判断 SELECT 中是否有 min, avg 等 SQL 聚合函数,只要有,就需要 SELECT count(*) FROM(原语句),否则就把 SELECT min(id) 改成 SELECT count(*),目前是通过 compat 来判断是否需要

    https://github.com/Tencent/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java
    image

  5. TommyLemon
    reopened this on Nov 12, 2023
  6. TommyLemon
    added
    help wanted请求帮助请求帮助
    on Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 漏洞help wanted请求帮助请求帮助

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.