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

order by 传递动态参数问题 #33

Closed
zhangyq1011 opened this issue Jul 5, 2018 · 2 comments
Closed

order by 传递动态参数问题 #33

zhangyq1011 opened this issue Jul 5, 2018 · 2 comments

Comments

@zhangyq1011
Copy link

zhangyq1011 commented Jul 5, 2018

想使用如下形式实现类似mybatis中的动态传递参数解决一些问题。代码如下:
" #if(:1.order != null) ORDER BY :1.order #end "
" #if(:1.order == null) ORDER BY t1.n_id DESC #end"

参数1是动态的order值,目前发现不支持生成的SQL都是带 引号的值。如:ORDER BY 'ID DESC'.
mybatis提供了${}可以支持 如下 mybatis $解决order by 动态传参
是否有好的解决方式。

@liangyanghe
Copy link
Member

支持的:http://mango.jfaster.org/dynamic.html#id1

@zhangyq1011
Copy link
Author

感谢!

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