用于动态的sql的使用, 我们要把带查找的参数 传入xml中
可以使用 #{} 和 ${} 两种传入参数方法
1. #{}
传入的参数带上了 双引号 " "
selec * from #{table};
解析后为
select * from "test"
查询会失败
2. ${}
传入的参数不做处理
select * from ${table}
解析后为
select * from test
3.区别
#{}类似与预编译 PreparedStatement , 可以防止sql注入
4.注意
能用#{} 就用#{} , 可以防止sql注入嘛