大橙子网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

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://dzwzjz.com/article/jppehj.html
在线咨询
服务热线
服务热线:028-86922220
TOP