SpringBoot实现分页查询操作()

刚才我们已经成功引入了layui框架,现在我们来实现查询操作。
首先我们先看一下项目的application.yml里面写的配置。
注意一下数据库名称

#配置数据源
spring:
  datasource:
    username: root #用户名
    password: root #密码
    driver-class-name: com.mysql.jdbc.Driver #驱动
    url: jdbc:mysql://127.0.0.1:3306/bohua?useUnicode=true&characterEncoding=utf-8 #路径
    druid:
      max-active: 100
      max-wait: 10000
      initial-size: 5
      min-idle: 10
#端口号
server:;
  port: 8080
  #解决德鲁伊配置冲突
beetlsql:
  enabled: false
  #指定mapper配置文件
mybatis:
  mapper-locations: classpath:mapper/*.xml
  #beetl的后缀
beetl:
  suffix: html
  #bybatis分页插件配置
  pagehelper:
    helper-dialect: mysql  #数据库
    reasonable: true
    support-methods-arguments: true
    params: count=countSql

然后我们在确认一下pom文件里面的包

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <groupId>com.bohua</groupId>
   <artifactId>bohua-parent</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <packaging>jar</packaging>

   <name>bohua-parent</name>
   <description>admin-template</description>

   <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>2.0.5.RELEASE</version>
      <relativePath/> <!-- lookup parent from repository -->
   </parent>

   <properties>
      <project.build.sourceEncoding>UTF-8</projec
  • 5
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值