Synchronization code

This commit is contained in:
sunkaixuan
2023-06-11 21:51:48 +08:00
parent 872aac058e
commit b6f5714720
4 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{
public class ExpressionContextCase
{
public bool IsDateString { get; set; }
}
}

View File

@@ -19,6 +19,7 @@ namespace SqlSugar
#endregion #endregion
#region Properties #region Properties
public virtual ExpressionContextCase Case{ get; set; }
public ExpressionOutParameter SugarContext { get; set; } public ExpressionOutParameter SugarContext { get; set; }
public IDbMethods DbMehtods public IDbMethods DbMehtods
{ {

View File

@@ -516,9 +516,16 @@ namespace SqlSugar
this.Start(); this.Start();
var isConst = parameter.CommonTempData.GetType() == UtilConstants.DateType; var isConst = parameter.CommonTempData.GetType() == UtilConstants.DateType;
if (isConst) if (isConst)
{
if (this.Context?.Case?.IsDateString==true)
{
AppendMember(parameter, isLeft, GetToDateShort("'" + parameter.CommonTempData.ObjToDate().Date.ToString("yyyy-MM-dd") + "'"));
}
else
{ {
AppendValue(parameter, isLeft, parameter.CommonTempData.ObjToDate().Date); AppendValue(parameter, isLeft, parameter.CommonTempData.ObjToDate().Date);
} }
}
else else
{ {
var GetYear = new MethodCallExpressionModel() var GetYear = new MethodCallExpressionModel()

View File

@@ -4,6 +4,9 @@ namespace SqlSugar
{ {
public class SqliteExpressionContext : ExpressionContext, ILambdaExpressions public class SqliteExpressionContext : ExpressionContext, ILambdaExpressions
{ {
public override ExpressionContextCase Case { get; set; } = new ExpressionContextCase() {
IsDateString= true,
};
public SqlSugarProvider Context { get; set; } public SqlSugarProvider Context { get; set; }
public SqliteExpressionContext() public SqliteExpressionContext()
{ {