package com.example; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; //通过使用@MapperScan可以指定要扫描的Mapper类的包的路径 @MapperScan("com.example.mapper") //扫描的mapper @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } }