1.引入paging.js

//分页,页码导航,要求参数为一个对象
function createPageNav(opt) {opt= opt || {};var $container   = opt.$container          || null, //必需,页码容器,请确保这个容器只用来存放页码导航pageCount    = Number(opt.pageCount)   || 0,    //必需,页码总数currentNum   = Number(opt.currentNum)  || 1,    //选填,当前页码maxCommonLen = Number(opt.maxCommonLen)|| 10,   //选填,普通页码的最大个数className = opt.className  || "pagination",//选填,分页类型:pagination或pager等preText   = opt.preText    || "上一页",      //选填,上一页文字显示,适用于只有前后页按钮的情况nextText  = opt.nextText   || "下一页",      //选填,下一页文字,同上firstText = opt.firstText  || "首页",lastText  = opt.lastText   || "末页",hasFirstBtn  = opt.hasFirstBtn   === false ? false : true,hasLastBtn   = opt.hasLastBtn    === false ? false : true,hasPreBtn    = opt.hasPreBtn     === false ? false : true,hasNextBtn   = opt.hasNextBtn    === false ? false : true,hasInput     = opt.hasInput      === false ? false : true,hasCommonPage= opt.hasCommonPage === false ? false : true,//选填,是否存在普通页beforeFun = opt.beforeFun || null,  //选填,页码跳转前调用的函数,可通过返回false来阻止跳转,可接收目标页码参数afterFun  = opt.afterFun  || null,  //选填,页码跳转后调用的函数,可接收目标页码参数noPageFun = opt.noPageFun || null;  //选填,页码总数为0时调用的函数//当前显示的最小页码,用于计算起始页码,直接容器,当前页,前,后,首,末,输入框var minNum=1,changeLen,$parent,$currentPage,$preBtn,$nextBtn,$firstBtn,$lastBtn,$input;//容器if (!$container || $container.length != 1){console.log("分页容器不存在或不正确");return false;}//总页数if(pageCount <= 0){if(noPageFun) noPageFun();return false;}//当前页if (currentNum < 1) currentNum = 1;else if (currentNum > pageCount) currentNum = pageCount;//普通页码的最大个数,起始页算法限制,不能小于3if(maxCommonLen<3) maxCommonLen=3;//跳转页响应长度,用于计算起始页码if(maxCommonLen>=8) changeLen=3;else if(maxCommonLen>=5) changeLen=2;else changeLen=1;$container.hide();_initPageNav();$container.show();function _initPageNav(){var initStr = [];initStr.push('<nav><ul class="'+ className +'" onselectstart="return false">');if(hasFirstBtn)initStr.push('<li class="first-page" value="1"><span>'+ firstText +'</span></li>');if(hasPreBtn)  initStr.push('<li class="pre-page"  value="' + (currentNum - 1) + '"><span>'+ preText +'</span></li>');if(hasNextBtn) initStr.push('<li class="next-page" value="' + (currentNum + 1) + '"><span>'+ nextText +'</span></li>');if(hasLastBtn) initStr.push('<li class="last-page" value="' + pageCount + '"><span>'+ lastText +'</span></li>');if(hasInput)   initStr.push('<div class="input-page-div">当前第<input type="text" maxlength="6" value="' + currentNum + '" />页,共<span>'+ pageCount+ '</span>页<button type="button" class="btn btn-xs input-btn-xs">确定</button></div>');initStr.push('</ul></nav>');$container.html(initStr.join(""));//初始化变量$parent=$container.children().children();if(hasFirstBtn) $firstBtn = $parent.children("li.first-page");if(hasPreBtn)   $preBtn   = $parent.children("li.pre-page");if(hasNextBtn)  $nextBtn  = $parent.children("li.next-page");if(hasLastBtn)  $lastBtn  = $parent.children("li.last-page");if(hasInput){$input  = $parent.find("div.input-page-div>input");$parent.find("div.input-page-div>button").click(function(){_gotoPage($input.val());});}    //初始化功能按钮_buttonToggle(currentNum);//生成普通页码if(hasCommonPage) {_createCommonPage(_computeStartNum(currentNum), currentNum);}//绑定点击事件$parent.on("click", "li",function () {var $this=$(this);if ($this.is("li") && $this.attr("value")){if(!$this.hasClass("disabled") && !$this.hasClass("active")){_gotoPage($this.attr("value"));}}});}//跳转到页码function _gotoPage(targetNum) {targetNum=_formatNum(targetNum);if (targetNum == 0 || targetNum == currentNum) return false;// 跳转前回调函数if (beforeFun && beforeFun(targetNum) === false) return false;//修改值currentNum=targetNum;if(hasInput)   $input.val(targetNum);if(hasPreBtn)  $preBtn.attr("value", targetNum - 1);if(hasNextBtn) $nextBtn.attr("value", targetNum + 1);//修改功能按钮的状态_buttonToggle(targetNum);// 计算起始页码if(hasCommonPage) {var starNum = _computeStartNum(targetNum);if (starNum == minNum) {// 要显示的页码是相同的$currentPage.removeClass("active");$currentPage = $parent.children("li.commonPage").eq(targetNum - minNum).addClass("active");} else {// 需要刷新页码_createCommonPage(starNum, targetNum);}}// 跳转后回调函数if (afterFun) afterFun(targetNum);}//整理目标页码的值function _formatNum(num){num = Number(num);if(isNaN(num)) num=0;else if (num <= 0) num = 1;else if (num > pageCount) num = pageCount;return num;}//功能按钮的开启与关闭function _buttonToggle(current){if (current == 1) {if(hasFirstBtn) $firstBtn.addClass("disabled");if(hasPreBtn)   $preBtn.addClass("disabled");} else {if(hasFirstBtn) $firstBtn.removeClass("disabled");if(hasPreBtn)   $preBtn.removeClass("disabled");}if (current == pageCount) {if(hasNextBtn) $nextBtn.addClass("disabled");if(hasLastBtn) $lastBtn.addClass("disabled");}else {if(hasNextBtn) $nextBtn.removeClass("disabled");if(hasLastBtn) $lastBtn.removeClass("disabled");}}//计算当前显示的起始页码function _computeStartNum(targetNum) {var startNum;if (pageCount <= maxCommonLen)startNum = 1;else {if ((targetNum - minNum) >= (maxCommonLen-changeLen)) {//跳转到靠后的页码startNum = targetNum - changeLen;if ((startNum + maxCommonLen-1) > pageCount) startNum = pageCount - (maxCommonLen-1);// 边界修正} else if ((targetNum - minNum) <= (changeLen-1)) {//跳转到靠前的页码startNum = targetNum - (maxCommonLen-changeLen-1);if (startNum <= 0) startNum = 1;// 边界修正} else {// 不用改变页码startNum = minNum;}}return startNum;}//生成普通页码function _createCommonPage(startNum, activeNum) {var initStr = [];for (var i = 1,pageNum=startNum; i <= pageCount && i <= maxCommonLen; i++ , pageNum++) {initStr.push('<li class="commonPage" value="' + pageNum + '"><a href="javascript:">' + pageNum + '</a></li>');}$parent.hide();$parent.children("li.commonPage").remove();if(hasPreBtn) $preBtn.after(initStr.join(""));else if(hasFirstBtn) $firstBtn.after(initStr.join(""));else $parent.prepend(initStr.join(""));minNum = startNum;$currentPage = $parent.children("li.commonPage").eq(activeNum-startNum).addClass("active");$parent.show();}
}

