mybatis中条件表达式if的test为字符串时值比较

mybatis中条件表达式字符串用''单引号不能直接比较,需要加toString()

<if test="param != null and param != 'hello'.toString()" >

或者用""双引号

<if test='param != null and param != "hello" ' >

猜你喜欢

转载自blog.51cto.com/jtech/2345879
今日推荐