From f56905508e70d1e2dcf693eeca8632919143e388 Mon Sep 17 00:00:00 2001 From: mirzakaev_tf Date: Thu, 26 Dec 2024 10:50:53 +0500 Subject: [PATCH] =?UTF-8?q?24217=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=9F=D0=BE=D0=B8=D1=81=D0=BA=D0=9F=D0=BE=D0=B4=D1=82?= =?UTF-8?q?=D0=B8=D0=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Admin manuals/Настройка архива/index.md | 281 ++++++++----------- 1 file changed, 114 insertions(+), 167 deletions(-) diff --git a/docs/Admin manuals/Настройка архива/index.md b/docs/Admin manuals/Настройка архива/index.md index b7ad520..d0ee5a6 100644 --- a/docs/Admin manuals/Настройка архива/index.md +++ b/docs/Admin manuals/Настройка архива/index.md @@ -28,6 +28,8 @@ CUser | Создатель документа | Curator | Куратор | StageUser | Участник маршрута | EmpowermentSubject | Полномочия | +Filial | Организация | +Subtype | Подтип | Существует строго определённый набор значений поля "Id", приведённый в [таблице ниже](#таблица). Соответствующее им поле "Name" заполняется произвольно. В справочнике «Итоговые выборки поисковой системы» этим значениям будут поставлены в соответствие поля в таблицах, по которым будет осуществляться поиск и фильтрация документов с вложениями. @@ -96,177 +98,122 @@ WHERE 1 = 1 +В табличную часть "Фильтры" указывается следующее: - - - - - - SQL Syntax Highlighting - - - +**CUser - Создатель документа** +```sql +and exists( +select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying) +) +``` -

Примеры настраиваемых выборок

-

Настраиваемая выборка для кадрового электронного документооборота

+**Initiator - Инициатор** +```sql +and( + exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" + where an."id" = 'Initiator' + and r."Initiator" = an."value" + ) +) +``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
КодНаименованиеSQLScript
CUserСоздатель документаand exists( select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying) )
InitiatorИнициатор - and(
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- where an."id" = 'Initiator'
- and r."Initiator" = an."value"
- )
-
StageUserУчастник маршрута - and
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- join comdoc."RouteStage" as s on s."PCode" = r."VCode"
- join comdoc."StageItem" as i on i."PCode" = s."VCode"
- where an."id" = 'StageUser'
- and r."RouteStatus" NOT IN (4)
- and i."StageUser" = an."value"
- )
-
SignatoryUserРаботник - and(
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- where an."id" = 'SignatoryUser'
- and r."DocType" = 'EmployeeStatement'
- and r."Initiator" = an."value"
- ) or exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- join comdoc."RouteStage" as s on s."PCode" = r."VCode"
- join comdoc."StageItem" as i on i."PCode" = s."VCode"
- where an."id" = 'SignatoryUser'
- and r."DocType" = 'LND'
- AND r."RouteStatus" NOT IN(4)
- AND s."IsMarked" IS NOT true
- AND COALESCE(i."DocumentAction", 0) IN (20, 30)
- and i."StageUser" = an."value"
- ) or exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."ReadListItem" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- where an."id" = 'SignatoryUser'
- and r."DocType" = 'LND'
- and r."DocflowUser" = an."value"
- ) or exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join dfd."EmpowermentWorkerDetail" as ewd on ewd."PCode" = t."VCode"
- JOIN rp."RP_Person" AS p ON ewd."PersonId" = p."VCode"
- JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode"
- where an."id" = 'SignatoryUser'
- and t."TypeName" = 'EmpowermentConstructor'
- and pc."IdTypeContact" = 6
- and pc."Code" = an."value"
- ) - ) -
-
EmpowermentSubjectПолномочия - and
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join dfd."EmpowermentSubjectDetail" as esd on esd."PCode" = t."VCode"
- JOIN dfd."EmpowermentSubject" AS s ON esd."Subject" = s."VCode"
- where an."id" = 'EmpowermentSubject'
- and t."TypeName" = 'EmpowermentConstructor'
- and s."VCode" = an."value"::bigint
- ) -
-
FilialОрганизация - and exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- where an."id" = 'Filial'
- and t."COrg"::text = an."value"
- ) -
-
+**StageUser - Участник маршрута** +```sql +and + exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" + join comdoc."RouteStage" as s on s."PCode" = r."VCode" + join comdoc."StageItem" as i on i."PCode" = s."VCode" + where an."id" = 'StageUser' + and r."RouteStatus" NOT IN (4) + and i."StageUser" = an."value" + ) - - | +``` + +**EmpowermentSubject - Полномочия** +```sql +and + exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + join dfd."EmpowermentSubjectDetail" as esd on esd."PCode" = t."VCode" + JOIN dfd."EmpowermentSubject" AS s ON esd."Subject" = s."VCode" + where an."id" = 'EmpowermentSubject' + and t."TypeName" = 'EmpowermentConstructor' + and s."VCode" = an."value"::bigint + ) +``` + +**SignatoryUser - Работник** +```sql +and( + exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" + where an."id" = 'SignatoryUser' + and r."DocType" = 'EmployeeStatement' + and r."Initiator" = an."value" + ) or exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" + join comdoc."RouteStage" as s on s."PCode" = r."VCode" + join comdoc."StageItem" as i on i."PCode" = s."VCode" + where an."id" = 'SignatoryUser' + and r."DocType" = 'LND' + AND r."RouteStatus" NOT IN(4) + AND s."IsMarked" IS NOT true + AND COALESCE(i."DocumentAction", 0) IN (20, 30) + and i."StageUser" = an."value" + ) or exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + join comdoc."ReadListItem" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" + where an."id" = 'SignatoryUser' + and r."DocType" = 'LND' + and r."DocflowUser" = an."value" + ) or exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + join dfd."EmpowermentWorkerDetail" as ewd on ewd."PCode" = t."VCode" + JOIN rp."RP_Person" AS p ON ewd."PersonId" = p."VCode" + JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode" + where an."id" = 'SignatoryUser' + and t."TypeName" = 'EmpowermentConstructor' + and pc."IdTypeContact" = 6 + and pc."Code" = an."value" + ) +) +``` + +**Filial - Организация** +```sql +and + exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + where an."id" = 'Filial' + and t."COrg"::text = an."value" + ) +``` + +**Subtype - Подтип** +```sql +and + exists( + select 1 + from "tmp_anFilters_for_documentSearch" as an + where an."id" = 'Subtype' + and t."DocumentSubtype"::text = an."value"::text + ) +``` ## Настройка документов