通用Mapper之xxxByPrimaryKey 方法:
public void testSelectByPrimaryKey() {
//1.提供id值
Integer id = 3;
//2.执行根据主键进行的查询
User u = newMapper.selectByPrimaryKey(id);
//3.打印结果
System.out.println(u);
}
//按照主键查询单个,返回返回值为实体类对象
public void testSelectByPrimaryKey() {
//1.提供id值
Integer id = 3;
//2.执行根据主键进行的查询
User u = newMapper.selectByPrimaryKey(id);
//3.打印结果
System.out.println(u);
}
//按照主键查询单个,返回返回值为实体类对象