我的Mapper采用接口+注解的方式注入

@Repository(value="customerServOutCallMapper")
public interface CustomerServOutCallMapper {
    public int batchInsertMap(List<Map<String,Object>> list);
}

配置文件采用.xml

问题的本质是从接口的方法映射到要执行的sql时失败了,原因通常是配置文件有误:

1.spring配置文件错误,spring的mabatis配置文件中

<bean >  <value>classpath*:mybatis/mapper/*Mapper.xml</value>
            </list>
        </property>
    </bean>

红色的这一行最好配全路径,我的问题就是这个原因(这是在另一个项目不配全路径也没问题,还没搞明白)

2.mapper.xml文件
<mapper namespace="com.xxxx.data.customerserv.outcall.dao.CustomerServOutCallMapper">

namespace是dao所在报名+类名

 

相关文章:

  • 2021-04-26
猜你喜欢
  • 2022-12-23
  • 2021-12-25
  • 2021-07-08
  • 2021-04-19
  • 2021-05-03
  • 2021-05-14
相关资源
相似解决方案