Skip to content

您好,函数的嵌套现在不支持吗? #588

Open

Description

@zhangyiyi909

Description

例如
{
"count": 30,
"[]": {
"View_base_count": {
"@column": "concat(substring_index(enter_code,'-',1),'-0000-0000')):company;sum(total_count):count;min(company_name):company_name",
"@raw": "@column",
"data_type": "device_logs",
"province_code": "110000",
"@group": "company"
}
}
}
然后返回结果
{
"[]": [
{
"View_base_count": {
"company": "substring_index(enter_code-1)'-0000-0000')",
"count": 485,
"company_name": "xxx公司"
}
}
],
"count": 30,
"ok": true,
"code": 200,
"msg": "success",
"debug:info|help": " \n提 bug 请发请求和响应的【完整截屏】,没图的自行解决! \n开发者有限的时间和精力主要放在【维护项目源码和文档】上! \n【描述不详细】 或 【文档/常见问题 已有答案】 的问题可能会被忽略!! \n【态度 不文明/不友善】的可能会被踢出群,问题也可能不予解答!!! \n\n 环境信息 \n系统: Windows 10 10.0 \n数据库: DEFAULT_DATABASE = MYSQL \nJDK: 1.8.0_201 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",
"sql:generate|cache|execute|maxExecute": "1|0|1|200",
"depth:count|max": "3|5",
"time:start|duration|end|parse|sql": "1689837777891|14|1689837777905|3|11"
}

Activity

  1. TommyLemon commented on Jul 22, 2023

    @TommyLemon
    Member

    还不支持,要么用 @raw,要么把内部函数 substring_index 拆分到子查询中

  2. zhangyiyi909 commented on Jul 27, 2023

    @zhangyiyi909
    Author

    image
    我上面就是使用了@raw,但是经过apijson解析后,会在substring_index外层添加单引号
    image

  3. TommyLemon commented on Jul 29, 2023

    @TommyLemon
    Member

    @zhangyiyi909
    所有被当成 Raw String 拼接到 SQL 中的字符串片段,都要在 AbstractSQLConfig.RAW_MAP 中配置,建议在 DemoSQLConfig 中 RAW_MAP.put("原始 SQL 片段", "")

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions