title: Passing parameter to MyBatis @Select
body: <p>I am writing my fist MyBatis application and I stuck around @Select. I do not know what is the problem with my @Select definition, everything seems fine but I got a <code>Parameter not found</code> exception.</p>
  
  <p>I have followed the same pattern when I pass parameters to my my @Insert statement and it works without problem. </p>
  
  <p>I use MyBatis 3.4.2.</p>
  
  <p><strong>This is my @Select:</strong></p>
  
  <pre><code>@Select("SELECT * "
          + "FROM configuration "
          + "WHERE key_name = #{key} AND "
          +       "(#{userId} IS NULL AND user_id IS NULL) OR user_id = #{userId} AND "
          +       "status = 1")
  Configuration findByKeyAndUserId(String key, Long userId);
  </code></pre>
  
  <p><strong>The exception what I got:</strong></p>
  
  <pre><code>org.apache.ibatis.exceptions.PersistenceException: 
  ### Error querying database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'key' not found. Available parameters are [arg1, arg0, param1, param2]
  ### Cause: org.apache.ibatis.binding.BindingException: Parameter 'key' not found. Available parameters are [arg1, arg0, param1, param2]
  </code></pre>