diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs index cc94db9c8..f58ad745e 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/SqlBuilderProvider.cs @@ -208,6 +208,17 @@ namespace SqlSugar parameters.Add(new SugarParameter(parameterName, item.FieldValue)); } break; + case ConditionalType.EqualNull: + if (GetFieldValue(item) == null) + { + builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), " IS ", " NULL "); + } + else + { + builder.AppendFormat(temp, type, item.FieldName.ToSqlFilter(), "=", parameterName); + parameters.Add(new SugarParameter(parameterName, GetFieldValue(item))); + } + break; default: break; } diff --git a/Src/Asp.Net/SqlSugar/Enum/ConditionalType.cs b/Src/Asp.Net/SqlSugar/Enum/ConditionalType.cs index e998c5e8b..9963eb72b 100644 --- a/Src/Asp.Net/SqlSugar/Enum/ConditionalType.cs +++ b/Src/Asp.Net/SqlSugar/Enum/ConditionalType.cs @@ -21,5 +21,6 @@ namespace SqlSugar IsNullOrEmpty=11, IsNot=12, NoLike = 13, + EqualNull = 14, } }