Mybatis-plus binding error prompts the solution of BindingException: Invalid bound statement
The general reason is that the definition of the Mapper interface and the xml file do not match, and it is necessary to check whether the package name, namespace, function name, etc. can match.
Follow the steps below to execute one by one:
1. Check whether the package name of the xml file is in one-to-one correspondence with the package name corresponding to the interface
2. Check whether the namespace of the xml file corresponds to the package name of the xml file one by one
3. Check whether the function name can correspond to
4. Remove the Chinese comments in the xml file
5. Feel free to add a space or blank line in the xml file and save it
If the above steps are checked, the pom.xml file will be checked abnormally
Check if the following content has been added
Note: When developing with IDEA, if *Mapper.xml is not automatically copied to the mapper class package in the class output directory when packaging, you need to add the configuration of mybatis loading configuration file in the pom file!
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*Mapper.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</build>