title: is there a mybatis 'pre-interceptor' to change sql programmatically before sql execution?
body: <p>in my current project, the update statements are assembled with those non-null bean properties , we ignore those null bean properties to prevent wrongly update fields to null.</p>
  
  <p>for example (not actual code, just help to understand)</p>
  
  <pre><code>update person 
  set
  &lt;if test=" address != null and address != '' "&gt;
      address = #{address},
  &lt;/if&gt;
  &lt;if test=" name != null and name != '' "&gt;
      name = #{name},
  &lt;/if&gt;
  where id = #{id}
  </code></pre>
  
  <p>and if we set the <code>person.address</code> = <code>'--set-to-null--'</code> and <code>person.name</code> = <code>'john'</code> and <code>person.id</code> = <code>1</code></p>
  
  <p>mybatis will generate a sql</p>
  
  <pre><code>update person set address = '--set-to-null--', name = 'john' where id = 1;
  </code></pre>
  
  <p>my question is, how I can programmatically change the sql to</p>
  
  <pre><code>update person set address = null, name = 'john' where id = 1;
  </code></pre>
  
  <p>before mybatis excute the sql</p>
  
  <p>I hope I made the question clear, thanks a lot.</p>