Mybatis plus实现Distinct去重功能
·
不啰嗦,上菜
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.select("DISTINCT no,name").orderByAsc("no");
return mapper.selectList(queryWrapper);
PS:
顺便一提,指明查询出后的结果输出类型,可以参考如下:
QueryWrapper<TablePo> queryWrapper = new QueryWrapper<>();
queryWrapper.select("DISTINCT no,name").orderByAsc("no");
return mapper.selectList(queryWrapper);
更多推荐
已为社区贡献2条内容
所有评论(0)