第一步:搭建项目
mybatis-plus包:
<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.4.2</version> </dependency>
第二步:编写application.yml文件
#指定端口号 server: port: 8080 #配置数据源 spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf-8&serverTimezone=UTC data-username: root data-password: #配置模板引擎 thymeleaf: mode: HTML5 cache: false prefix: classpath:/templates/ suffix: .html mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启日志 global-config: banner: false #隐藏图标
第三步:pojo,dao,service,controller
pojo