依赖配置
yml配置-- xml资源过滤 org.springframework.boot spring-boot-starter-web org.mybatis.spring.boot mybatis-spring-boot-starter 2.2.0 org.springframework.boot spring-boot-devtools runtime true mysql mysql-connector-java 5.1.45 org.projectlombok lombok true org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-starter-tomcat c3p0 c3p0 0.9.1.2 src/main/java **** org.springframework.boot spring-boot-maven-plugin org.projectlombok lombok
server:
port: 80
spring:
datasource:
url: jdbc:mysql://localhost:3306/smbms?characterEncoding=utf-8
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
mvc:
view:
prefix: /WEB-INF/jsp/
suffix: .jsp
mybatis:
mapper-locations: classpath:cn/chy/com/main/mapper/*.xml
type-aliases-package: classpath:cn/chy/com/main/pojo
configuration:
auto-mapping-behavior: full
#mapper-locations: classpath:cn/chy/com/main/mapper/*.xml配置也行吧 或者 启动类上@MapperScan
好了,最后在每个Mapper接口上定义@Mapper 注解 或 在启动类上添加 @MapperScan() 扫描



