${} 直接填充
#{} 会预编译
例如:
select * from ${table} where ${column} =1;
出入 table= user column = id
select * from user where id =1;
如果使用 #{} 就变成:
select * from #{table} where #{column} =1;
select * from 'user' where 'id' =1;
MyBatis 注解版 ( 三 ) ${}和 #{}的区别
最新推荐文章于 2025-10-09 00:45:00 发布
本文详细介绍了MyBatis框架中动态SQL的两种形式:${}
2685

被折叠的 条评论
为什么被折叠?



