${} 直接填充
#{} 会预编译
例如:
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 注解版 ( 三 ) ${}和 #{}的区别
最新推荐文章于 2024-06-25 08:33:10 发布