When running the project, use the idea breakpoint and report the error org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.springboot.userlogin.springbootdemo.dao.UserDao.getUserByMassage
Reason: There is a problem when mapping and binding the dao interface and mapper configuration file in mybatis, that is, the interface and xml are either not found, or they are found but cannot match.
Troubleshooting method:
1. Whether the annotation @Mapper is used on the mapper.java file or whether the Mapper class @MapperScan("com.heima.model.mappers") is scanned on the startup class [note whether the scanned package name is correct]< /span>
2. Pay attention to whether the namespace in the mapper.xml file correctly points to the location of the Mapper.java class []
3. Pay attention to the consistency of the called method name in mapper.xml with the id in dao.java
4. Pay attention to the parameterType of the mapper.xml method
5. Note that dao.java needs to be injected with @Autowired where it is called
6. The mapper mapping file needs to add the xml suffix