资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

springboot+mybatisplus实现多表联查分页

1 配置分页插件

创新互联公司主营松溪网站建设的网络公司,主营网站建设方案,重庆App定制开发,松溪h5微信平台小程序开发搭建,松溪网站营销推广欢迎松溪等地区企业咨询

public class MybatisPlusConfig {
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
    @Bean
    public PerformanceInterceptor performanceInterceptor() {
        PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
        Properties properties = new Properties();
        properties.setProperty("format", "true");
        performanceInterceptor.setProperties(properties);
        return performanceInterceptor;
    }
}

2 创建返回实体VO

@ApiModel(value = "员工得分信息")
public class AgentOutVo {
    @ApiModelProperty(value = "所在单位")
    private String unit;
    略……
    @ApiModelProperty(value = "申诉状态")
    private String appealState;
}

3 service层
接口

public interface IAgentScoreService {
    List queryAgentOutMapByPage(Map params);
}

实现

public class AgentScoreServiceImpl extends ServiceImpl implements IAgentScoreService {
    @Autowired
    private AgentScoreMapper agentScoreMapper;
    @Override
    public List queryAgentOutMapByPage(Map params) {
        return agentScoreMapper.selectAgentOutMap(new Query(params).getPage(),params); 
    }
}

4 mapper

public interface AgentScoreMapper extends BaseMapper {
    List selectAgentOutMap(Page pagination, @Param("params") Map params);//params 接收前端对象
}

5 resources/mapper/


本文名称:springboot+mybatisplus实现多表联查分页
标题来源:http://cdkjz.cn/article/jppehj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220