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

网站制作经典案例国内设计公司前十名

网站制作经典案例,国内设计公司前十名,建设工程施工许可证在哪个网站办,建设网站的方案SpringBoot之整合PageHelper分页插件 文章目录 SpringBoot之整合PageHelper分页插件1. 引入坐标2. application.yml配置3. 基本使用4. 对多个查询执行分页1. 默认第一个Select语句会执行分页2. 让Pagehelper也能执行多个分页的方法3. 完整案例 详细配置请查看官网或MyBatis分页…SpringBoot之整合PageHelper分页插件 文章目录 SpringBoot之整合PageHelper分页插件1. 引入坐标2. application.yml配置3. 基本使用4. 对多个查询执行分页1. 默认第一个Select语句会执行分页2. 让Pagehelper也能执行多个分页的方法3. 完整案例 详细配置请查看官网或MyBatis分页插件之PageHelper详细介绍-CSDN博客 1. 引入坐标 !--pagehelper--dependencygroupIdcom.github.pagehelper/groupIdartifactIdpagehelper-spring-boot-starter/artifactIdversion1.3.0/version!--排除pagehelper的依赖mybatis和mybatis-spring的jar包以免与mybatis-plus的冲突导致报NoClassFound org.mybatis.logging.LoggerFactory--exclusionsexclusiongroupIdorg.mybatis/groupIdartifactIdmybatis/artifactId/exclusionexclusiongroupIdorg.mybatis/groupIdartifactIdmybatis-spring/artifactId/exclusion/exclusions/dependency2. application.yml配置 pagehelper:helper-dialect: mysqlreasonable: truesupport-methods-arguments: trueparams: countcountSql3. 基本使用 Autowiredprivate PublicService publicService; GetMapping(value /getUserList)public ResultPageInfo getUserList(RequestParam(namepageNo, defaultValue1) Integer pageNo,RequestParam(namepageSize, defaultValue5) Integer pageSize){StringBuffer sql new StringBuffer();sql.append(SELECT\n a.id,\n a.username,\n b.id AS file_id,\n b.file_url,\n b.file_size,\n FROM\n sys_user a\n LEFT JOIN sys_file b ON a.id b.parent_id \n WHERE\n a.del_flag 0);Result result new Result();Map map new HashMap(5);map.put(sql,sql.toString());//获取第pageNo页pageSize条内容默认查询总数countPageHelper.startPage(pageNo, pageSize);//紧跟着的第一个select方法会被分页ListMapString, Object mapList publicService.sqlQuery(map);result.setResult(mapList);result.setSuccess(true);PageInfo pageInfo new PageInfo(mapList);return Result.OK(pageInfo);4. 对多个查询执行分页 Pagehelper中只有紧跟在 PageHelper.startPage 方法后的第一个 Mybatis 的查询Select方法会被分页。 1. 默认第一个Select语句会执行分页 案例代码如下 Autowired private PublicService publicService;public ListSignatureUser getUserList(){//获取第pageNo页pageSize条内容默认查询总数countPageHelper.startPage(pageNo, pageSize);//紧跟着的第一个select方法会被分页ListMapString, Object mapList publicService.sqlQuery(map);IPage iPage IPageUtil.pageData(mapList);//下面这个查询不会分页ListSignatureUser signatureUserList publicService.getSignatureUserList(map);System.out.println(signatureUserList.size());return signatureUserList; }2. 让Pagehelper也能执行多个分页的方法 在查询参数中设置pageNum与pageSize参数使其第二个查询也能分页如下 Autowired private PublicService publicService; public ListSignatureUser getUserList(){//获取第pageNo页pageSize条内容默认查询总数countPageHelper.startPage(pageNo, pageSize);//紧跟着的第一个select方法会被分页ListMapString, Object mapList publicService.sqlQuery(map);IPage iPage IPageUtil.pageData(mapList);System.out.println(第一个查询分页结果,iPage);Map map1 new HashMap(3);//加入mybatis分页的参数pageNum与pageSize则其他查询也能分页map1.put(pageNum, pageNo);map1.put(pageSize, pageSize);ListSignatureUser signatureUserList publicService.getSignatureUserList(map1);System.out.println(signatureUserList.size());return signatureUserList; }3. 完整案例 Autowiredprivate PublicService publicService; ApiOperation(value 用户信息列表, notes 用户信息列表)GetMapping(value /getUserList)public Result? getUserList(RequestParam(namepageNo, defaultValue1) Integer pageNo,RequestParam(namepageSize, defaultValue5) Integer pageSize){StringBuffer sql new StringBuffer();sql.append(SELECT\n a.id,\n a.username,\n b.id AS file_id,\n b.file_url,\n b.file_size,\n FROM\n sys_user a\n LEFT JOIN sys_file b ON a.id b.parent_id \n WHERE\n a.del_flag 0);//一.直接sql方式分页Map map new HashMap(5);map.put(sql,sql.toString());//获取第pageNo页pageSize条内容默认查询总数countPageHelper.startPage(pageNo, pageSize);//紧跟着的第一个select方法会被分页ListMapString, Object mapList publicService.sqlQuery(map);IPage iPage IPageUtil.pageData(mapList);//return Result.OK(iPage);//二.对象集合分页Map map1 new HashMap(3);map1.put(pageNum, pageNo);map1.put(pageSize, pageSize);ListSignatureUser signatureUserList publicService.getSignatureUserList(map1);System.out.println(signatureUserList.size());return Result.OK(IPageUtil.pageData(signatureUserList));}
http://www.dnsts.com.cn/news/126759.html

相关文章:

  • wordpress网站布置网站备案 游戏
  • 网站建设技术服务的方式是什么无法进入网站后台
  • 淘宝内部优惠券网站怎么建设蜂鸟 网站建设
  • 建站公司 phpwind3d网站建设制作
  • 哈尔滨整站优化自豪地采用wordpress更改
  • 自学网站2345浏览器主页网址
  • 布吉网站开发凡科网站设计模板
  • 建设公司网站的原则wordpress前端发送后端
  • 平江网站建设医疗网站模板
  • 网站建设与维护专业百度竞价托管外包
  • 博罗网站建设哪个酒店网站做的好看的
  • 阿里云网站方案建设书网页生成pdf保存到哪里了
  • 上海做机床的公司网站什么是flash网站
  • 有自己的网站怎么做淘宝客建设红外测温仪网站
  • 石材公司网站做网站需要提供的资料
  • 上海企业名录大全官网seo服务器选择
  • 深圳建设资格注册中心网站部分网站dns解析失败
  • 做服装搭配直接售卖的网站扬州网站seo
  • 做网站比较好的软件晋中集团网站建设
  • 山东建设厅官方网站兰溪网站建设
  • 数码家电商城网站源码房地产系统软件
  • 游戏平台网站建设网页设计及网站建设的相关概念
  • 做网站的 简历龙口网站建设公司
  • 网站推广与宣传怎么做定制开发小程序价格
  • 建什么网站好网站开发一般需要多久
  • 南山住房和建设局网站官网百度pc权重
  • 网站制作公司石家庄北京装修公司电话名单
  • 网站建设服务合同交印花税吗蛋糕网站建设规划书
  • 企业网站运营什么是做自己的网站
  • 石材外贸网站网站做优化有必要吗