通用Mapper之xxxByPrimaryKey 方法:

public void testSelectByPrimaryKey() {

  //1.提供id值

  Integer id = 3;

  //2.执行根据主键进行的查询

  User u = newMapper.selectByPrimaryKey(id);

  //3.打印结果

  System.out.println(u);

}

//按照主键查询单个,返回返回值为实体类对象

posted @ 2020-08-17 15:19  yuanzhinv01  阅读(436)  评论(0)    收藏  举报