title: How to compare strings in mybatis 3 with if statement - dynamic sql
body: <p>In myBatis 3 how do you compare a string when using dynamic sql?</p>
  
  <p>With iBatis previously you could do the following: </p>
  
  <pre><code>        &lt;isEqual property="sortBy" compareValue="portfolio_id"&gt;order by p.portfolio_id&lt;/isEqual&gt;
  </code></pre>
  
  <p>Now with myBatis can you do the following: </p>
  
  <pre><code>        &lt;if test="sortBy.equals('facility_id')"&gt;
            order by pd.facility_id
          &lt;/if&gt;
  </code></pre>
  
  <p>sortBy is a property in the parameter map and "facility_id" is the value</p>
  
  <p>I'm a little bit confused as it was straight forward in ibatis. </p>