欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Mapped Statements collection does not contain value for

程序员文章站 2022-07-15 12:14:29
...

Spring Boot

异常信息:

Mapped Statements collection does not contain value for 
com.test.test.member.mapper.mysql.ClientMapper.queryClientById2

#映射语句集合不包含com.test.test.member.mapper.mysql.ClientMapper.queryclientbyid2的值
-->也就是说找不到这个ClientMapper的queryClientById2方法

代码信息:

@Select("select * from test.order_dealer where order_no=#{orderNo}")
    @Results({
            @Result(column = "client_id", property = "client",
                    one = @One(
 select ="com.test.test.member.mapper.mysql.ClientMapper.queryClientById2",
                            fetchType = FetchType.DEFAULT
                    )
            )
    })
public Order queryOrderByOrderNo(...);

错误修改:(未找到Mapper层,启动类中添加该Mapper到MapperScan)

@SpringBootApplication
@EnableTransactionManagement
@MapperScan({
"com.test.test.system.mapper.mysql",
"com.test.test.quotation.mapper.mysql",
"com.test.test.product.mapper.mysql",
"com.test.test.task.mapper.mysql",
"com.test.test.order.mapper.mysql",
"com.test.test.member.mapper.mysql"})
public class CloudhomeApplication {
   .....
}

 

相关标签: SpringBoot