buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
public without sharing class PagePlus {
    private Integer page = 1;
    private Integer pageLimit = 10;
    private List<SObject> records = null;
    private Integer total = 0;
 
    public PagePlus(Integer page,Integer pageLimit) {
        this.page = page;
        this.pageLimit = pageLimit;
    }
 
    //获取分页 page当前页数,limit每页记录数
    public String getPage(){
        String limitOffset = '';
        if(this.page == 1 && this.pageLimit > 0){
            limitOffset = ' LIMIT '+ this.pageLimit;
        }else if(this.page > 1 && this.pageLimit > 0){
            limitOffset = ' LIMIT '+ this.page * this.pageLimit + ' OFFSET ' + this.pageLimit;
        }
        return limitOffset;
    }
 
 
    /**
     * 分页记录列表
     *
     * @return 分页对象记录列表
     */
    public List<SObject> getRecords() {
        return this.records;
    }
    /**
     * 设置分页记录列表
     */
    public PagePlus setRecords(List<SObject> records) {
        this.records = records;
        return this;
    }
 
    /**
     * 当前满足条件总行数
     *
     * @return 总条数
     */
    public Integer getTotal() {
        return total;
    }
 
    /**
     * 设置当前满足条件总行数
     */
    public PagePlus setTotal(Integer total) {
        this.total = total;
        return this;
    }
 
    public static  Integer ControllerUtil() {
        Integer i = 0;
        
        return i;
    }
}