作者在 2021-07-17 00:07:50 发布以下内容
办法一:
给XXMapper.java加上Mapper注解,如:
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ArticleMapper extends BaseMapper<ArticleEntity> {
}
办法二:
给启动类加上MapperScan注解,如:
import org.mybatis.spring.annotation.MapperScan;
@SpringBootApplication
@MapperScan("com.example.**.mapper")
public class BlogApplication {
public static void main(String[] args) {
SpringApplication.run(BlogApplication.class, args);
}
}