Springboot uses the basemapper method of mybatisplus, but prompts that the error reporting method does not exist

Alibaba cloud Q & A 2022-02-13 07:03:38 阅读数:735

springboot uses basemapper method mybatisplus

The error information is as follows : Invalid bound statement (not found): com.tech.transport.mapper.EmployeeMapper.selectOne

 This is a service Interface implementation class of layer @[email protected](readOnly = true,propagation = Propagation.SUPPORTS)public class EmployeeServiceImpl extends ServiceImpl implements IEmployeeService {@Overridepublic Employee login(String username, String password) { return baseMapper.selectOne(new QueryWrapper<Employee>() .eq("username",username) .eq("password",password));}} This is a [email protected] interface EmployeeMapper extends BaseMapper {} This is a [email protected] class LoginController {@Autowiredprivate IEmployeeService employeeService; @PostMapping("/login")@ApiOperation(value = " Login interface " + "")public AjaxResult login(@RequestBody Map<String,Object> params){ String username = (String) params.get("username"); String password = (String) params.get("password"); Employee employee = employeeService.login(username,password); if(null!=employee){ // Login successful return AjaxResult.me(); } // Login failed return AjaxResult.me().setSuccess(false).setMessage(" Wrong user name or password !");}

Why call basemapper Of selectOne Method , But it will report an error employeeMapper Can't find selectOne

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130703368815.html