1
mirror of https://github.com/CarmJos/EasySQL.git synced 2026-06-04 07:18:23 +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
+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<artifactId>easysql-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>0.3.15</version>
<version>0.3.16</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -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