mybatis的ognl表达式问题

来源:互联网 发布:请州长夫人演唱 知乎 编辑:程序博客网 时间:2024/05/22 17:17
<if test="orderParam == null OR orderParam ==1 ">

ORDER BY id DESC

</if>

<if test="orderParam !=null AND orderParam !='' AND orderParam =='2' ">
ORDER BY age DESC
</if>

Cause: org.apache.ibatis.ognl.ExpressionSyntaxException

平时没注意,偶然间发现mybatis的ognl表达式异常
看了日志才发现这里没有大写的or和and,也可以写 “||”和“&&”
谨记 

原创粉丝点击