-
Pom.xml添加依赖
引入mybatis-plus依赖,可以直接使用mybatis,不用在引入mybatis依赖
<!--mybatis-plus依赖-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.1</version>
</dependency>
-
Mapper层集成BaseMapper
实现类注入相应mapper,便可使用相应方法
避免数据库映射实体类下划线问题,可以在配置文件中添加:
map-underscore-to-camel-case: true #数据库映射实体驼峰命名