mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-02 20:02:47 +08:00
Synchronization code
This commit is contained in:
parent
cc678a0834
commit
4ac1e1b08f
@ -9,7 +9,8 @@ namespace SqlSugar
|
||||
{
|
||||
public bool IsAutoRemoveDataCache { get; set; }
|
||||
public bool IsWithNoLockQuery { get; set; }
|
||||
|
||||
public bool IsWithNoLockSubquery { get; set; }
|
||||
|
||||
public bool DisableNvarchar { get; set; }
|
||||
public bool DisableMillisecond { get; set; }
|
||||
public bool PgSqlIsAutoToLower { get; set; } = true;
|
||||
|
@ -30,7 +30,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return 301;
|
||||
return 302;
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +55,10 @@ namespace SqlSugar
|
||||
this.Context.GetTranslationColumnName(parameter.Name),
|
||||
tableName,
|
||||
null);
|
||||
if (this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.DbType==DbType.SqlServer&&this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockSubquery==true)
|
||||
{
|
||||
joinString = $"{joinString} {SqlWith.NoLock} ";
|
||||
}
|
||||
var result = joinString+ "ON " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple);
|
||||
//var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
|
||||
this.Context.JoinIndex++;
|
||||
|
@ -30,7 +30,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return 301;
|
||||
return 302;
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +55,10 @@ namespace SqlSugar
|
||||
this.Context.GetTranslationColumnName(parameter.Name),
|
||||
tableName,
|
||||
null);
|
||||
if (this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.DbType == DbType.SqlServer && this.Context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockSubquery == true)
|
||||
{
|
||||
joinString = $"{joinString} {SqlWith.NoLock} ";
|
||||
}
|
||||
var result = joinString+ "ON " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple);
|
||||
//var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
|
||||
this.Context.JoinIndex++;
|
||||
|
@ -243,6 +243,17 @@ namespace SqlSugar
|
||||
isubList.Add(new SubRightBracket());
|
||||
isubList.Add(new SubSelectDefault());
|
||||
}
|
||||
var db = this.context?.SugarContext?.Context;
|
||||
if (db != null&& db?.CurrentConnectionConfig?.DbType == DbType.SqlServer)
|
||||
{
|
||||
if (db.CurrentConnectionConfig?.MoreSettings?.IsWithNoLockSubquery == true)
|
||||
{
|
||||
if (!isubList.Any(it => it is SubWithNolock))
|
||||
{
|
||||
isubList.Add(new SubWithNolock() { Context = this.context });
|
||||
}
|
||||
}
|
||||
}
|
||||
isubList = isubList.OrderBy(it => it.Sort).ToList();
|
||||
var isHasWhere = isubList.Where(it => it is SubWhere).Any();
|
||||
var isJoin = isubList.Any(it => it is SubInnerJoin || it is SubLeftJoin);
|
||||
|
@ -363,7 +363,8 @@ namespace SqlSugar
|
||||
IsAutoDeleteQueryFilter=it.MoreSettings.IsAutoDeleteQueryFilter,
|
||||
IsAutoUpdateQueryFilter = it.MoreSettings.IsAutoUpdateQueryFilter,
|
||||
EnableModelFuncMappingColumn=it.MoreSettings.EnableModelFuncMappingColumn,
|
||||
EnableOracleIdentity = it.MoreSettings.EnableOracleIdentity
|
||||
EnableOracleIdentity = it.MoreSettings.EnableOracleIdentity,
|
||||
IsWithNoLockSubquery=it.MoreSettings.IsWithNoLockSubquery
|
||||
|
||||
},
|
||||
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
||||
|
Loading…
Reference in New Issue
Block a user