rain
2024-03-23 d2108ee735894d73bf655bda1651ecaefbc4c09d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.dji.sample.patches.service.impl;
 
import com.dji.sample.patches.dao.PatchesMapper;
import com.dji.sample.patches.model.PageBean;
import com.dji.sample.patches.model.PatchesEntity;
import com.dji.sample.patches.service.PatchesService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.opengis.geometry.coordinate.Polygon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
@Service
public class PatchesServiceImpl implements PatchesService {
    @Autowired
    private PatchesMapper mapper;
 
    @Override
    public PageBean limitGet(Integer id, String bsm, Polygon dkfw, String dklx, int page, int pageSize) {
 
        //1. 设置分页参数
        PageHelper.startPage(page,pageSize);
 
        //2. 执行查询
        List<PatchesEntity> PatchersList = mapper.limitGet(id,bsm,dkfw,dklx);
        com.github.pagehelper.Page<PatchesEntity> p = (Page<PatchesEntity>) PatchersList;
 
        //3. 封装PageBean对象
        PageBean pageBean = new PageBean(p.getTotal(), p.getResult());
        return pageBean;
    }
}