|
|
@ -559,6 +559,10 @@ namespace SqlSugar |
|
|
|
{ |
|
|
|
parameter.CommonTempData = item.ToString(); |
|
|
|
} |
|
|
|
else if (IsDateItemValue(item)) |
|
|
|
{ |
|
|
|
parameter.CommonTempData = GetNewExpressionValue(item); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
base.Start(); |
|
|
@ -581,7 +585,7 @@ namespace SqlSugar |
|
|
|
methodCallExpressionArgs.IsMember = false; |
|
|
|
} |
|
|
|
} |
|
|
|
if (IsDateDate(item) || IsDateValue(item)) |
|
|
|
if (IsDateDate(item) || IsDateValue(item)|| IsDateItemValue(item)) |
|
|
|
{ |
|
|
|
methodCallExpressionArgs.IsMember = true; |
|
|
|
} |
|
|
@ -604,6 +608,33 @@ namespace SqlSugar |
|
|
|
parameter.ChildExpression = null; |
|
|
|
} |
|
|
|
|
|
|
|
private bool IsDateItemValue(Expression item) |
|
|
|
{ |
|
|
|
var result = false; |
|
|
|
if (item is MemberExpression) |
|
|
|
{ |
|
|
|
var memberExp = item as MemberExpression; |
|
|
|
if (memberExp != null && memberExp.Expression != null && memberExp.Expression.Type == UtilConstants.DateType) |
|
|
|
{ |
|
|
|
foreach (var dateType in UtilMethods.EnumToDictionary<DateType>()) |
|
|
|
{ |
|
|
|
if (memberExp.Member.Name.EqualCase(dateType.Key)) |
|
|
|
{ |
|
|
|
result = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
else if (memberExp.Member.Name=="DayOfWeek") |
|
|
|
{ |
|
|
|
result = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private static bool IsDateDate(Expression item) |
|
|
|
{ |
|
|
|
return item.Type == UtilConstants.DateType && item is MemberExpression && (item as MemberExpression).Member.Name == "Date" && item.ToString() != "DateTime.Now.Date"; |
|
|
|