{$IfDef FPC}{$CodePage cp1251}{$EndIf FPC}
unit m3DocListQueryExecutor;
// --------------------------------------------------------------------------
// Родители: "Queries" <> MUID: (66FB115B029F) :: "m3" <> MUID: (66FB10950007) :: "Shared Delphi For Archi" <> MUID: (4ABA2360025A)
// --------------------------------------------------------------------------
// Модуль: "w:\common\components\rtl\Garant\m3\m3DocListQueryExecutor.pas" GeneratorVersion: 1.0.0.883901
// Стереотип: "<>"
// Элемент модели: "Tm3DocListQueryExecutor" MUID: (6706E6EA0255)
// --------------------------------------------------------------------------
//#UC START# *6706E6EA0255BeforeDefines*
//#UC END# *6706E6EA0255BeforeDefines*
{$Include daDefine.inc}
interface
uses
l3IntfUses
, daDocListQueryParams
, m3QueryInterfaces
, l3Ranges
, m4SearchResult
, m3AttrIndexInterfaces
, daQueryInterfaces
, daEnumerableInterfaces
, l3Interfaces
, daQueryParams
, l3LongintList
, daTypes
, evdDATypes
, daAbstractQueryExecutor
;
type
{$If not Defined(_ParamsType_Defined_) }
{Tm3DocListQueryExecutor.}_ParamsType_ = TdaDocListQueryParams;
{$Define _ParamsType_Defined_ }
{$Define _ParamsType_IsClass_ }
{$Define _ParamsType_IsAcceptableForScripts_ }
{$IfEnd} // not Defined(_ParamsType_Defined_)
{$Include Mm3QueryExecutor_imp.pas}
Tm3DocListQueryExecutor = class(_Mm3QueryExecutor_)
private
f_UQueryExecutor: Im3QueryExecutor;
protected
function FindByParams(const aParams: TdaDocListQueryParams;
const aSearcher: Im3AttrIndexSearcher): Il3RangeEnumerable; override;
procedure DoDropResult; override;
function DoGetAddressList: Tm4SearchResult; override;
procedure ClearFields; override;
public
{$If NOT Defined(l3NoSRT)}
function SetRefTo(var thePlace: Tm3DocListQueryExecutor): Boolean; overload; {$If Defined(l3HasInl)}inline;{$IfEnd}
{$IfEnd} // NOT Defined(l3NoSRT)
end;//Tm3DocListQueryExecutor
implementation
uses
l3ImplUses
, m3QueryResultSetFromLongintList
, daQueryExecutorFactory
, m3AttrIndexSearcher
, SysUtils
, l3Enumerators
, l3InterfacedIntegerList
, k2Tags
//#UC START# *6706E6EA0255impl_uses*
//#UC END# *6706E6EA0255impl_uses*
;
{$Include Mm3QueryExecutor_imp.pas}
{$If NOT Defined(l3NoSRT)}
function Tm3DocListQueryExecutor.SetRefTo(var thePlace: Tm3DocListQueryExecutor): Boolean;
begin
if (thePlace = Self) then
Result := false
else
begin
Result := true;
thePlace.Free;
thePlace := Self.Use;
end;//thePlace = Self
end;//Tm3DocListQueryExecutor.SetRefTo
{$IfEnd} // NOT Defined(l3NoSRT)
function Tm3DocListQueryExecutor.FindByParams(const aParams: TdaDocListQueryParams;
const aSearcher: Im3AttrIndexSearcher): Il3RangeEnumerable;
//#UC START# *670660CF0357_6706E6EA0255_var*
(*
var
lPhoto : ISab;
l_Executor: IdtQueryExecutor;
*)
var
l_Executor: Im3QueryExecutor;
//#UC END# *670660CF0357_6706E6EA0255_var*
begin
//#UC START# *670660CF0357_6706E6EA0255_impl*
Result := nil;
f_UQueryExecutor := nil;
if (Params.UQuery.Query <> nil) then
begin
l_Executor := Self.MakeIntExecutor(aParams.UQuery.Query);
f_UQueryExecutor := l_Executor;
Result := l_Executor.Find;
end;//Params.UQuery.Query <> nil
if (Params.AddList.Query <> nil) then
begin
l_Executor := Self.MakeIntExecutor(aParams.AddList.Query);
Result := Il3RangeEnumerable_JoinWithOther(Result, l_Executor.Find);
end;//Params.AddList.Query <> nil
if (Params.DelList.Query <> nil) then
begin
l_Executor := Self.MakeIntExecutor(aParams.DelList.Query);
Result := Il3RangeEnumerable_Diff(Result, l_Executor.Find);
end;//Params.DelList.Query <> nil
(* cNeedTrace42err := true;
try
lPhoto := MakeSabCopy(Get_MainTblPhoto);
if Params.UQuery.Query <> nil then
begin
l_Executor := TdtQueryExecutorFactory.Instance.MakeIntExecutor(Params.UQuery.Query);
f_UQueryExecutor := l_Executor;
l_Executor.MainTblPhoto := lPhoto;
f_Sab := MakeSabCopy(l_Executor.FoundListSab);
l_Executor.DropResult;
end;
if (Params.AddList.Query <> nil) then
begin
l_Executor := TdtQueryExecutorFactory.Instance.MakeIntExecutor(Params.AddList.Query);
l_Executor.MainTblPhoto := lPhoto;
if not l_Executor.FoundListSab.IsEmpty then
begin
if (f_Sab <> nil) and not f_Sab.IsEmpty then
f_Sab.OrSab(l_Executor.FoundListSab)
else
f_Sab := MakeSabCopy(l_Executor.FoundListSab);
l_Executor.DropResult;
end;
end;
if (Params.DelList.Query <> nil) then
begin
l_Executor := TdtQueryExecutorFactory.Instance.MakeIntExecutor(Params.DelList.Query);
l_Executor.MainTblPhoto := lPhoto;
if not l_Executor.FoundListSab.IsEmpty and (f_Sab <> nil) and not f_Sab.IsEmpty then
begin
f_Sab.SubtractSab(l_Executor.FoundListSab);
l_Executor.DropResult;
end;
end;
if (Params.Filter.Query <> nil) and (f_Sab <> nil) and not f_Sab.IsEmpty then
begin
l_Executor := TdtQueryExecutorFactory.Instance.MakeIntExecutor(Params.Filter.Query);
l_Executor.MainTblPhoto := lPhoto;
f_Sab.AndSab(l_Executor.FoundListSab);
l_Executor.DropResult;
end;
//lApplyAccessFilter;
f_Sab := gApplyAccessFilter(f_Sab);
if f_Sab = nil then
f_Sab := MakeEmptySab(Get_MainTblPhoto);
finally
cNeedTrace42err := false;
end;*)
//#UC END# *670660CF0357_6706E6EA0255_impl*
end;//Tm3DocListQueryExecutor.FindByParams
procedure Tm3DocListQueryExecutor.DoDropResult;
//#UC START# *5F148B0D0239_6706E6EA0255_var*
//#UC END# *5F148B0D0239_6706E6EA0255_var*
begin
//#UC START# *5F148B0D0239_6706E6EA0255_impl*
inherited;
f_UQueryExecutor := nil;
//#UC END# *5F148B0D0239_6706E6EA0255_impl*
end;//Tm3DocListQueryExecutor.DoDropResult
function Tm3DocListQueryExecutor.DoGetAddressList: Tm4SearchResult;
//#UC START# *670F8AF6026D_6706E6EA0255_var*
//#UC END# *670F8AF6026D_6706E6EA0255_var*
begin
//#UC START# *670F8AF6026D_6706E6EA0255_impl*
Self.GetList;
if (f_UQueryExecutor = nil) then
Result := nil
else
Result := f_UQueryExecutor.AddressList;
//#UC END# *670F8AF6026D_6706E6EA0255_impl*
end;//Tm3DocListQueryExecutor.DoGetAddressList
procedure Tm3DocListQueryExecutor.ClearFields;
begin
f_UQueryExecutor := nil;
inherited;
end;//Tm3DocListQueryExecutor.ClearFields
//#UC START# *6706E6EA0255forDiagramm*
(*
*)
//#UC END# *6706E6EA0255forDiagramm*
end.
Заметки о тестировании, программировании и прочий "поток сознания", который жалко писать "в стол"
воскресенье, 12 апреля 2026 г.
m3DocListQueryExecutor
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий