1
mirror of https://github.com/CarmJos/EasySQL.git synced 2026-06-04 15:28:20 +08:00

[0.3.16] 支持 IS NULL 判断(即设定queryValue为null)。

This commit is contained in:
2022-04-27 02:08:58 +08:00
parent deb5de35a8
commit e8a01169d2
8 changed files with 17 additions and 9 deletions
@@ -48,6 +48,16 @@ public abstract class AbstractConditionalBuilder<B extends ConditionalBuilder<B,
return getThis();
}
@Override
public B addCondition(@NotNull String columnName, @Nullable Object queryValue) {
Objects.requireNonNull(columnName, "columnName could not be null");
if (queryValue == null) {
return addCondition(withBackQuote(columnName) + " IS NULL");
} else {
return addCondition(columnName, "=", queryValue);
}
}
@Override
public B addCondition(
@NotNull String columnName, @NotNull String operator, @Nullable Object queryValue