title: How to use dynamic SQL query in MyBatis with annotation(how to use selectProvider)?
body: <p>I am trying to avoid having an additional xml to define the mapper in mybatis3. Annotation fits right in. </p>
  
  <p>I am a bit confused by the usage of @SelectProvider/@InsertProvider/etc. Don't think there are many resources online guiding me through this.</p>
  
  <p>Basically, I will like to find the annotation version of alternative for  in mybatis3.</p>
  
  <p>For example, I have a xml mapper and I wanna convert it to use annotation</p>
  
  <pre><code>&lt;select ...&gt;
    &lt;where&gt;
      &lt;if cause.....&gt;
      &lt;/if&gt;
      &lt;if cause......&gt;
      &lt;/if&gt;
    &lt;/where&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Could anyone provide a concrete answer/solution including the code?</p>
  
  <p>Thanks in advance!</p>