<dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>${mybatis-spring-boot-starter}</version>
</dependency>

application.yml里面添加 

mybatis.typeAliasesPackage=com.shxseer.watch.dao
mybatis.mapperLocations=classpath:mapper/*.xml

mapper的xml文件: 

 maven+springboot整合mybatis(十二)

dao和service文件:

maven+springboot整合mybatis(十二)

 这个配置就比较简单,只需要的配置文件里面添加上面俩句话,就可以正常的编写sql的xml了。

相关文章:

  • 2021-09-28
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-11-30
  • 2022-03-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-10-31
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案