jiazx0107@163.com
2023-05-17 620eab6cca2bc9ef9ea6d3067a0a5ba1deadbd1c
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package com.ld.igds.data;
 
import java.util.Collections;
import java.util.List;
 
/**
 * 根据需要重写封装系统使用的Page对象,主要是为了满足LayUI前端的使用
 *
 * @author Andy
 */
public class Page<T> extends com.baomidou.mybatisplus.plugins.Page<T> {
 
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
 
    private List<T> data = Collections.emptyList();// LAYUI中使用的数据信息
 
    private String code = "0";// LAYUI 中的定义
 
    private String msg;// LAYUI使用的提示信息
 
    private int count;// LAYUI使用的总数
 
    private int limit = 10;// 每页显示的条数。laypage将会借助 count 和 limit 计算出分页数
 
    private int curr;// 起始页。一般用于刷新类型的跳页以及HASH跳页
 
    public int getLimit() {
        limit = super.getSize();
        return limit;
    }
 
    public void setLimit(int limit) {
        this.limit = limit;
        this.setSize(limit);
    }
 
    public int getCurr() {
        curr = super.getCurrent();
        return curr;
    }
 
    public void setCurr(int curr) {
        this.curr = curr;
        super.setCurrent(curr);
    }
 
    public List<T> getData() {
        data = super.getRecords();
        return data;
    }
 
    public void setData(List<T> data) {
        this.data = data;
        super.setRecords(data);
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getMsg() {
        return msg;
    }
 
    public void setMsg(String msg) {
        this.msg = msg;
    }
 
    public int getCount() {
        count = (int) super.getTotal();
        return count;
    }
 
    public void setCount(int count) {
        this.count = count;
        super.setTotal(count);
    }
    
    
    public Page() {
    }
 
    public Page(int current, int size) {
        super(current, size);
    }
 
    public Page(int current, int size, String orderByField) {
        super(current, size);
        this.setOrderByField(orderByField);
    }
 
    public Page(int current, int size, String orderByField, boolean isAsc) {
        this(current, size, orderByField);
        this.setAsc(isAsc);
    }
 
}