Open
Description
<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 不会加上这个判断条件