分页条件连表查询

关于有 bo ,vo 时

service实现类

    @Override
    public TableDataInfo queryPageList(EventH5TemplateBo bo, PageQuery pageQuery) {
        int pageSize = bo.getPageSize();
        int start = (bo.getPageNum() - 1) * bo.getPageSize();
        List boList = baseMapper.queryEventH5TemplateList(start,pageSize,bo.getEventName());
        List voList = new ArrayList<>();
        for(EventH5TemplateBo bo1:boList){
            EventH5TemplateVo vo = new EventH5TemplateVo();
            BeanUtils.copyProperties(bo1,vo);
            voList.add(vo);
        }
        TableDataInfo tableDataInfo = new TableDataInfo<>();
        tableDataInfo.setRows(voList);
        tableDataInfo.setTotal(baseMapper.queryEventH5TemplateCount());
        return tableDataInfo;
    }

mapper

    @Select({
            ""
    })
    List queryEventH5TemplateList(@Param("start") int start, @Param("pageSize") int pageSize,
                                                     @Param("eventName") String eventName);

你可能感兴趣的:(java,开发语言)