mybatisplus新手配置总结

1、pom


        <dependency>
            <groupId>com.baomidougroupId>
            <artifactId>mybatis-plusartifactId>
            <version>3.3.2version>
        dependency>
        <dependency>
            <groupId>com.baomidougroupId>
            <artifactId>mybatisplus-spring-boot-starterartifactId>
            <version>1.0.5version>
        dependency>
        <dependency>
            <groupId>com.baomidougroupId>
            <artifactId>mybatis-plus-boot-starterartifactId>
            <version>3.3.2version>
        dependency>
 

2、Application启动类

@SpringBootApplication
// 此配置是必须的,扫描mapper,否则项目启动报错
@MapperScan("com.lagou.edu.mapper")
@EntityScan("com.lagou.edu.pojo")
public class LagouApplication {
    public static void main(String[] args) {
        SpringApplication.run(LagouApplication .class, args);
    }
}

3、application.yml

mybatis-plus:
  # 配置mapper所在路径
  mapper-locations: classpath:mapper/*.xml
  configuration: # 打印sql
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    map-underscore-to-camel-case: true

你可能感兴趣的:(mybatis,mybatisplus)