当前位置: 首页 > wzjs >正文

功能网站建设宁波网站建设

功能网站建设,宁波网站建设,小公司做网站的实力,济南市病疾情最新信息场景:项目整合mybatis-Plus分页失效,current一直是1,size一直是10,total属性一直是0,数据分页不准 先看官网给的示例: 解决方案是新建mybatis-Plus的配置文件: package com.amc.config;import …

场景:项目整合mybatis-Plus分页失效,current一直是1,size一直是10,total属性一直是0,数据分页不准

先看官网给的示例:

 

 解决方案是新建mybatis-Plus的配置文件:

package com.amc.config;import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;/*** @Author: pangyq* @CreateTime: 2022-12-11  17:36* @Description: mybatisPlus配置* 针对于分页查询失效问题* @Version: 1.0*/
@EnableTransactionManagement
@MapperScan("com.amc.**.mapper")
@Configuration
public class MyBatisPlusConfig {@Beanpublic MybatisPlusInterceptor mybatisPlusInterceptor() {MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();PaginationInnerInterceptor innerInterceptor = new PaginationInnerInterceptor();innerInterceptor.setDbType(DbType.MYSQL);innerInterceptor.setOverflow(true);interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());interceptor.addInnerInterceptor(innerInterceptor);return interceptor;}@Beanpublic ConfigurationCustomizer configurationCustomizer() {return mybatisConfiguration -> mybatisConfiguration.setUseGeneratedShortKey(false);}
}

 响应:

{

    "code": "00",

    "msg": "成功",

    "data": {

        "records": [

            {

                "userId": "1599928568143081472",

                "userName": "admin",

                "nickName": "张三",

                "userType": "00",

                "email": "23*****405@qq.com",

                "phoneNumber": "184****6521",

                "sex": "0",

                "avatar": "http://xxxx",

                "password": "uLRrSaBv+ERnSHOw9Yge9A==",

                "birthday": null,

                "townId": null,

                "townName": "",

                "countyId": null,

                "countyName": "",

                "provinceId": null,

                "provinceName": "",

                "cityName": "",

                "cityId": null,

                "detailAddress": "山东省济南市历下区",

                "status": "0",

                "delFlag": "0",

                "loginIp": "",

                "loginDate": null,

                "createBy": "",

                "createTime": "2022-12-06T00:47:50.000+0000",

                "updateBy": "",

                "updateTime": null,

                "remark": "这是注册用户测试",

                "tenantId": "-1",

                "revision": null

            }

        ],

        "total": 1,

        "size": 1,

        "current": 1,

        "orders": [],

        "optimizeCountSql": true,

        "hitCount": false,

        "countId": null,

        "maxLimit": null,

        "searchCount": true,

        "pages": 1

    }

}

至此,分页方案解决完毕!!!

http://www.dtcms.com/wzjs/241005.html

相关文章:

  • 广州网页设计公司排名一键优化免费下载
  • 专业做外贸的网站萧山seo
  • 找人做网站需要注意什么什么是网络整合营销
  • 做展板好的网站企业网站推广公司
  • wordpress百度地图沈阳seo顾问
  • 长沙网站开发的网站厦门关键词优化企业
  • 男人和女人做污的视频网站深圳网络营销推广招聘网
  • 帮客户做传销网站360网站推广费用
  • 给银行做网站aso优化是什么
  • 织梦做的网站首页打不开seo内部优化方式包括
  • 网站页面做互联网推广软件
  • 财务管理做的好的门户网站搜狐新闻手机网
  • 校园类网站模板网页设计制作
  • 市场营销策划案重庆优化seo
  • 中英文网站怎么做的厦门人才网招聘
  • 天河区住房和建设水务局官方网站软文之家
  • 学校 网站建设工作小组哈尔滨网络seo公司
  • 特色网站建设免费优化
  • 做最好的导航网站十大管理培训课程
  • 网站搭建合同房地产销售怎么找客户
  • 网站建设要程序员吗大数据培训
  • 威海做企业网站的公司企业网站管理系统
  • aspcms手机网站源码百度商家怎么入驻
  • 南京建设网站哪家好优化营商环境应当坚持什么原则
  • html5网站源码phpseo托管服务
  • 网站建设项目职责新闻式软文经典案例
  • php学完可以做网站互联网项目
  • 线上推广是做什么的淘宝seo搜索排名优化
  • 合肥建设厅网站黄页推广平台有哪些
  • 太原做网站页面的seo是指搜索引擎优化