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 ...
随机推荐
- 1.zabbix编译安装(环境lnmp)
zabbix服务端安装 1.使用脚本安装.脚本内容如下.安装完用http://192.168.159.20/zabbix #!/bin/bash #使用说明,此版本是针对程序安装路径不在/opt/下的 ...
- MySQL 下载,安装,配置windows 服务
本次使用的是压缩包的方式是可以纯手动自己折腾各种配置... ok,闲话少叙,我们准备发车... 一.先要去mysql官网去下载压缩包咯 ①下载地址:https://dev.mysql.com/down ...
- Appium+python自动化-查看app元素属性
本文转自:https://www.cnblogs.com/yoyoketang/p/7581831.html 前言 学UI自动化首先就是定位页面元素,玩过android版的appium小伙伴应该都知道 ...
- (4)C++ 复合类型-指针
篇幅长从 https://www.cnblogs.com/buchizaodian/p/11511256.html 提取出来 七.指针和自由存储空间 1.寻址运算符 * #include<io ...
- python requests方法post请求json格式处理
方法如下: import requestsimport json data = { 'a': 123, 'b': 456} ## headers中添加上content-type这个参数,指 ...
- selenium自动化测试时,chrome 出现“Chrome 正受到自动测试软件的控制”的解决办法
背景 使用selenium自动化测试的时候,启动浏览器出现'Chrome正在受到自动软件的控制'的问题,修改方法有两种. 一.在浏览器配置里加个参数,忽略掉这个警告提示语:disable_infoba ...
- [bzoj4589]Hard Nim(FWT快速沃尔什变化+快速幂)
题面:https://www.lydsy.com/JudgeOnline/problem.php?id=4589 题意 求选恰好n个数,满足每个数都是不大于m的质数,且它们的异或和为0的方案数. 解法 ...
- python 数据压缩
zlib 压缩 import zlib import this s = this.s.encode('utf8')*10 for i in range(10): data = zlib.compres ...
- GCD 与XOR
题目:UVA12716 题意: 问 gcd(i,j) = i ^ j 的对数(j <=i <= N ) N的范围为30000000,有10000组样例 分析: 有几个结论:(1)若 a ...
- 一、最新Kafka单节点部署+测试 完整
每次学一个东西从基础的开始,循序渐进. 不急不躁,路还很长. 所有教程都是学习汪文君大神的kafka教程的. 一.部署 这里选的kafka版本是 0.10.2.1 下载连接 https://dow ...