|
|
|
@ -585,5 +585,104 @@ namespace ZKLT.Hadoop
|
|
|
|
|
var _source = GetSource(_table.SourceId!);
|
|
|
|
|
return _TableService.QueryPage<T>(_source!, _table, (int)command.PageIndex, (int)command.PageSize, command.Where!, command.Data!, command.Order!);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 批量执行任务
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="command">指令</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public object?[] PatchCommand(HDP_Command[] command)
|
|
|
|
|
{
|
|
|
|
|
object?[] _result = new object?[command.Length];
|
|
|
|
|
using (TransactionScope _scope = new TransactionScope())
|
|
|
|
|
{
|
|
|
|
|
var _isComplete = true;
|
|
|
|
|
for (var i = 0; i < command.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (command[i].Type == HDP_CommandType.INSERT)
|
|
|
|
|
{
|
|
|
|
|
var _temp = Insert(command[i]);
|
|
|
|
|
if (!_temp)
|
|
|
|
|
{
|
|
|
|
|
_isComplete = false;
|
|
|
|
|
}
|
|
|
|
|
_result[i] = _temp;
|
|
|
|
|
}
|
|
|
|
|
else if (command[i].Type == HDP_CommandType.UPDATE)
|
|
|
|
|
{
|
|
|
|
|
var _temp = Update(command[i]);
|
|
|
|
|
if (!_temp)
|
|
|
|
|
{
|
|
|
|
|
_isComplete = false;
|
|
|
|
|
}
|
|
|
|
|
_result[i] = _temp;
|
|
|
|
|
}
|
|
|
|
|
else if (command[i].Type == HDP_CommandType.DELETE)
|
|
|
|
|
{
|
|
|
|
|
var _temp = Delete(command[i]);
|
|
|
|
|
if (!_temp)
|
|
|
|
|
{
|
|
|
|
|
_isComplete = false;
|
|
|
|
|
}
|
|
|
|
|
_result[i] = _temp;
|
|
|
|
|
}
|
|
|
|
|
else if (command[i].Type == HDP_CommandType.QUERYSINGLE || command[i].Type == HDP_CommandType.QUERY || command[i].Type == HDP_CommandType.PAGE)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_result[i] = "不支持该命令";
|
|
|
|
|
_isComplete = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_result[i] = ex.Message;
|
|
|
|
|
_isComplete = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (_isComplete)
|
|
|
|
|
{
|
|
|
|
|
_scope.Complete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (var i = 0; i < command.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (command[i].Type == HDP_CommandType.INSERT || command[i].Type == HDP_CommandType.UPDATE || command[i].Type == HDP_CommandType.DELETE)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
else if (command[i].Type == HDP_CommandType.QUERYSINGLE)
|
|
|
|
|
{
|
|
|
|
|
var _temp = QuerySingle<dynamic>(command[i]);
|
|
|
|
|
_result[i] = _temp;
|
|
|
|
|
}
|
|
|
|
|
else if (command[i].Type == HDP_CommandType.QUERY)
|
|
|
|
|
{
|
|
|
|
|
var _temp = Query<dynamic>(command[i]);
|
|
|
|
|
_result[i] = _temp;
|
|
|
|
|
}
|
|
|
|
|
else if (command[i].Type == HDP_CommandType.PAGE)
|
|
|
|
|
{
|
|
|
|
|
var _temp = Page<dynamic>(command[i]);
|
|
|
|
|
_result[i] = _temp;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_result[i] = "不支持该命令";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_result[i] = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return _result.ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|