springboot+mybatisplus实现多表联查分页-成都快上网建站

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://kswjz.com/article/jppehj.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流