正文:
-- 正确写法 SELECT * FROM TABLE WHERE ID = #{id} ORDER BY ${columnName} DESC
参考博客:
MyBatis排序时使用order by 动态参数时需要注意,用$而不是# - pyzheng - ITeye博客
https://panyongzheng.iteye.com/blog/2257412
正文:
-- 正确写法 SELECT * FROM TABLE WHERE ID = #{id} ORDER BY ${columnName} DESC
参考博客:
MyBatis排序时使用order by 动态参数时需要注意,用$而不是# - pyzheng - ITeye博客
https://panyongzheng.iteye.com/blog/2257412