除了网上提到的大部分原因
也可能是写配置文件时,出现问题,如图新建xml文件
application中的mybatis配置信息
## Mybatis 配置
mybatis.typeAliasesPackage=org.spring.springboot.pojo
mybatis.mapperLocations=classpath:mapper/*.xml
Xml文件后缀名要补齐:不能写成cityMapper而应写成cityMapper.xml。否则在application配置信息中搜索xml文件时搜索不到