Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql 的where in子句应该用小括号吧 #2

Open
Guyuexuanjian opened this issue Jun 20, 2019 · 1 comment
Open

sql 的where in子句应该用小括号吧 #2

Guyuexuanjian opened this issue Jun 20, 2019 · 1 comment

Comments

@Guyuexuanjian
Copy link

from:
{
"Product:p":{
"@column":"id,code,name,price",
"brand_id!{}": [1,4,5]
}
}
to:
SELECT p.id, p.code, p.name, p.price
FROM Product p
WHERE (p.brand_id NOT IN [1, 4, 5])

@Zerounary
Copy link
Owner

是应该是小括号
文件:/src/main/java/zuo/biao/apijson/parser/APIJSONProvider.java

第329行
list.add(tableAliasName + "." + columnName + " NOT IN [" + limit + "]" );
修改为
list.add(tableAliasName + "." + columnName + " NOT IN (" + limit + ")" );

第347行
list.add(tableAliasName + "." + columnName + " IN [" + limit + "]" );
修改为
list.add(tableAliasName + "." + columnName + " IN (" + limit + ")" );

凡是APIJSON相关的功能想修改的,有一个技巧是,在APIJSONProvider.java中去,搜索关键字。比如,这里问题的关键字是!{},搜索到之后,在所在if分支的结尾处找到list.add这样的代码,此处下断点查看,就知道自己想改的内容该如何修改了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants