File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -547,18 +547,23 @@ template:
547547 <rule>
548548 在返回的JSON的sql字段字符串内,必须注意符号的转译是否正确
549549 </rule>
550+ <rule>
551+ 过滤条件空字符串处理:
552+ - 如果过滤条件数组为空[]或null → 视为无过滤条件
553+ - 如果过滤条件中filter字段为空字符串("")→ 该条件视为无效
554+ - 如果所有过滤条件的filter都为空字符串 → 视为无有效过滤条件
555+ </rule>
550556 <rule>
551557 处理逻辑:
552- - 如果过滤条件为空数组[]或null → {{"success":true,"sql":"原SQL"}}
558+ - 如果无过滤条件(空数组、null、所有filter为空字符串) → {{"success":true,"sql":"原SQL"}}
553559 - 如果过滤条件不为空但找不到匹配的表 → {{"success":true,"sql":"原SQL"}}
554- - 如果过滤条件有语法错误或安全风险 → {{"success":false,"message":"错误原因"}}
555- - 其他情况 → 生成新SQL并返回 {{"success":true,"sql":"新SQL"}}
560+ - 如果过滤条件有语法错误或安全风险(不包括空字符串) → {{"success":false,"message":"错误原因"}}
561+ - 如果过滤条件有有效条件(非空字符串)且能找到匹配表 → 生成新SQL并返回 {{"success":true,"sql":"新SQL"}}
556562 </rule>
557563 <rule>
558564 无论成功还是失败,都必须返回JSON格式,禁止输出任何自然语言。
559565 思考过程只在内部进行,不输出到最终结果。
560566 </rule>
561-
562567 </Rules>
563568
564569 ### 响应, 请根据上述要求直接返回JSON结果:
You can’t perform that action at this time.
0 commit comments