Update exp to sql

This commit is contained in:
sunkaixuan
2025-09-25 10:30:46 +08:00
parent c77c6acc90
commit 103acdcb41

View File

@@ -904,7 +904,7 @@ namespace SqlSugar
if(sql.Contains(replace))
{
var value = columnInfo.PropertyInfo.GetValue(item);
var newValue = "null";
string newValue = null;
if (value != null)
{
if (UtilMethods.IsNumber(columnInfo.UnderType.Name))
@@ -953,6 +953,10 @@ namespace SqlSugar
if (columnInfo.SqlParameterDbType is System.Data.DbType type && type == System.Data.DbType.AnsiString)
{
}
else if(newValue==null)
{
newValue = "null";
}
else
{
@@ -960,7 +964,7 @@ namespace SqlSugar
}
}
}
sql = sql.Replace(replace, newValue);
sql = sql.Replace(replace, newValue);
}
}
sb.Append(sql);