Mybatis - xml Boolean strings and processing

 

String

 

< IF Test = ' startDate! = Null and startDate! = "" '  >   
    And Status = 0    
</ IF >  

outside the single quotation marks, which is a double quotation mark. 
If there is a single quote is an expression when treated with mybatis OGNL, the 
single quotation marks ( ' Y ' ) will be parsed into character

 

Boolean

 

             <choose>
                <when test="isReSend">
                    and (info.batchId is not null)
                </when>
                <otherwise>
                    and (info.batchId = '' or info.batchId is null)
                </otherwise>
                </choose>


或者


             <choose>
                <when test="isReSend==true">
                    and (info.batchId is not null)
                </when>
                <otherwise>
                    and (info.batchId = '' or info.batchId is null)
                </otherwise>
                </choose>

 

Guess you like

Origin www.cnblogs.com/llq1214/p/11282159.html