mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
内部 ColumnInfo 调整
This commit is contained in:
@ -66,7 +66,7 @@ namespace FreeSql.Odbc.Dameng
|
||||
sb.Append(col.DbInsertValue);
|
||||
else
|
||||
{
|
||||
object val = col.GetMapValue(d);
|
||||
object val = col.GetDbValue(d);
|
||||
if (val == null && col.Attribute.IsNullable == false) val = col.CsType == typeof(string) ? "" : Utils.GetDataReaderValue(col.CsType.NullableTypeOrThis(), null);//#384
|
||||
if (_noneParameter)
|
||||
sb.Append(_commonUtils.GetNoneParamaterSqlValue(specialParams, _noneParameterFlag, col.Attribute.MapType, val));
|
||||
|
@ -50,7 +50,7 @@ namespace FreeSql.Odbc.Dameng
|
||||
{
|
||||
if (_table.Primarys.Length == 1)
|
||||
{
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys.First().GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetDbValue(d)));
|
||||
return;
|
||||
}
|
||||
sb.Append("(");
|
||||
@ -58,7 +58,7 @@ namespace FreeSql.Odbc.Dameng
|
||||
foreach (var pk in _table.Primarys)
|
||||
{
|
||||
if (pkidx > 0) sb.Append(" || '+' || ");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetDbValue(d)));
|
||||
++pkidx;
|
||||
}
|
||||
sb.Append(")");
|
||||
|
@ -47,14 +47,14 @@ namespace FreeSql.Odbc.Default
|
||||
{
|
||||
if (_table.Primarys.Length == 1)
|
||||
{
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys.First().GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetDbValue(d)));
|
||||
return;
|
||||
}
|
||||
var pkidx = 0;
|
||||
foreach (var pk in _table.Primarys)
|
||||
{
|
||||
if (pkidx > 0) sb.Append(" + '+' + ");
|
||||
sb.Append(_utils.Adapter.CastSql(_commonUtils.FormatSql("{0}", pk.GetMapValue(d)), _utils.Adapter.MappingOdbcTypeVarChar));
|
||||
sb.Append(_utils.Adapter.CastSql(_commonUtils.FormatSql("{0}", pk.GetDbValue(d)), _utils.Adapter.MappingOdbcTypeVarChar));
|
||||
++pkidx;
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ namespace FreeSql.Odbc.KingbaseES
|
||||
{
|
||||
if (_table.Primarys.Length == 1)
|
||||
{
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys.First().GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetDbValue(d)));
|
||||
return;
|
||||
}
|
||||
sb.Append("(");
|
||||
@ -101,7 +101,7 @@ namespace FreeSql.Odbc.KingbaseES
|
||||
foreach (var pk in _table.Primarys)
|
||||
{
|
||||
if (pkidx > 0) sb.Append(" || '+' || ");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetMapValue(d))).Append("::text");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetDbValue(d))).Append("::text");
|
||||
++pkidx;
|
||||
}
|
||||
sb.Append(")");
|
||||
|
@ -90,7 +90,7 @@ namespace FreeSql.Odbc.MySql
|
||||
{
|
||||
if (_table.Primarys.Length == 1)
|
||||
{
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys.First().GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetDbValue(d)));
|
||||
return;
|
||||
}
|
||||
sb.Append("CONCAT(");
|
||||
@ -98,7 +98,7 @@ namespace FreeSql.Odbc.MySql
|
||||
foreach (var pk in _table.Primarys)
|
||||
{
|
||||
if (pkidx > 0) sb.Append(", '+', ");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetDbValue(d)));
|
||||
++pkidx;
|
||||
}
|
||||
sb.Append(")");
|
||||
|
@ -66,7 +66,7 @@ namespace FreeSql.Odbc.Oracle
|
||||
sb.Append(col.DbInsertValue);
|
||||
else
|
||||
{
|
||||
object val = col.GetMapValue(d);
|
||||
object val = col.GetDbValue(d);
|
||||
if (val == null && col.Attribute.IsNullable == false) val = col.CsType == typeof(string) ? "" : Utils.GetDataReaderValue(col.CsType.NullableTypeOrThis(), null);//#384
|
||||
if (_noneParameter)
|
||||
sb.Append(_commonUtils.GetNoneParamaterSqlValue(specialParams, _noneParameterFlag, col.Attribute.MapType, val));
|
||||
|
@ -52,7 +52,7 @@ namespace FreeSql.Odbc.Oracle
|
||||
{
|
||||
if (_table.Primarys[0].Attribute.DbType.Contains("NVARCHAR2"))
|
||||
sb.Append("N");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetDbValue(d)));
|
||||
return;
|
||||
}
|
||||
sb.Append("(");
|
||||
@ -60,7 +60,7 @@ namespace FreeSql.Odbc.Oracle
|
||||
foreach (var pk in _table.Primarys)
|
||||
{
|
||||
if (pkidx > 0) sb.Append(" || '+' || ");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetDbValue(d)));
|
||||
++pkidx;
|
||||
}
|
||||
sb.Append(")");
|
||||
|
@ -93,7 +93,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
||||
{
|
||||
if (_table.Primarys.Length == 1)
|
||||
{
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys.First().GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetDbValue(d)));
|
||||
return;
|
||||
}
|
||||
sb.Append("(");
|
||||
@ -101,7 +101,7 @@ namespace FreeSql.Odbc.PostgreSQL
|
||||
foreach (var pk in _table.Primarys)
|
||||
{
|
||||
if (pkidx > 0) sb.Append(" || '+' || ");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetMapValue(d))).Append("::text");
|
||||
sb.Append(_commonUtils.FormatSql("{0}", pk.GetDbValue(d))).Append("::text");
|
||||
++pkidx;
|
||||
}
|
||||
sb.Append(")");
|
||||
|
@ -88,14 +88,14 @@ namespace FreeSql.Odbc.SqlServer
|
||||
{
|
||||
if (_table.Primarys.Length == 1)
|
||||
{
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys.First().GetMapValue(d)));
|
||||
sb.Append(_commonUtils.FormatSql("{0}", _table.Primarys[0].GetDbValue(d)));
|
||||
return;
|
||||
}
|
||||
var pkidx = 0;
|
||||
foreach (var pk in _table.Primarys)
|
||||
{
|
||||
if (pkidx > 0) sb.Append(" + '+' + ");
|
||||
sb.Append("cast(").Append(_commonUtils.FormatSql("{0}", pk.GetMapValue(d))).Append(" as varchar)");
|
||||
sb.Append("cast(").Append(_commonUtils.FormatSql("{0}", pk.GetDbValue(d))).Append(" as varchar)");
|
||||
++pkidx;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user