how to solve Invalid bound statement (not found): com.demo.userCenter.service.UserService.getBaseMapper

313 Views Asked by At
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.demo.userCenter.mapper.UserMapper">

</mapper>


@Mapper
public interface UserMapper extends BaseMapper<User> {

}

@RestController
@RequestMapping("/user")
public class UserController {
    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    /**
     * 获取user列表
     */
    @PostMapping("/getUserList")
    public List<User> getUserList() {
        return userService.list();
    }
}

public interface UserService extends IService<User> {

}

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {


}

I reported this error when calling getUserList

I have tried various solutions, such as configuration files and annotations, and I have used the correct one, but I still reported an error in the end. I hope someone can help me, thank you

1

There are 1 best solutions below

1
TomShiDi On

Do you use @MapperScan annotations ?

if so,then you need to remove it.

This usage causes mybatis-plus to repeat scans.