Skip to content

在xml中的判断条件不生效的问题 #3401

Open
@Woshizz

Description

@Woshizz
<if test="query.tenantId != null and query.tenantId != '' and query.tenantId != '0'">
                AND tenant_id = #{query.tenantId}
            </if>

当tenantId ="0"时判断条件为true 会加上这个查询条件。当吧判断条件写成

<if test="query.tenantId != null and query.tenantId != '' and query.tenantId != 0">
                AND tenant_id = #{query.tenantId}
            </if>

时判断条件为false 不会加上这个判断条件

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions