JAVA全系列 教程
3762个小节阅读:7094.6k
目录
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
xxxxxxxxxx
<dependencies>
<!-- 引入 pojo 工程-->
<dependency>
<groupId>com.itbaizhan</groupId>
<artifactId>pojo</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- Mybatis plus 依赖 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<!--MySQL 数据库依赖 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
引入Mapper依赖
xxxxxxxxxx
<dependency>
<groupId>com.itbaizhan</groupId>
<artifactId>mapper</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
xxxxxxxxxx
################ 配置MySQL数据源 ##############
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.168.66.100:3306/itbaizhan?serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=123456
在 SpringBoot 启动类中添加 @MapperScan
注解,扫描 Mapper 文件夹:
xxxxxxxxxx
@SpringBootApplication
@MapperScan("com.itbaizhan.mapper")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}