|
|
@ -285,6 +285,20 @@ namespace ZKLT.Hadoop
|
|
|
|
_parmstr.Append($@"@{_column.Key},");
|
|
|
|
_parmstr.Append($@"@{_column.Key},");
|
|
|
|
_params.Add(_column.Key!, row[_column.Key!]);
|
|
|
|
_params.Add(_column.Key!, row[_column.Key!]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!string.IsNullOrEmpty(_column.InsertDefault))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (HDP_CommandAction.IsAction(_column.InsertDefault))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_colstr.Append($@"`{_column.Key!}`,");
|
|
|
|
|
|
|
|
_parmstr.Append($"{_column.InsertDefault},");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_colstr.Append($@"`{_column.Key!}`,");
|
|
|
|
|
|
|
|
_parmstr.Append($@"@{_column.Key},");
|
|
|
|
|
|
|
|
_params.Add(_column.Key!, _column.InsertDefault);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (_colstr[_colstr.Length - 1] == ',')
|
|
|
|
if (_colstr[_colstr.Length - 1] == ',')
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -298,7 +312,7 @@ namespace ZKLT.Hadoop
|
|
|
|
_command.AppendLine(") VALUES (");
|
|
|
|
_command.AppendLine(") VALUES (");
|
|
|
|
_command.AppendLine(_parmstr.ToString());
|
|
|
|
_command.AppendLine(_parmstr.ToString());
|
|
|
|
_command.AppendLine(")");
|
|
|
|
_command.AppendLine(")");
|
|
|
|
var _result = _connection.Execute(_command.ToString(), _params);
|
|
|
|
var _result = _connection.Execute(HDP_CommandAction.ConvertCommand(_command.ToString(), row), _params);
|
|
|
|
_connection.Close();
|
|
|
|
_connection.Close();
|
|
|
|
if (_result > 0)
|
|
|
|
if (_result > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -364,6 +378,18 @@ namespace ZKLT.Hadoop
|
|
|
|
_colstr.Append($@"`{_column.Key!}`=@{_column.Key!},");
|
|
|
|
_colstr.Append($@"`{_column.Key!}`=@{_column.Key!},");
|
|
|
|
_params.Add(_column.Key!, row[_column.Key!]);
|
|
|
|
_params.Add(_column.Key!, row[_column.Key!]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!string.IsNullOrEmpty(_column.UpdateDefault))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (HDP_CommandAction.IsAction(_column.UpdateDefault))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_colstr.Append($@"`{_column.Key!}`={_column.UpdateDefault}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_colstr.Append($@"`{_column.Key!}`=@{_column.Key!},");
|
|
|
|
|
|
|
|
_params.Add(_column.Key!, _column.UpdateDefault);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (_colstr[_colstr.Length - 1] == ',')
|
|
|
|
if (_colstr[_colstr.Length - 1] == ',')
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -393,7 +419,7 @@ namespace ZKLT.Hadoop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_command.AppendLine(_wherestr.ToString());
|
|
|
|
_command.AppendLine(_wherestr.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
var _result = _connection.Execute(_command.ToString(), _params);
|
|
|
|
var _result = _connection.Execute(HDP_CommandAction.ConvertCommand(_command.ToString(), row), _params);
|
|
|
|
_connection.Close();
|
|
|
|
_connection.Close();
|
|
|
|
if (_result > 0)
|
|
|
|
if (_result > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -471,7 +497,7 @@ namespace ZKLT.Hadoop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_command.AppendLine(_wherestr.ToString());
|
|
|
|
_command.AppendLine(_wherestr.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
var _result = _connection.Execute(_command.ToString(), _params);
|
|
|
|
var _result = _connection.Execute(HDP_CommandAction.ConvertCommand(_command.ToString(), row), _params);
|
|
|
|
_connection.Close();
|
|
|
|
_connection.Close();
|
|
|
|
if (_result > 0)
|
|
|
|
if (_result > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -549,7 +575,7 @@ namespace ZKLT.Hadoop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_command.AppendLine(_wherestr.ToString());
|
|
|
|
_command.AppendLine(_wherestr.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
var _result = _connection.Query<T>(_command.ToString(), _params).ToArray();
|
|
|
|
var _result = _connection.Query<T>(HDP_CommandAction.ConvertCommand(_command.ToString(), row), _params).ToArray();
|
|
|
|
_connection.Close();
|
|
|
|
_connection.Close();
|
|
|
|
if (_result.Length > 0)
|
|
|
|
if (_result.Length > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -650,7 +676,7 @@ namespace ZKLT.Hadoop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_command.AppendLine(_orderstr.ToString());
|
|
|
|
_command.AppendLine(_orderstr.ToString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var _result = _connection.Query<T>(_command.ToString(), _params);
|
|
|
|
var _result = _connection.Query<T>(HDP_CommandAction.ConvertCommand(_command.ToString(), row), _params);
|
|
|
|
_connection.Close();
|
|
|
|
_connection.Close();
|
|
|
|
return _result.ToArray();
|
|
|
|
return _result.ToArray();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -756,7 +782,7 @@ namespace ZKLT.Hadoop
|
|
|
|
_pagestr.AppendLine(_command.ToString());
|
|
|
|
_pagestr.AppendLine(_command.ToString());
|
|
|
|
_pagestr.AppendLine(") AS Temp");
|
|
|
|
_pagestr.AppendLine(") AS Temp");
|
|
|
|
_pagestr.AppendLine(@$"LIMIT {(_result.PageIndex - 1) * _result.PageSize},{_result.PageSize}");
|
|
|
|
_pagestr.AppendLine(@$"LIMIT {(_result.PageIndex - 1) * _result.PageSize},{_result.PageSize}");
|
|
|
|
_result.Data = _connection.Query<T>(_pagestr.ToString(), _params).ToArray();
|
|
|
|
_result.Data = _connection.Query<T>(HDP_CommandAction.ConvertCommand(_pagestr.ToString(), row), _params).ToArray();
|
|
|
|
_connection.Close();
|
|
|
|
_connection.Close();
|
|
|
|
return _result;
|
|
|
|
return _result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|