SQL性能优化第三篇之Mybatis接收多数据集(分页数据和Count数据)

废话不多说,直接上代码:

1、xml代码:





    



        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    

2、Mapper代码:

//接收用list
List getStudentManagePage(这里是传递的条件参数);

 3、service代码:

//接收用list
List getStudentManagePage(这里是传递的条件参数);

4、serviceimpl代码:

@Override
    public List getStudentManagePage(参数) {
        return tblStudentInfomationMapper.getStudentManagePage(参数);
    }

5、controller代码:

//这里是接收数据
List list = tblStudentInfomationService.getStudentManagePage(参数);
List studentManageVoList = new ArrayList();
//接收分页数据
studentManageVoList = (List)list.get(0);
//接收count数据
count = ((List) list.get(1)).get(0);

6、看完点个赞,关注下呗~

你可能感兴趣的:(sql性能优化)