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