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 ...
随机推荐
- react — script引入 和 脚手架使用的区别
1.React 入门实例教程 :http://www.ruanyifeng.com/blog/2015/03/react.html ( 阮一峰的博客) 或 https://segmentfaul ...
- Brute Force(暴力(破解))
一.攻击模块1:Brute Force(暴力破解) 暴力破解一般指穷举法,穷举法的基本思想是根据题目的部分条件确定答案的大致范围,并在此范围内对所有可能的情况逐一验证,直到全部情况验证完毕.若某个情况 ...
- [CSP-S模拟测试]:抛硬币(DP)
题目背景 小$A$和小$B$是一对好朋友,他们经常一起愉快的玩耍.最近小$B$沉迷于**师手游,天天刷本,根本无心搞学习.但是小$B$已经入坑了几个月,却一次都没有抽到$SSR$,让他非常怀疑人生.勤 ...
- OpenGL 学习总结
最终呈现画出三角形的一个方式: public void draw(float[] mvpMatrix) { // Add program to OpenGL ES environment GLES20 ...
- pandas中的quantile函数
https://blog.csdn.net/weixin_38617311/article/details/87893168 data.price.quantile([0.25,0.5,0.75]) ...
- Supervisord rce(CVE-2017-11610)
POST /RPC2 HTTP/1.1 Host: localhost Accept: */* Accept-Language: en User-Agent: Mozilla/5.0 (compati ...
- Rust <0>:源代码组织,Cargo 入门
Rust 源代码组织,使用配套的 Cargo 工具,其功能强大,程序员可摆脱 C/C++ 中需要自行维护 make.cmake 之类配置的工作量. 初始化一个项目: cargo new --bin h ...
- JS检查断网
window.addEventListener('load', function() { function updateOnlineStatus(event) { var condition = na ...
- LINUX 安装PHP GD库遇到的坑
本文借鉴:https://www.cnblogs.com/gaohj/p/3152646.html linux下为php添加GD库的步骤如下: 一.下载 gd-.tar.gz http://www.b ...
- git清理工作区
git clean -f 这将删除所有未被追踪的文件 git rev-list