Browse Source

Update ClickHouse Access

pull/30/head
sunkaixuan 2 years ago
parent
commit
4f9c796952
  1. 4
      Src/Asp.NetCore2/SqlSugar.AccessCore/Access/SqlBuilder/AccessInsertBuilder.cs
  2. 4
      Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/SqlBuilder/ClickHouseInsertBuilder.cs

4
Src/Asp.NetCore2/SqlSugar.AccessCore/Access/SqlBuilder/AccessInsertBuilder.cs

@ -48,7 +48,7 @@ namespace SqlSugar.Access
string columnsString = string.Join(",", groupList.First().Select(it => Builder.GetTranslationColumnName(it.DbColumnName))); string columnsString = string.Join(",", groupList.First().Select(it => Builder.GetTranslationColumnName(it.DbColumnName)));
if (isSingle) if (isSingle)
{ {
string columnParametersString = string.Join(",", this.DbColumnInfoList.Select(it => Builder.SqlParameterKeyWord + it.DbColumnName)); string columnParametersString = string.Join(",", this.DbColumnInfoList.Select(it =>base.GetDbColumn(it, Builder.SqlParameterKeyWord + it.DbColumnName)));
return string.Format(SqlTemplate, GetTableNameString, columnsString, columnParametersString); return string.Format(SqlTemplate, GetTableNameString, columnsString, columnParametersString);
} }
else else
@ -71,7 +71,7 @@ namespace SqlSugar.Access
// batchInsetrSql.Append("\t\r\nUNION "); // batchInsetrSql.Append("\t\r\nUNION ");
//} //}
//temp+" Values ( " + string.Join(",", columns.Select(it => FormatValue(it.Value) )+")" //temp+" Values ( " + string.Join(",", columns.Select(it => FormatValue(it.Value) )+")"
batchInsetrSql.Append($"{temp} values ({string.Join(",", columns.Select(it => FormatValue(it.Value)))}) "+UtilConstants.ReplaceCommaKey); batchInsetrSql.Append($"{temp} values ({string.Join(",", columns.Select(it =>base.GetDbColumn(it,FormatValue(it.Value))))}) "+UtilConstants.ReplaceCommaKey);
++i; ++i;
} }
pageIndex++; pageIndex++;

4
Src/Asp.NetCore2/SqlSugar.ClickHouseCore/ClickHouse/SqlBuilder/ClickHouseInsertBuilder.cs

@ -129,7 +129,7 @@ namespace SqlSugar.ClickHouse
string columnsString = string.Join(",", groupList.First().Select(it => Builder.GetTranslationColumnName(it.DbColumnName))); string columnsString = string.Join(",", groupList.First().Select(it => Builder.GetTranslationColumnName(it.DbColumnName)));
if (isSingle) if (isSingle)
{ {
string columnParametersString = string.Join(",", this.DbColumnInfoList.Select(it => Builder.SqlParameterKeyWord + it.DbColumnName)); string columnParametersString = string.Join(",", this.DbColumnInfoList.Select(it =>base.GetDbColumn(it, Builder.SqlParameterKeyWord + it.DbColumnName)));
ActionMinDate(); ActionMinDate();
return string.Format(SqlTemplate, GetTableNameString, columnsString, columnParametersString); return string.Format(SqlTemplate, GetTableNameString, columnsString, columnParametersString);
} }
@ -144,7 +144,7 @@ namespace SqlSugar.ClickHouse
foreach (var item in groupList) foreach (var item in groupList)
{ {
batchInsetrSql.Append("("); batchInsetrSql.Append("(");
insertColumns = string.Join(",", item.Select(it => FormatValue(it.Value, it.PropertyName))); insertColumns = string.Join(",", item.Select(it =>base.GetDbColumn(it, FormatValue(it.Value, it.PropertyName))));
batchInsetrSql.Append(insertColumns); batchInsetrSql.Append(insertColumns);
if (groupList.Last() == item) if (groupList.Last() == item)
{ {

Loading…
Cancel
Save