MYBATIS篇 十二月 30, 2021

MyBatis xml 传 boolean 布尔类型

文章字数 607 阅读约需 1 mins. 阅读次数

使用 choose 标签

<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>
0%