2.引入paging.css

ul.pagination>li>span,ul.pagination>li>a,ul.pagination>li.active>a,ul.pager>li>span{cursor: pointer;
}
.input-page-div>input{width:5em;
height:1.8em;
margin:0.4em 0.2em 0.2em 0.2em;
text-align: center;
}
.input-page-div>.input-btn-xs{margin-left:1em;
font-size: 1em;
width:3em;
background-color: #337ab7;
color:#fff;
}
.input-page-div{display: inline-block;
margin-left:1em;
}

3.页面中添加一个div容器

<div id="paging"></div>

4.js中添加一段代码

createPageNav({$container : $("#paging"),pageCount : data.pages,currentNum : data.pageNum,afterFun : function(num){getResult(num,10);}
});

例:

function getResult(pageNum,pageSize){$.ajax({type: "GET",url: "../../metrics.do?type=8&pageNum="+pageNum+"&pageSize="+pageSize,data: {},dataType: "json",success: function(data){list = data.data;createPageNav({$container : $("#paging"),pageCount : data.pages,currentNum : data.pageNum,afterFun : function(num){getResult(num,10);}});createList(data.data);
//           createSelect(data);console.info(data);}});
}

后端:
5.引入pagehelper依赖

<!-- yuruixin add mybatis paging --><dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper</artifactId><version>4.1.6</version></dependency><!--也可以直接引入下面依赖--><dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>1.2.3</version></dependency>

6.Mybatis Plus的service层添加如下代码

//pageSize=0时,查询所有
PageHelper.startPage(pageNum, pageSize);
Page<ExtractMetrics> extractMetrics = extractMetricsMapper.selectByCondition(extractMetric,pageNum,pageSize);

7.controller层添加如下代码

Map<String,Object> map = new HashMap<String,Object>();
//查询页数
map.put("pageNum", extractMetrics.getPageNum());//每页条数
map.put("pageSize", extractMetrics.getPageSize());//总条数
map.put("total", extractMetrics.getTotal());//总页数
map.put("pages", extractMetrics.getPages());
map.put("data", extractMetrics.getResult());

至此,bootstrap与pagehelper实现分页流程完毕

效果如下:

上面文章来源于:bootstrap与pagehelper实现分页

个人前端使用了sematic UI,因此简单修改了一下样式,数据处理和展示调用了一下:

//分页,页码导航,要求参数为一个对象
function createPageNav(opt) {opt= opt || {};var $container  = opt.$container || null, //必需,页码容器,请确保这个容器只用来存放页码导航pageCount  = Number(opt.pageCount)  || 0,  //必需,页码总数currentNum  = Number(opt.currentNum) || 1,  //选填,当前页码maxCommonLen = Number(opt.maxCommonLen)|| 10,  //选填,普通页码的最大个数className = opt.className || "pagination",//选填,分页类型:pagination或pager等preText  = opt.preText  || "上一页",   //选填,上一页文字显示,适用于只有前后页按钮的情况nextText = opt.nextText  || "下一页",   //选填,下一页文字,同上firstText = opt.firstText || "首页",lastText = opt.lastText  || "末页",hasFirstBtn = opt.hasFirstBtn  === false ? false : true,hasLastBtn  = opt.hasLastBtn  === false ? false : true,hasPreBtn  = opt.hasPreBtn   === false ? false : true,hasNextBtn  = opt.hasNextBtn  === false ? false : true,hasInput   = opt.hasInput   === false ? false : true,hasCommonPage= opt.hasCommonPage === false ? false : true,//选填,是否存在普通页beforeFun = opt.beforeFun || null, //选填,页码跳转前调用的函数,可通过返回false来阻止跳转,可接收目标页码参数afterFun = opt.afterFun || null, //选填,页码跳转后调用的函数,可接收目标页码参数noPageFun = opt.noPageFun || null; //选填,页码总数为0时调用的函数//当前显示的最小页码,用于计算起始页码,直接容器,当前页,前,后,首,末,输入框var minNum=1,changeLen,$parent,$currentPage,$preBtn,$nextBtn,$firstBtn,$lastBtn,$input;//容器if (!$container || $container.length != 1){console.log("分页容器不存在或不正确");return false;}//总页数if(pageCount <= 0){if(noPageFun) noPageFun();return false;}//当前页if (currentNum < 1) currentNum = 1;else if (currentNum > pageCount) currentNum = pageCount;//普通页码的最大个数,起始页算法限制,不能小于3if(maxCommonLen<3) maxCommonLen=3;//跳转页响应长度,用于计算起始页码if(maxCommonLen>=8) changeLen=3;else if(maxCommonLen>=5) changeLen=2;else changeLen=1;$container.hide();_initPageNav();$container.show();function _initPageNav(){var initStr = [];initStr.push('<nav class="ui mini orange inverted pagination menu"><ul  class="ui mini orange inverted pagination menu '+ className +'" onselectstart="return false">');if(hasFirstBtn)initStr.push('<li class="ui mini item first-page" value="1"><span>'+ firstText +'</span></li>');if(hasPreBtn)  initStr.push('<li class="ui mini item pre-page"  value="' + (currentNum - 1) + '"><span>'+ preText +'</span></li>');if(hasNextBtn) initStr.push('<li class="ui mini item next-page" value="' + (currentNum + 1) + '"><span>'+ nextText +'</span></li>');if(hasLastBtn) initStr.push('<li class="ui mini item last-page" value="' + pageCount + '"><span>'+ lastText +'</span></li>');if(hasInput)initStr.push('<div  class="ui mini item input-page-div">当前第<input type="text" maxlength="6" class="page" value="' + currentNum + '" />页,共<span>'+ pageCount+ '</span>页<a class="ui tiny basic inverted button" id="ensure" style="margin-left:0.2em;background-color:#FFA500;">确定</a></div>');initStr.push('</ul></nav>');$container.html(initStr.join(""));//初始化变量$parent=$container.children().children();// $parent=$container;//alert($parent)if(hasFirstBtn) $firstBtn = $parent.children("li.first-page");if(hasPreBtn)  $preBtn  = $parent.children("li.pre-page");if(hasNextBtn) $nextBtn = $parent.children("li.next-page");if(hasLastBtn) $lastBtn = $parent.children("li.last-page");if(hasInput){$input = $container.find("div.input-page-div>input");$container.find("div.input-page-div>a").click(function(){_gotoPage($input.val());});}//初始化功能按钮_buttonToggle(currentNum);//生成普通页码if(hasCommonPage) {_createCommonPage(_computeStartNum(currentNum), currentNum);}//绑定点击事件$container.on("click", "li",function () {var $this=$(this);if ($this.is("li") && $this.attr("value")){if(!$this.hasClass("disabled") && !$this.hasClass("active")){_gotoPage($this.attr("value"));}}});}//跳转到页码function _gotoPage(targetNum) {targetNum=_formatNum(targetNum);if (targetNum == 0 || targetNum == currentNum) return false;// 跳转前回调函数if (beforeFun && beforeFun(targetNum) === false) return false;//修改值currentNum=targetNum;if(hasInput)  $input.val(targetNum);if(hasPreBtn) $preBtn.attr("value", targetNum - 1);if(hasNextBtn) $nextBtn.attr("value", targetNum + 1);//修改功能按钮的状态_buttonToggle(targetNum);// 计算起始页码if(hasCommonPage) {var starNum = _computeStartNum(targetNum);if (starNum == minNum) {// 要显示的页码是相同的$currentPage.removeClass("active");$currentPage = $parent.children("li.commonPage").eq(targetNum - minNum).addClass("active");}else {// 需要刷新页码_createCommonPage(starNum, targetNum);}}// 跳转后回调函数if (afterFun) afterFun(targetNum);}//整理目标页码的值function _formatNum(num){num = Number(num);if(isNaN(num)) num=0;else if (num <= 0) num = 1;else if (num > pageCount) num = pageCount;return num;}//功能按钮的开启与关闭function _buttonToggle(current){if (current == 1) {if(hasFirstBtn) $firstBtn.addClass("disabled");if(hasPreBtn)  $preBtn.addClass("disabled");}else {if(hasFirstBtn) $firstBtn.removeClass("disabled");if(hasPreBtn)  $preBtn.removeClass("disabled");}if (current == pageCount) {if(hasNextBtn) $nextBtn.addClass("disabled");if(hasLastBtn) $lastBtn.addClass("disabled");}else {if(hasNextBtn) $nextBtn.removeClass("disabled");if(hasLastBtn) $lastBtn.removeClass("disabled");}}//计算当前显示的起始页码function _computeStartNum(targetNum) {var startNum;if (pageCount <= maxCommonLen)startNum = 1;else {if ((targetNum - minNum) >= (maxCommonLen-changeLen)) {//跳转到靠后的页码startNum = targetNum - changeLen;if ((startNum + maxCommonLen-1) > pageCount) startNum = pageCount - (maxCommonLen-1);// 边界修正}else if ((targetNum - minNum) <= (changeLen-1)) {//跳转到靠前的页码startNum = targetNum - (maxCommonLen-changeLen-1);if (startNum <= 0) startNum = 1;// 边界修正}else {// 不用改变页码startNum = minNum;}}return startNum;}//生成普通页码function _createCommonPage(startNum, activeNum) {var initStr = [];for (var i = 1,pageNum=startNum; i <= pageCount && i <= maxCommonLen; i++ , pageNum++) {initStr.push('<li style="list-style-type:none;" class="ui mini item commonPage" value="' + pageNum + '"><a href="javascript:" rel="external nofollow" >' + pageNum + '</a></li>');}$parent.hide();$parent.children("li.commonPage").remove();if(hasPreBtn) $preBtn.after(initStr.join(""));else if(hasFirstBtn) $firstBtn.after(initStr.join(""));else $parent.prepend(initStr.join(""));minNum = startNum;$currentPage = $parent.children("li.commonPage").eq(activeNum-startNum).addClass("active");$parent.show();}
}$(function () {getResult(1,5);
});function getResult(pageNum,pageSize){var token=getToken();$.ajax({type: "GET",url:'/blog/type/get_blogtype.do?token='+token+'&pageNum='+pageNum+"&pageSize="+pageSize,data: {},async: false,//是否缓存结果cache: false,dataType: "json",xhrFields: {withCredentials: true},success: function(data){list = data.data;//具体看后端返回数据格式createPageNav({$container : $("#pageing"),pageCount : list.pages,currentNum : list.pageNum,afterFun : function(num){getResult(num,5);}});createList(data);//展示页面数据console.info(data);}});
}function getToken() {var query = decodeURI(window.location.search.substring(1));var vars = query.split("&");for (var i = 0; i < vars.length; i++) {var pair = vars[i].split("=");if (pair[0] == "token") {return pair[1];}}
}
function editType(row){alert("typeEdit");//编辑按钮var typeName=row.parentNode.parentNode.lastChild.innerHTML;var typename=$("input[name='typename']");typename.innerHTML=typeName;//editType(this);window.location.href="/blog/manage_nav.do?id=4&token="+getToken();
}
function createList(result) {var data=result.data;console.log("分类获取数据:"+data);var dataList=data.list;$("#typetable").empty();//清空for(var i=0;i<dataList.length;i++){$("#typetable").append("<tr>"+"<td>"+dataList[i].id+"</td>"+"<td>"+dataList[i].name+"</td>"+"<td>"+"<a class='ui mini teal button' id='typeEdit' οnclick='editType(this)'>编辑</a>" +"<a class='ui mini red button' id='typeDelete' οnclick='deleteType(this)'>删除</a>"+"</td>")}
}

后端Controller完整:

    @ResponseBody@RequestMapping(value = "/get_blogtype.do",method = RequestMethod.GET)public ServerResponse<PageInfo> getAllBlogType(@RequestParam(name="pageNum",defaultValue = "1",required = false)String pageNum,@RequestParam(name = "pageSize",defaultValue = "5",required = false) String pageSize,@RequestParam(value="token") String token, HttpSession session){BlogUser currentUser=(BlogUser)session.getAttribute(token+session.getId());if(currentUser==null){return ServerResponse.createByErrorCodeMessage(ResponseCode.NEED_LOGIN.getCode(),"用户未登录,请登录");}Integer pageNum1=Integer.parseInt(pageNum);Integer pageSize1=Integer.parseInt(pageSize);//引入分页查询,使用PageHelper分页功能在查询之前传入当前页,然后多少记录PageHelper.startPage(pageNum1, pageSize1);//Integer pageNum,Integer pageSizeList<BlogType> blogTypes=typeService.selectByConditions(pageNum1,pageSize1);//使用PageInfo包装查询结果,只需要将pageInfo交给页面就可以PageInfo pageInfo = new PageInfo<BlogType>(blogTypes, pageSize1);ServerResponse<PageInfo> response=ServerResponse.createBySuccess(pageInfo);return response;}

Mybatis xml中的查询代码:

  <select id="selectByConditions" resultType="com.dl.blog.pojo.BlogType" parameterType="java.lang.Integer" resultMap="BaseResultMap"><bind name="key_offset" value="(pageNum-1)*pageSize"></bind>select<include refid="Base_Column_List" /><!--from blog_type limit #{key_offset},#{pageSize} pagehelper会在startPage时候自动加一个limit,当然是作用于下面挨着的第一个sql语句,这里就不在limit了,否则出错-->from blog_type</select>

ServerResponse是统一后端返回数据格式的一个类,这里给出该类的完整代码,至于其中出现的常量比如ResponseCode.SUCCESS.getCode()可根据个人需求定义一个枚举类来存放。

package com.dl.blog.common;import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;import java.io.Serializable;@JsonSerialize(include =  JsonSerialize.Inclusion.NON_NULL)
//保证序列化json的时候,如果是null的对象,key也会消失
public class ServerResponse<T> implements Serializable {private int status;private String msg;private T data;private int role;private ServerResponse(int status) {this.status = status;}private ServerResponse(int status, T data) {this.status = status;this.data = data;}private ServerResponse(int status, String msg, T data) {this.status = status;this.msg = msg;this.data = data;}private ServerResponse(int status, String msg) {this.status = status;this.msg = msg;}private ServerResponse(int status,int role, String msg, T data) {this.status = status;this.role=role;this.msg = msg;this.data = data;}@JsonIgnore//使之不在json序列化结果当中public boolean isSuccess() {return this.status == ResponseCode.SUCCESS.getCode();}public int getStatus() {return status;}public T getData() {return data;}public String getMsg() {return msg;}public static <T> ServerResponse<T> createBySuccess() {return new ServerResponse<T>(ResponseCode.SUCCESS.getCode());}public static <T> ServerResponse<T> createBySuccessMessage(String msg) {return new ServerResponse<T>(ResponseCode.SUCCESS.getCode(), msg);}public static <T> ServerResponse<T> createBySuccess(T data) {return new ServerResponse<T>(ResponseCode.SUCCESS.getCode(), data);}public static <T> ServerResponse<T> createBySuccess(String msg, T data) {return new ServerResponse<T>(ResponseCode.SUCCESS.getCode(), msg, data);}public static <T> ServerResponse<T> createBySuccess(int role,String msg, T data) {return new ServerResponse<T>(ResponseCode.SUCCESS.getCode(),role, msg, data);}public static <T> ServerResponse<T> createByError() {return new ServerResponse<T>(ResponseCode.ERROR.getCode(), ResponseCode.ERROR.getDesc());}public static <T> ServerResponse<T> createByErrorMessage(String errorMessage) {return new ServerResponse<T>(ResponseCode.ERROR.getCode(), errorMessage);}public static <T> ServerResponse<T> createByErrorCodeMessage(int errorCode, String errorMessage) {return new ServerResponse<T>(errorCode, errorMessage);}
}

枚举类格式:

public enum ResponseCode {SUCCESS(0,"SUCCESS"),ERROR(1,"ERROR"),private final int code;private final String desc;ResponseCode(int code,String desc){this.code = code;this.desc = desc;}//获取状态码public int getCode(){return code;}//获取描述public String getDesc(){return desc;}}

最终页面效果如下:

【SpringBoot+Mybatis】bootstrap/sematic UI与pagehelper实现分页相关推荐

  1. java后台oa项目整套,[VIP源码]【S020】springboot+mybatis+bootstrap开发员工oa后台管理系统项目源码...

    java源码项目名称:springboot+mybatis+bootstrap开发员工oa后台管理系统项目源码springboot项目源码0 `" C+ a" `" ~0 ...

  2. SpringBoot整合Mybatis,使用通用mapper和PageHelper进行分页

    乐哉码农 上节介绍了如何整合Security,这节就说下如何再Springboot下使用持久层框架mybatis和牛人封装的通用mapper与mybatis的整合,直接进入正题吧! 1.首先引入我们需 ...

  3. Java+Springboot+Mybatis+Mysql+Bootstrap+Maven实现网上商城系统

    网上商城系统 一.系统介绍 1.软件环境 2.功能模块图 3.系统功能 4.数据库表 5.SQL语句 6.工程截图 二.系统展示 1.用户-浏览商品 2.用户-注册 3.用户-登录 4.用户-购物车管 ...

  4. SpringBoot Mybatis解决使用PageHelper一对多分页问题

    SpringBoot Mybatis解决使用PageHelper一对多分页问题 参考文章: (1)SpringBoot Mybatis解决使用PageHelper一对多分页问题 (2)https:// ...

  5. Springboot+Mybatis+PageHelper 分页、排序

    Springboot+Mybatis+PageHelper 分页.排序 升序 asc.降序 desc <!-- 继承 spring boot 父包--><parent>< ...

  6. springboot+mybatis plus+code generate+mysql + swagger ui简单demo

    项目基本介绍 该项目使用springboot集成mybatis plus框架,使用mysql数据库,使用maven对代码进行构建,同时引入mybatis plus codegenerate生成enti ...

  7. Swagger - 魔改版本的 bootstrap swagger UI 页面 ,springboot 集成

    文章目录 Swagger - 魔改版本的 bootstrap swagger UI 页面 ,springboot 集成 1.快速开始 2.编写配置类 3.访问地址 4.权限相关 5.404 问题解决 ...

  8. Springboot Mybatis使用PageHelper实现分页查询

    以下介绍实战中数据库框架使用的是mybatis,对整合mybatis此处不做介绍. 使用pageHelper实现分页查询其实非常简单,共两步: 一.导入依赖: pom.xml添加依赖: <!-- ...

  9. Springboot Mybatis使用pageHelper实现分页查询

    以下介绍实战中数据库框架使用的是mybatis,对整合mybatis此处不做介绍. 使用pageHelper实现分页查询其实非常简单,共两步: 一.导入依赖: 二.添加配置: 那么开始, 第一步: p ...

  10. springboot+mybatis 利用PageHelper插件分页,结果第二页的返回分页信息还是和第一页一样。

    正常使用PageHelper来分页时可以的,但是如果在查询list后做了非常多的处理,即解包在装包操作.可能最后返回时分页的数据查询的对,但是分页信息就有问题了.有的甚至分页功能都不行.这里为避免几个 ...

最新文章

  1. MVP Summit 2008 照片纪实(二)- 旧金山,Google总部和Stanford大学
  2. docker nginx 简单的代理设置
  3. IOS 面试 --- 动画 block
  4. java ecdh算法_椭圆曲线ECC ECDH原理 javacard实现
  5. zend studio 远程调试 php
  6. jyphon 环境变量配置
  7. [Android]Volley源代码分析(店)应用
  8. Ubuntu使用VNC运行基于Docker的桌面系统
  9. C++程序员拼命工作却不顾身体,是不值得的!
  10. Python学习 Week2 part1
  11. 顺序栈的基本操作c语言源代码,顺序栈的栈基本操作(C语言版)
  12. mysql连接查询(内联)_MySQL之连接查询
  13. 网络核心之数据交换-电路交换
  14. 计算机病毒实践汇总三:动态分析基础(分析程序)
  15. 扫码点菜系统代码_一顿火锅吃出474万天价?扫码点餐时,千万不要这样做
  16. linux socket 程序被ctrl+c或者异常终止,提示:bind error:Address already in use,解决办法...
  17. 关闭Apple Watch 上的激活锁的方法
  18. 到底什么是嵌入式?什么是单片机?
  19. 自供电面包板----面包板伴侣项目介绍
  20. WebGoat v8.1.0 下载安装(windows)

热门文章

  1. 惠普m227fdw引擎通信错误_惠普打印机HPM227提示耗材余量错误怎么办?
  2. 【图形学】计算网格中两点连成的直线所经过的格子
  3. Tomcat崩溃排查
  4. 基于 Verilog 的经典数字电路设计(10)三态门
  5. 苹果电脑ping 不通本地网络
  6. 字节和兆字节的换算_兆字节(MB)中有多少个字节?
  7. linux 词霸,Ubuntu下使用原版金山词霸
  8. 服务器双路cpu装什么系统,双路服务器CPU是什么意思?双路CPU是什么?
  9. 聊聊校招内推,意义/优缺点/如何抓住机会等
  10. jvm full gc到底是啥意思