eg:
select * from user
<trim prefix="WHERE" prefixoverride="AND |OR">
<if test="name != null "> AND name=#{name}</if>
<if test="gender != null "> AND gender=#{gender}</if>
</trim>
如果name和gender的值都不为null的话打印的SQL为:select * from user where name = '****' and gender = '***'
prefix:前缀
prefixoverride:去掉第一个and或者是or