通常有两种原因,配置原因,或者是mapper相关文件,mapper.java或 mapper.xml内部错误

如果是配置原因

解决方式1

统一配置mapper

//import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
@MapperScan("com.example.mybatisplus.mapper") //把这个加上,别写上正确的路径,如果是模块化一般路径为@MapperScan("com.kfit.*.mapper")  
public class Application {

    public static void main(String[] args){
System.out.println("hahahaha");
SpringApplication.run(Application.class, args);
} }

解决方式2

每个mapper文件配置@Mapper

package com.example.mybatisplus.mapper;

//import org.apache.ibatis.annotations.Mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.example.mybatisplus.entity.Person;
@Mapper //每个文件配置这个
public interface PersonMapper extends BaseMapper<Person> {
Integer listCount();
Person findPersonById(Integer id);
}

两者可以结合使用

最新文章

  1. Velocity初探小结--velocity使用语法详解
  2. Webpack中hash与chunkhash的区别,以及js与css的hash指纹解耦方案
  3. 在IIS7.5中ASP.NET调用cmd程序拒绝访问决绝方法小记
  4. windows查看端口占用以及关闭相应的进程
  5. springmvc自定义日期编辑器
  6. 虚拟机安装CentOS6.3两个问题
  7. Volley HTTP库系列教程(5)自定义一个Volley请求
  8. Linux磁盘占用100%解决方法
  9. poj3067
  10. 转:Unicode字符集和多字节字符集关系
  11. keepalive support-----Programming applications
  12. 使用 Spring Data JPA 简化 JPA 开发
  13. Analyzing UI Performance with Systrace 使用systrace工具分析ui性能
  14. CSS3 动画触发事件
  15. Week 5a - Mouse input and more lists ----mouse input
  16. List&lt;T&gt;集合导出csv方法参考,通过增加自定义的属性控制输出的字段。
  17. VisualSVN 5.1.7破译License Key
  18. JS_正则表达式_获取指定字符之后指定字符之前的字符串
  19. Android dp、dip、dpi、px、sp简介及相关换算,及其应用实例
  20. 翻译下 golang package time

热门文章

  1. 20191011-构建我们公司自己的自动化接口测试框架-Config配置
  2. 【5号课堂】scratch制作电子生日贺卡
  3. shell习题第27题:带选项的增删用户脚本
  4. Django-redis配置cache和session
  5. eclipse怎样修改同名包(package)的显示样式、格式
  6. 基因组所三代单分子测序PacBio完成技术升级—超长读长助力基因组学研究
  7. 路由器开源系统openwrt配置页面定制
  8. ASP.NET WEB应用程序(.network4.5)MVC Razor视图引擎2 动态数据的呈现
  9. vue html属性绑定
  10. linux环境安装docker,部署应用