When you use a conditional query in your project, and you have a sudden encounter with an OR, the situation is similar: where A<1 and (b>2 OR b<1), how to write in Ibatis. That's what I wrote:
<isnotempty prepend= "and" property= "a" >
<! [cdata[
A < 1
]]>
</isNotEmpty>
<isnotempty prepend= "and (" property= "B" >
<! [cdata[
B > 2
]]>
</isNotEmpty>
<isnotempty prepend= "OR" property= "B" >
<! [cdata[
b < 1)
]]>
</isNotEmpty>
Suppose that a B in the example above corresponds to the attribute in Parameterclass is a B. How to write this or condition thought for a while, because the subconscious thought that the prepend attribute can only be and and OR, but actually the prepend attribute can be any value, it simply represents the string that is placed before the SQL statement when the condition is satisfied, whatever it is, Of course you have to make sure that the last piece of SQL is grammatically correct.