它代表占位符,相当于原来 jdbc 部分所学的?,括号中的内容随意
如果 parameterType 为实体类,则 {} 中的内容为实体类中的属性
例如:
实体类:
public class Volg {
private User user;
}
public class User {
private Integer id;
private String username;
}
执行如下sql语句
select * from user where username like #{}
当 parameterType="com.itheima.domain.User" 时,{}中的内容为 {username}
当 parameterType="com.itheima.domain.Vlog" 时,{}中的内容为 {User.username}