mybatis-spring-boot-autoconfig中包含有MybatisAutoConfiguration
其中注入了SqlSessionFactory与SqlSessionTemplate(SqlSessionTemplate中封装了SqlSessionFactory),还有MapperScannerRegistrarNotFoundConfiguration,MapperScannerRegistrarNotFoundConfiguration上面有Import AutoConfiguredMapperScannerRegistrar的注解,AutoConfiguredMapperScannerRegistrar中的registerBeanDefinitions指定了ClassPathMapperScanner去扫描带有Mapper注解的bean进行处理。
DefaultSqlSessionFactory调用OpenSqlSession会创建DefaultSqlSession,DefaultSqlSession会持有configuration和executor,其中configuration可以获取MappedStatement,例如执行selectList时会使用executor配合获取到的MappedStatement去进行查询。