mybatis 找不到mapper的问题
Posted 波子汽水yeah
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis 找不到mapper的问题相关的知识,希望对你有一定的参考价值。
报错
exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mb.sleep.sleep.dao.mapper.UserInfoMapper.findOneres] with root cause
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.mb.sleep.sleep.dao.mapper.UserInfoMapper.findOneres
终极原因 使用了mybatis-plus需要配置 mapper-locations
mybatis-plus:
global-config:
db-config:
id-type: auto
field-strategy: not_empty
#驼峰下划线转换
column-underline: true
#逻辑删除配置
logic-delete-value: 0
logic-not-delete-value: 1
db-type: mysql
refresh: false
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
mapper-locations: classpath:mapper/*.xml
查找数据库中是否存在的问题
public interface UserInfoMapper extends TKBaseMapper<UserInfo>
Integer findOneres(@Param("id") String id);
UserInfoMapper.xml
<select id="findOneres" resultType="java.lang.Integer">
select 1 from user_info where member_id=#id
</select>
可能因为缓存的原因,之前一直没有返回 注意clean一下
以上是关于mybatis 找不到mapper的问题的主要内容,如果未能解决你的问题,请参考以下文章