ebe6bbd1529f74089589801f2b82fcd17c6703e5.svn-base 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package cn.com.goldenwater.dcproj.util;
  2. import cn.com.goldenwater.core.param.BaseParam;
  3. import io.swagger.annotations.ApiParam;
  4. /**
  5. * Created by guangyyh on 2018/8/28.
  6. */
  7. public class SystemPageParam extends BaseParam {
  8. // 页码
  9. @ApiParam(name = "pageNum", value = "页码", defaultValue = "1")
  10. private int pageNum = 1;
  11. // 每页记录数
  12. @ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "10")
  13. private int pageSize = 10;
  14. // 排序语句(例如:id desc, create_time desc)
  15. @ApiParam(name = "orderBy", value = "排序语句(例如:id desc, create_time desc)")
  16. private String orderBy;
  17. // 是否包含分页信息(对标PageHelper的count属性,如果为true则返回对象中的data为PageInfo对象,如果为false则是数据数组[])
  18. @ApiParam(name = "count", value = "是否查询总数(默认不)", defaultValue = "false")
  19. private boolean count = false;
  20. // 上页最后一条记录标识
  21. @ApiParam(name = "offset", value = "偏移量:上页最后一条记录标识")
  22. private String offset;
  23. private int from;
  24. private int to;
  25. private String province;
  26. private String orgId;
  27. public String getOrgId() {
  28. return orgId;
  29. }
  30. public void setOrgId(String orgId) {
  31. this.orgId = orgId;
  32. }
  33. public String getProvince() {
  34. return province;
  35. }
  36. public void setProvince(String province) {
  37. this.province = province;
  38. }
  39. public int getPageNum() {
  40. return pageNum;
  41. }
  42. public void setPageNum(int pageNum) {
  43. this.pageNum = pageNum;
  44. }
  45. public int getPageSize() {
  46. return pageSize;
  47. }
  48. public void setPageSize(int pageSize) {
  49. this.pageSize = pageSize;
  50. }
  51. public String getOrderBy() {
  52. return orderBy;
  53. }
  54. public void setOrderBy(String orderBy) {
  55. this.orderBy = orderBy;
  56. }
  57. public boolean getCount() {
  58. return count;
  59. }
  60. public void setCount(boolean containPageInfo) {
  61. this.count = count;
  62. }
  63. public String getOffset() {
  64. return offset;
  65. }
  66. public void setOffset(String offset) {
  67. this.offset = offset;
  68. }
  69. public int getFrom() {
  70. if (pageNum > 0 && pageSize > 0) {
  71. from = (pageNum - 1) * pageSize;
  72. } else {
  73. from = 0;
  74. }
  75. return from;
  76. }
  77. public void setFrom(int from) {
  78. this.from = from;
  79. }
  80. public int getTo() {
  81. if (pageNum > 0 && pageSize > 0) {
  82. to = pageNum * pageSize;
  83. } else {
  84. to = 0;
  85. }
  86. return to;
  87. }
  88. public void setTo(int to) {
  89. this.to = to;
  90. }
  91. }