Java-Class-C:com.github.pagehelper.PageHelper
| ylbtech-Java-Class-C:com.github.pagehelper.PageHelper |
| 1.返回顶部 |
| 2.返回顶部 |
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
/**
* showdoc
*
* @catalog 管理平台
* @title 在学列表
* @description 在学列表
* @method post
* @url ip:port/order/orderList
* @return_param pno 必选 num 分页页码
* @return_param psize 必选 num 分页大小
* @return_param organizationID 必选 string 机构id
* @return {"code":200,"data":{"endRow":5,"hasNextPage":false,"hasPreviousPage":false,"isFirstPage":true,"isLastPage":true,"list":[{"buyTime":"2019-02-19 17:47:09","channel":4,"comment":"test","courseID":"b180117000001","leaveMsg":"test","mobile":"13800000000","orderID":"o190219174710","organizationID":"ylbtech","params":{},"payState":0,"pno":1,"price":0,"psize":10,"studentID":"test"},{"buyTime":"2019-02-19 17:45:47","channel":4,"comment":"test","courseID":"b180117000001","leaveMsg":"test","mobile":"13800000000","orderID":"o190219174547","organizationID":"ylbtech","params":{},"payState":0,"pno":1,"price":0,"psize":10,"studentID":"test"},{"buyTime":"2019-02-19 17:45:47","channel":4,"comment":"test","courseID":"b180117000001","leaveMsg":"test","mobile":"13800000000","orderID":"o190219174548","organizationID":"ylbtech","params":{},"payState":0,"pno":1,"price":0,"psize":10,"studentID":"test"},{"buyTime":"2019-02-19 17:45:42","channel":4,"comment":"test","courseID":"b180117000001","leaveMsg":"test","mobile":"13800000000","orderID":"o190219174542","organizationID":"ylbtech","params":{},"payState":0,"pno":1,"price":0,"psize":10,"studentID":"test"},{"buyTime":"2019-02-19 17:01:04","channel":4,"comment":"test","courseID":"b180117000001","leaveMsg":"test","mobile":"13800000000","orderID":"o190219170104","organizationID":"ylbtech","params":{},"payState":0,"pno":1,"price":0,"psize":10,"studentID":"test"}],"navigateFirstPage":1,"navigateLastPage":1,"navigatePages":8,"navigatepageNums":[1],"nextPage":0,"pageNum":1,"pageSize":10,"pages":1,"prePage":0,"size":5,"startRow":1,"total":5}}
* @return_param courseID string 课程id
* @return_param buyTime string 购买时间
* @return_param channel string 支付渠道(1-商户支付宝;2-商户微信;3-个人支付宝;4个人微信)
* @return_param comment string 备注
* @return_param courseID string 课程id
* @return_param leaveMsg string 留言
* @return_param mobile string 联系电话
* @return_param orderID string 订单id
* @return_param organizationID string
* @return_param payState string 支付状态0-待支付; 1-已支付;-1-退款
* @return_param price string 价格
* @remark 这里是备注信息
* @number 1
*/
@ApiOperation(value = "在学列表")
@PostMapping("/studentOrderList")
public Result studentOrderList(HttpServletRequest request, @RequestBody(required = false) StudentOrder studentOrder) {
try { /**
* 查询 支付状态 为 1 支付完成, 2 进行中 两种状态 数据
*/
PageHelper.startPage(studentOrder.getPno(), studentOrder.getPsize());
List list = studentOrderService.selectStudentOrderList1(studentOrder);
PageInfo<Course> pageInfo = PageInfo.of(list);
return ResultGenerator.genOkResult(pageInfo);
} catch (Exception e) {
log.error("查询课程列表异常", e);
return ResultGenerator.genFailedResult(500, "系统异常");
} }
1.2.2、List<Map>集合
@ApiOperation(value = "查询拼团情况列表")
@PostMapping("/selectGroupSituationListById")
public Result selectGroupSituationListById(HttpServletRequest request, @RequestBody() Map pa) {
try {
String organizationId = TokenUtils.getOrganizationId(request, jwtUtil); int pno = (int) pa.get("pno");
int psize = (int) pa.get("psize");
PageHelper.startPage(pno, psize);
pa.put("organizationId",organizationId);
List<Map> list = grouactivityMapper.selectGroupSituationListById(pa);
PageInfo<Map> pageInfo = PageInfo.of(list);
return ResultGenerator.genOkResult(pageInfo);
} catch (Exception e) {
log.error("列表异常", e);
return ResultGenerator.genFailedResult(500, "系统异常");
}
}
| 3.返回顶部 |
| 4.返回顶部 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 abel533@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/ package com.github.pagehelper; import com.github.pagehelper.dialect.AbstractHelperDialect;
import com.github.pagehelper.page.PageAutoDialect;
import com.github.pagehelper.page.PageMethod;
import com.github.pagehelper.page.PageParams;
import com.github.pagehelper.parser.CountSqlParser;
import com.github.pagehelper.util.MSUtils;
import com.github.pagehelper.util.StringUtil;
import org.apache.ibatis.cache.CacheKey;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.session.RowBounds; import java.util.List;
import java.util.Properties; /**
* Mybatis - 通用分页拦截器<br/>
* 项目地址 : http://git.oschina.net/free/Mybatis_PageHelper
*
* @author liuzh/abel533/isea533
* @version 5.0.0
*/
public class PageHelper extends PageMethod implements Dialect {
private PageParams pageParams;
private PageAutoDialect autoDialect; @Override
public boolean skip(MappedStatement ms, Object parameterObject, RowBounds rowBounds) {
if (ms.getId().endsWith(MSUtils.COUNT)) {
throw new RuntimeException("在系统中发现了多个分页插件,请检查系统配置!");
}
Page page = pageParams.getPage(parameterObject, rowBounds);
if (page == null) {
return true;
} else {
//设置默认的 count 列
if (StringUtil.isEmpty(page.getCountColumn())) {
page.setCountColumn(pageParams.getCountColumn());
}
autoDialect.initDelegateDialect(ms);
return false;
}
} @Override
public boolean beforeCount(MappedStatement ms, Object parameterObject, RowBounds rowBounds) {
return autoDialect.getDelegate().beforeCount(ms, parameterObject, rowBounds);
} @Override
public String getCountSql(MappedStatement ms, BoundSql boundSql, Object parameterObject, RowBounds rowBounds, CacheKey countKey) {
return autoDialect.getDelegate().getCountSql(ms, boundSql, parameterObject, rowBounds, countKey);
} @Override
public boolean afterCount(long count, Object parameterObject, RowBounds rowBounds) {
return autoDialect.getDelegate().afterCount(count, parameterObject, rowBounds);
} @Override
public Object processParameterObject(MappedStatement ms, Object parameterObject, BoundSql boundSql, CacheKey pageKey) {
return autoDialect.getDelegate().processParameterObject(ms, parameterObject, boundSql, pageKey);
} @Override
public boolean beforePage(MappedStatement ms, Object parameterObject, RowBounds rowBounds) {
return autoDialect.getDelegate().beforePage(ms, parameterObject, rowBounds);
} @Override
public String getPageSql(MappedStatement ms, BoundSql boundSql, Object parameterObject, RowBounds rowBounds, CacheKey pageKey) {
return autoDialect.getDelegate().getPageSql(ms, boundSql, parameterObject, rowBounds, pageKey);
} public String getPageSql(String sql, Page page, RowBounds rowBounds, CacheKey pageKey) {
return autoDialect.getDelegate().getPageSql(sql, page, pageKey);
} @Override
public Object afterPage(List pageList, Object parameterObject, RowBounds rowBounds) {
//这个方法即使不分页也会被执行,所以要判断 null
AbstractHelperDialect delegate = autoDialect.getDelegate();
if (delegate != null) {
return delegate.afterPage(pageList, parameterObject, rowBounds);
}
return pageList;
} @Override
public void afterAll() {
//这个方法即使不分页也会被执行,所以要判断 null
AbstractHelperDialect delegate = autoDialect.getDelegate();
if (delegate != null) {
delegate.afterAll();
autoDialect.clearDelegate();
}
clearPage();
} @Override
public void setProperties(Properties properties) {
setStaticProperties(properties);
pageParams = new PageParams();
autoDialect = new PageAutoDialect();
pageParams.setProperties(properties);
autoDialect.setProperties(properties);
//20180902新增 aggregateFunctions, 允许手动添加聚合函数(影响行数)
CountSqlParser.addAggregateFunctions(properties.getProperty("aggregateFunctions"));
}
}
| 5.返回顶部 |
package com.ylbtech.edu.pclass.domain; import com.ylbtech.common.base.BaseEntity; /**
* class表 class
*
* @author ylbtech
* @date 2019-02-22
*/
public class Class extends BaseEntity
{ }
package com.ylbtech.common.base; import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat; /**
* Entity基类
*
* @author ylbtech
*/
public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L; /** 搜索值 */
private String searchValue; /** 创建者 */
private String createBy; /** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; /** 更新者 */
private String updateBy; /** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; /** 备注 */
private String remark;
/**
* 分页 页码
*/
private int pno =1;
/**
* 分页 大小
*/
private int psize =10; /** 请求参数 */
private Map<String, Object> params; public String getSearchValue()
{
return searchValue;
} public void setSearchValue(String searchValue)
{
this.searchValue = searchValue;
} public String getCreateBy()
{
return createBy;
} public void setCreateBy(String createBy)
{
this.createBy = createBy;
} public Date getCreateTime()
{
return createTime;
} public void setCreateTime(Date createTime)
{
this.createTime = createTime;
} public String getUpdateBy()
{
return updateBy;
} public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
} public Date getUpdateTime()
{
return updateTime;
} public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
} public String getRemark()
{
return remark;
} public void setRemark(String remark)
{
this.remark = remark;
} public Map<String, Object> getParams()
{
if (params == null)
{
params = new HashMap<>();
}
return params;
} public int getPno() {
return pno;
} public void setPno(int pno) {
this.pno = pno;
} public int getPsize() {
return psize;
} public void setPsize(int psize) {
this.psize = psize;
} public void setParams(Map<String, Object> params)
{
this.params = params;
}
}
BaseEntity.java
| 6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
Java-Class-C:com.github.pagehelper.PageHelper的更多相关文章
- Java WebSocket库:https://github.com/TooTallNate/Java-WebSocket
https://github.com/TooTallNate/Java-WebSocket 以下是简单示例: import com.google.gson.JsonObject; import com ...
- Java-Class-C:com.github.pagehelper.PageInfo
ylbtech-Java-Class-C:com.github.pagehelper.PageInfo 1.返回顶部 2.返回顶部 1.1. import com.github.pagehelpe ...
- Missing artifact com.github.pagehelper:pagehelper:jar:3.4.2-fix的解决方法
使用pagehelper.3.4.2.jar时报错,应该是无法从网络上下载该jar. 我的解决方案是: 从网络上下载一个pagehelper.3.4.2.jar包,然后复制到.m2目录中 如我的目录是 ...
- 报错com.github.pagehelper.PageHelper cannot be cast to com.github.pagehelper.Dialect
报错com.github.pagehelper.PageHelper cannot be cast to com.github.pagehelper.Dialect spring以及mybatis版本 ...
- com.github.pagehelper.PageHelper cannot be cast to org.apache.ibatis.plugin.Interceptor
在MyBatis的配置文件中修改对pageHelper的配置修改前 <plugins> <plugin interceptor="com.github.pagehelper ...
- 20个GitHub最热门的Java开源项目:文档、框架、工具
专注于Java领域优质技术,欢迎关注 文章来源:JavaGuide 以下涉及到的数据统计,数据来源:https://github.com/trending/java?since=monthly[1] ...
- Java基础20:Java8新特性终极指南
更多内容请关注微信公众号[Java技术江湖] 这是一位阿里 Java 工程师的技术小站,作者黄小斜,专注 Java 相关技术:SSM.SpringBoot.MySQL.分布式.中间件.集群.Linux ...
- Java基础19:Java集合框架梳理
更多内容请关注微信公众号[Java技术江湖] 这是一位阿里 Java 工程师的技术小站,作者黄小斜,专注 Java 相关技术:SSM.SpringBoot.MySQL.分布式.中间件.集群.Linux ...
- Java基础18:Java序列化与反序列化
更多内容请关注微信公众号[Java技术江湖] 这是一位阿里 Java 工程师的技术小站,作者黄小斜,专注 Java 相关技术:SSM.SpringBoot.MySQL.分布式.中间件.集群.Linux ...
随机推荐
- 3D打印切片软件Cura及CuraEngine原理分析
引言 年初开始进入3D打印行业,受命以Cura为基础,研发一款自主的3D打印切片软件. 自主研发要取其长处,补其不足,首先自然是要搞清楚Cura到底做了什么,读Cura的代码是必需的.我一向都觉得比起 ...
- HTML5: HTML5 新元素
ylbtech-HTML5: HTML5 新元素 1.返回顶部 1. HTML5 新元素 自1999年以后HTML 4.01 已经改变了很多,今天,在HTML 4.01中的几个已经被废弃,这些元素在H ...
- vue中按需引入mint-UI报Error: .plugins[3][1] must be an object, false, or undefined
{ "presets": ["@babel/preset-env", "@babel/preset-react"], "plugi ...
- 常用命令--awk
awk '{ BEGIN{stat1} BEGIN{stat2} pattern1{action1} pattern2{action2} ... patternn{actionn} {默认动作,无条件 ...
- Arcpy 遍历每一个要素新建要素类
#方法一:cursor= arcpy.da.SearchCursor(aim_fc,["OID@","SHAPE@"]) for row in cursor: ...
- 第二章 部署Kubernetes集群准备环境
一.centos7开机自动联网设置 1.使用root用户登录进入Linux,打开进去终端 2.在终端中输入:cd /etc/sysconfig/network-scripts 3.ll命令找到目录下 ...
- Git中crlf自动转换的坑
新上手一个项目,克隆了代码下来搭环境,一路坑.其中一个sh脚本执行不了,报IOException,java日志除了"找不到文件或文件夹"之外看不出任何信息,手动运行脚本才发现是脚本 ...
- 转。Nas配置。想找原版没找到,全是转载的,也没注出处,无语。
随着家用宽带的不断提速和高清电影的普及外带单反的家庭占有率越来越搞,仅靠台式机里那几块硬盘越来越不够用了. 简单的计算了一下,家里的台式机上2T的容量(1T+640G+320G)已经接近于80%满,外 ...
- VUE.JS 环境配置
首先安装 node.js 网址 https://nodejs.org/en/ 选择版本 点击直接安装OK (不用安装到系统盘) 然后cmd 命令框 输入 npm -version (查看安装版本 ...
- 解决ubuntu终端路劲显示过长问题
1 找到配置文件先进行备份: cp ~/.bashrc ~/.bashrc-bak 2 找到配置文件修改: vi ~/.bashrc 备份是为了防止配置修改出错,可以还原 3 在以下的红色位置 ...
