1、#在预编译的时候相当于一个?占位符,而$则是字符串
select * from user where id=#{id} select * from user where id=?
select * from user where id=${id} select * from user where id="zhagn"
2、#有效防止sql注入 $适合传入一个对象,在能用#的情况下尽量使用#
1、#在预编译的时候相当于一个?占位符,而$则是字符串
select * from user where id=#{id} select * from user where id=?
select * from user where id=${id} select * from user where id="zhagn"
2、#有效防止sql注入 $适合传入一个对象,在能用#的情况下尽量使用#