|
|
|
@ -127,6 +127,13 @@ namespace ZKLT.Hadoop
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("初始化数据列失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var _file = HDP_Table.Class2Table<HDP_File>();
|
|
|
|
|
_Tables.Add(_file);
|
|
|
|
|
if (!_TableService.InitStruct(_Source, _file))
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("初始化文件失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -455,6 +462,48 @@ namespace ZKLT.Hadoop
|
|
|
|
|
return _TableService.Query<HDP_Table>(_Source, GetTable("HDP_Table")!, command.Where!, command.Data!, command.Order!);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 插入文件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="file">文件</param>
|
|
|
|
|
/// <returns>是否成功</returns>
|
|
|
|
|
public bool InsertFile(HDP_File file)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(file.Id) && _TableService.QuerySingle<HDP_File>(_Source, GetTable("HDP_File")!, new Dictionary<string, string> {
|
|
|
|
|
{ "Id","=" }
|
|
|
|
|
}, new Dictionary<string, object> {
|
|
|
|
|
{"Id",file.Id }
|
|
|
|
|
}) != null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException("文件编号已存在");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _TableService.Insert(_Source, GetTable("HDP_File")!, HDP_Table.Class2Dictionary(file));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除文件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="fileId">文件编号</param>
|
|
|
|
|
/// <returns>是否成功</returns>
|
|
|
|
|
public bool DeleteFile(string fileId)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(fileId) || _TableService.QuerySingle<HDP_File>(_Source, GetTable("HDP_File")!, new Dictionary<string, string> {
|
|
|
|
|
{ "Id","=" }
|
|
|
|
|
}, new Dictionary<string, object> {
|
|
|
|
|
{"Id",fileId }
|
|
|
|
|
}) == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException("文件编号不存在");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _TableService.Delete(_Source, GetTable("HDP_File")!, new Dictionary<string, string> {
|
|
|
|
|
{"Id","=" }
|
|
|
|
|
}, new Dictionary<string, object> {
|
|
|
|
|
{"Id",fileId }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 插入数据
|
|
|
|
|
/// </summary>
|
|
|
|
|