mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-24 04:53:45 +08:00
Synchronization code
This commit is contained in:
@@ -760,7 +760,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
KeyValuePair<string, List<SugarParameter>> sqlInfo;
|
KeyValuePair<string, List<SugarParameter>> sqlInfo;
|
||||||
string sql;
|
string sql;
|
||||||
OutIntoTableSql(TableName, out sqlInfo, out sql);
|
OutIntoTableSql(TableName, out sqlInfo, out sql, TableEntityType);
|
||||||
return this.Context.Ado.ExecuteCommand(sql, sqlInfo.Value);
|
return this.Context.Ado.ExecuteCommand(sql, sqlInfo.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -694,7 +694,7 @@ ParameterT parameter)
|
|||||||
{
|
{
|
||||||
KeyValuePair<string, List<SugarParameter>> sqlInfo;
|
KeyValuePair<string, List<SugarParameter>> sqlInfo;
|
||||||
string sql;
|
string sql;
|
||||||
OutIntoTableSql(TableName, out sqlInfo, out sql);
|
OutIntoTableSql(TableName, out sqlInfo, out sql,TableEntityType);
|
||||||
return await this.Context.Ado.ExecuteCommandAsync(sql, sqlInfo.Value);
|
return await this.Context.Ado.ExecuteCommandAsync(sql, sqlInfo.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1188,8 +1188,9 @@ namespace SqlSugar
|
|||||||
|
|
||||||
#region Other
|
#region Other
|
||||||
|
|
||||||
private void OutIntoTableSql(string TableName, out KeyValuePair<string, List<SugarParameter>> sqlInfo, out string sql)
|
private void OutIntoTableSql(string TableName, out KeyValuePair<string, List<SugarParameter>> sqlInfo, out string sql,Type tableInfo)
|
||||||
{
|
{
|
||||||
|
var columnList = this.Context.EntityMaintenance.GetEntityInfo(tableInfo).Columns;
|
||||||
//var entityInfo = this.Context.EntityMaintenance.GetEntityInfo(TableEntityType);
|
//var entityInfo = this.Context.EntityMaintenance.GetEntityInfo(TableEntityType);
|
||||||
sqlInfo = this.ToSql();
|
sqlInfo = this.ToSql();
|
||||||
var name = this.SqlBuilder.GetTranslationTableName(TableName);
|
var name = this.SqlBuilder.GetTranslationTableName(TableName);
|
||||||
@@ -1202,6 +1203,11 @@ namespace SqlSugar
|
|||||||
foreach (var item in ExpressionTool.GetNewExpressionItemList((Expression)this.QueryBuilder.SelectValue))
|
foreach (var item in ExpressionTool.GetNewExpressionItemList((Expression)this.QueryBuilder.SelectValue))
|
||||||
{
|
{
|
||||||
var column = item.Key;
|
var column = item.Key;
|
||||||
|
var columnInfo = columnList.FirstOrDefault(it => it.PropertyName == item.Key);
|
||||||
|
if (columnInfo != null)
|
||||||
|
{
|
||||||
|
column =this.SqlBuilder.GetTranslationColumnName(columnInfo.DbColumnName);
|
||||||
|
}
|
||||||
columns += $"{column},";
|
columns += $"{column},";
|
||||||
}
|
}
|
||||||
columns = columns.TrimEnd(',') + ")";
|
columns = columns.TrimEnd(',') + ")";
|
||||||
|
Reference in New Issue
Block a user