springboot集成mybatis
1、在pom文件中引入依赖 2、创建启动类 1 import org.mybatis.spring.annotation.MapperScan; 2 import org.springframework.boot.SpringApplication; 3 import org.springframework.boot.autoconfigure.SpringBootApplication; 4 5 /** 6 * Spring Boot启动类. 7 */ 8 @SpringBootApplication 9 @MapperScan("com.包名.*")//扫描:该包下相应的class,主要是MyBatis的持久化类.Mapper 10 public class App { 11 public static void main(String[] args) { 12 SpringApplication.run(App.class, args); 13 } 14 } 3、在application.properties添加配置文件 4、编写Demo实体类 5、编写DemoMapper接口 1 import java.util.List; 2 3 import org.apache.ibatis.annotations.Insert; 4 import org.apache.ibatis