title: Mybatis : Invalid bound statement (not found)
body: <p>Recently I'm using Mybatis to connect to mysql database and I'm working on my second project using Springboot.</p>
  <p>I checked many times, including：</p>
  <ol>
  <li>check if the mapper-locations path in application.yml is correct</li>
  <li>checking whether the package name where the xml file is located corresponds to the package name where the Mapper interface is located.</li>
  <li>checking whether the namespace of the xml corresponds to the package name of the xml file.
  4.Check whether the method names correspond to each other.</li>
  </ol>
  <p>When I was designing the login module, I encountered the error:</p>
  <pre><code>org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sex.yp.mapper.UserMapper.UserquerybyEmail
  </code></pre>
  <p>This is the login logic I designed :</p>
  <pre><code>@Controller
  public class LoginController {
  @Autowired
  private UserMapper UserMapper;
  
  @RequestMapping(&quot;/login1&quot;)
  public String login(@RequestParam(&quot;email&quot;) String email,
                      @RequestParam(&quot;password&quot;) String password,
                      Model model){
  
      user user = UserMapper.UserquerybyEmail(email);
      if(user==null) {
          return &quot;/404&quot;;
      }
      else if(user.getPassword().equals(password)){
          return &quot;/index&quot;;
      }else
          return &quot;/login&quot;;
  
  }
  </code></pre>
  <p>This is UserMapper.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
  &lt;!DOCTYPE mapper
      PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
      &quot;http://mybatis.org/dtd/mybatis-3-mapper.dtd&quot;&gt;
  &lt;mapper namespace=&quot;com.sex.yp.mapper.UserMapper&quot;&gt;
  
  &lt;select id=&quot;queryUserList&quot; resultType=&quot;user&quot;&gt;
      select * from user
  &lt;/select&gt;
  
  &lt;select id=&quot;UserquerybyEmail&quot; resultType=&quot;user&quot;&gt;
      select * from user where email = #{email}
  &lt;/select&gt;
  
  &lt;insert id=&quot;adduser&quot; parameterType=&quot;int&quot;&gt;
      insert into user (email,password,level,sex,id,age,self_inform)
      values (#{email},#{password},#{level},#{sex},#{id},#{age},#{self_inform})
  &lt;/insert&gt;
  
  &lt;update id=&quot;updateuser&quot; parameterType=&quot;int&quot;&gt;
      update user set password = #{password} where email = #{email}
  &lt;/update&gt;
  
  &lt;delete id=&quot;deleteuser&quot; parameterType=&quot;int&quot;&gt;
      delete from user where email = #{email}
  &lt;/delete&gt;
  </code></pre>
  
  <p>This is UserMapper:</p>
  <pre><code>package com.sex.yp.mapper;
  import com.sex.yp.pojo.user;
  import org.apache.ibatis.annotations.Mapper;
  import org.springframework.stereotype.Repository;
  import java.util.List;
  @Mapper
  @Repository
  public interface UserMapper {
  
  List&lt;user&gt; queryUserList();
  user UserquerybyEmail(String email);
  int adduser(user user);
  int updateuser(user user);
  int deleteuser(String email);
  }
  </code></pre>
  <p>My application.yaml:</p>
  <pre><code>spring:
    datasource:
      username: root
      password: 123456789
    initialSize: 5
    minIdle: 5
    maxActive: 20
    maxWait: 60000
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 300000
    validationQuery: SELECT 1 FROM DUAL
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true
  
    filters: stat,wall,log4j
    maxPoolPreparedStatementPerConnectionSize: 20
    useGlobalDataSourceStat: true
    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
  
  mybatis:
    type-aliases-package: com.sex.yp.pojo
    mapper-locations:
      classpath*: mybatis/mapper/*.xml
  </code></pre>
  <p>my pom.xml:</p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;com.sex&lt;/groupId&gt;
  &lt;artifactId&gt;yp&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;yp&lt;/name&gt;
  &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.6.3&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;!--lombok--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;!--thymeleaf引擎模板--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.mybatis.spring.boot&lt;/groupId&gt;
          &lt;artifactId&gt;mybatis-spring-boot-starter&lt;/artifactId&gt;
          &lt;version&gt;2.1.1&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;src/main/java&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/*.xml&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
  
  
  &lt;/build&gt;
  </code></pre>
  
  <p>i need help!</p>