mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 20:43:46 +08:00
Update xx.date
This commit is contained in:
@@ -135,10 +135,10 @@ namespace OrmTest
|
|||||||
|
|
||||||
Id = SqlFunc.AggregateSum(SqlFunc.IF(it.Id > 0).Return(1).End(0))
|
Id = SqlFunc.AggregateSum(SqlFunc.IF(it.Id > 0).Return(1).End(0))
|
||||||
}).ToList();
|
}).ToList();
|
||||||
var list2 = db.Queryable<Order>().Select(it => new
|
var list2 = db.Queryable<Order>().Where(it=>it.CreateTime.Date==it.CreateTime).Select(it => new
|
||||||
{
|
{
|
||||||
date = SqlFunc.ToDateShort(it.CreateTime),
|
date = it.CreateTime.Date,
|
||||||
datetime = SqlFunc.ToDate(it.CreateTime)
|
datetime = DateTime.Now.Date
|
||||||
}).ToList();
|
}).ToList();
|
||||||
Console.WriteLine("#### SqlFunc End ####");
|
Console.WriteLine("#### SqlFunc End ####");
|
||||||
}
|
}
|
||||||
|
@@ -178,12 +178,7 @@ namespace SqlSugar
|
|||||||
var value = GetNewExpressionValue(expression.Expression);
|
var value = GetNewExpressionValue(expression.Expression);
|
||||||
if (expression.Member.Name == "Date")
|
if (expression.Member.Name == "Date")
|
||||||
{
|
{
|
||||||
AppendMember(parameter, isLeft, GetToDate(this.Context.DbMehtods.MergeString(
|
AppendMember(parameter, isLeft, GetToDateShort(value));
|
||||||
this.GetDateValue(value, DateType.Year),
|
|
||||||
"'-'",
|
|
||||||
this.GetDateValue(value, DateType.Month),
|
|
||||||
"'-'",
|
|
||||||
this.GetDateValue(value, DateType.Day))));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -292,12 +287,7 @@ namespace SqlSugar
|
|||||||
new MethodCallExpressionArgs() { MemberName=DateType.Year, MemberValue=DateType.Year}
|
new MethodCallExpressionArgs() { MemberName=DateType.Year, MemberValue=DateType.Year}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
AppendMember(parameter, isLeft, GetToDate(this.Context.DbMehtods.MergeString(
|
AppendMember(parameter, isLeft, GetToDateShort(parameter.CommonTempData.ObjToString()));
|
||||||
this.GetDateValue(parameter.CommonTempData, DateType.Year),
|
|
||||||
"'-'",
|
|
||||||
this.GetDateValue(parameter.CommonTempData, DateType.Month),
|
|
||||||
"'-'",
|
|
||||||
this.GetDateValue(parameter.CommonTempData, DateType.Day))));
|
|
||||||
}
|
}
|
||||||
parameter.CommonTempData = oldCommonTempDate;
|
parameter.CommonTempData = oldCommonTempDate;
|
||||||
}
|
}
|
||||||
@@ -455,8 +445,8 @@ namespace SqlSugar
|
|||||||
};
|
};
|
||||||
return this.Context.DbMehtods.DateValue(pars);
|
return this.Context.DbMehtods.DateValue(pars);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetToDate(string value)
|
private string GetToDateShort(string value)
|
||||||
{
|
{
|
||||||
var pars = new MethodCallExpressionModel()
|
var pars = new MethodCallExpressionModel()
|
||||||
{
|
{
|
||||||
@@ -464,7 +454,7 @@ namespace SqlSugar
|
|||||||
new MethodCallExpressionArgs() { MemberName=value, MemberValue=value },
|
new MethodCallExpressionArgs() { MemberName=value, MemberValue=value },
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return this.Context.DbMehtods.ToDate(pars);
|
return this.Context.DbMehtods.ToDateShort(pars);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SettingParameters(ExpressionParameter parameter, out ExpressionParameter baseParameter, out MemberExpression expression, out bool? isLeft, out bool isSetTempData, out bool isValue, out bool isValueBool, out bool isLength, out bool isDateValue, out bool isHasValue, out bool isDateDate, out bool isMemberValue, out bool isSingle, out bool fieldIsBool, out bool isSelectField, out bool isField)
|
private void SettingParameters(ExpressionParameter parameter, out ExpressionParameter baseParameter, out MemberExpression expression, out bool? isLeft, out bool isSetTempData, out bool isValue, out bool isValueBool, out bool isLength, out bool isDateValue, out bool isHasValue, out bool isDateDate, out bool isMemberValue, out bool isSingle, out bool fieldIsBool, out bool isSelectField, out bool isField)
|
||||||
|
Reference in New Issue
Block a user