Search in sources :

Example 1 with ProductExample

use of com.megagao.production.ssm.domain.ProductExample in project production_ssm by megagao.

the class ProductServiceImpl method getList.

@Override
public EUDataGridResult getList(int page, int rows, Product product) throws Exception {
    // 查询产品列表
    ProductExample example = new ProductExample();
    // 分页处理
    PageHelper.startPage(page, rows);
    List<Product> list = productMapper.selectByExample(example);
    // 创建一个返回值对象
    EUDataGridResult result = new EUDataGridResult();
    result.setRows(list);
    // 取记录总条数
    PageInfo<Product> pageInfo = new PageInfo<>(list);
    result.setTotal(pageInfo.getTotal());
    return result;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) EUDataGridResult(com.megagao.production.ssm.domain.customize.EUDataGridResult) ProductExample(com.megagao.production.ssm.domain.ProductExample) Product(com.megagao.production.ssm.domain.Product)

Aggregations

PageInfo (com.github.pagehelper.PageInfo)1 Product (com.megagao.production.ssm.domain.Product)1 ProductExample (com.megagao.production.ssm.domain.ProductExample)1 EUDataGridResult (com.megagao.production.ssm.domain.customize.EUDataGridResult)1