title: How to put if condition in myBatis datamapper.xml
body: <p>Here is what I want </p>
  
  <pre><code>&lt;update id='stoIncrement' parameterType='java.util.Map'&gt;
  update DB set 
  &lt;if test="#{is_increase} == 1"&gt;
  count=(select max(count) from DB) +1 
   &lt;/if&gt;
  &lt;if test="#{is_increase} == 0"&gt;
  count=(select max(count) from DB) -1 
   &lt;/if&gt;
  where store=#{store}
  &lt;/update&gt;
  </code></pre>
  
  <p>Here <code>is_increase</code> is a key of the parameter map and is not an entity of the table.</p>
  
  <p>But the above do not seem to work. Can someone help in this regards.</p>
  
  <p>Thanks</p>