通用mapper类:

public interface CategoryMapper extends Mapper<Category> {
}

使用select(T t)

public List<Category> queryCategoryListByParentId(Long pid) {
	// select(T t) 将对象c中的非空字段当作查询的条件参数
	Category record = new Category();
	record.setParentId(pid);
	return this.categoryMapper.select(record);
}

select(T t) 将实例对象t中的非空字段作为条件参数
上面实例转换的sql语句:select * from category c where c.pid = #{pid}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-02-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2022-02-24
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
相关资源
相似解决方案