Mybatis of XML digital is not empty judgment

status is of type Integer.

It began to spread into a 0 when the judge found that the statement does not go away, but the pass is good 1:

    <if test="status != null and status != ''">
        and c.status = #{status}
    </if>

It was later revised to

    <if test="status != null">
        and c.status = #{status}
    </if>

The 0 and 1 can

So digital judgment, it should be as long as the judge is not empty can.

Guess you like

Origin www.cnblogs.com/mosakashaka/p/12609270.html