zoukankan      html  css  js  c++  java
  • Mybatis--xml 处理字符串和Boolean

    字符串

    <if test='startDate != null and startDate != "" ' >  
        and status = 0   
    </if> 
    
    外面是单引号,里面是双引号。
    如果里面是单引号,mybatis处理时是用的OGNL 的表达式,
    单引号的 ('y')会被解析成字符

    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>
  • 相关阅读:
    Swift
    Swift
    书籍
    Swift
    Swift
    iOS系统架构
    Reveal真机(越狱)查看任意APP
    Swift
    Swift
    Swift
  • 原文地址:https://www.cnblogs.com/llq1214/p/11282159.html
Copyright © 2011-2022 走看看