您好,函数的嵌套现在不支持吗?
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【常见问题】:https://github.com/Tencent/APIJSON/issues/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" }
还不支持,要么用 @raw,要么把内部函数 substring_index 拆分到子查询中
我上面就是使用了@raw,但是经过apijson解析后,会在substring_index外层添加单引号
@zhangyiyi909 所有被当成 Raw String 拼接到 SQL 中的字符串片段,都要在 AbstractSQLConfig.RAW_MAP 中配置,建议在 DemoSQLConfig 中 RAW_MAP.put("原始 SQL 片段", "")