您的当前位置:首页MyBatis if判断 字符串失效

MyBatis if判断 字符串失效

来源:锐游网
        <if test="moneySource != null and moneySource != '' and moneySource == '0' ">
            AND tbi.money_source = 0
        </if>
        <if test="moneySource != null and moneySource != '' and moneySource == '1' ">
            AND (tbi.money_source = 0 or tbi.money_source = 1)
        </if>

判断均不成立

修改代码

        <if test="moneySource != null and moneySource != '' and moneySource == '0'.toString() ">
            AND tbi.money_source = 0
        </if>
        <if test="moneySource != null and moneySource != '' and moneySource == '1'.toString() ">
            AND (tbi.money_source = 0 or tbi.money_source = 1)
        </if>

因篇幅问题不能全部显示,请点此查看更多更全内容

Top