mybaits动态SQL中的order by

动态SQL中,普通的字段在sql中都是用#{name}表示的

而order by 的,得用${name} 这样的

解释:

动态sql中,用#{name}会当做String

sql中,拼接起来就是 order by 'name'

而用 $的话,拼接起来后,就是 order by name

猜你喜欢

转载自kabuchino.iteye.com/blog/1873700