記錄springboot 3.3.5 版本整合 mybatis-plus

仅此忆念發表於2024-11-06

如果mybatis plus 配置的版本過低的話可能會報錯:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxx.xxx.xxx.xxxDao.xxxx

pom檔案匯入

<!--mybatisPlus-->  
<dependency>  
    <groupId>com.baomidou</groupId>  
    <artifactId>mybatis-plus-boot-starter</artifactId>  
    <version>3.5.5</version>  
</dependency>  
  
<dependency>  
    <groupId>org.mybatis</groupId>  
    <artifactId>mybatis-spring</artifactId>  
    <version>3.0.3</version>  
</dependency>

yaml 檔案

#mybaits  
mybatis:  
  mapper-locations: classpath:mapper/*Mapper.xml  # 例LoginMApper.xml 可根據自己的情況配置
  type-aliases-package: com.xxx.entity  
  configuration:  
    map-underscore-to-camel-case: true  
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  
  
  
#mybaits-plus  
mybatis-plus:  
  type-aliases-package: com.xxx.entity  #entity 的路徑  
  global-config:  
    banner: false  
  configuration:  
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

相關文章