25193 поиск динамическиъ атрибутов
This commit is contained in:
		| @ -17,22 +17,246 @@ | |||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| Id | Name | Description | | Id                 | Name                | Description | | ||||||
| ---|------|------------ | | ------------------ | ------------------- | ----------- | | ||||||
| Contractor | Контрагент |  | | Contractor         | Контрагент          | | ||||||
| Contract | Договор |  | | Contract           | Договор             | | ||||||
| SignatoryUser | Работник |  | | SignatoryUser      | Работник            | | ||||||
| Project | Проект |  | | Project            | Проект              | | ||||||
| Initiator | Инициатор |  | | Initiator          | Инициатор           | | ||||||
| CUser | Создатель документа |  | | CUser              | Создатель документа | | ||||||
| Curator | Куратор |  | | Curator            | Куратор             | | ||||||
| StageUser | Участник маршрута |  | | StageUser          | Участник маршрута   | | ||||||
| EmpowermentSubject | Полномочия |  | | EmpowermentSubject | Полномочия          | | ||||||
| Filial | Организация |  | | Filial             | Организация         | | ||||||
| Subtype | Подтип |  | | Subtype            | Подтип              | | ||||||
|  |  | ||||||
| Существует строго определённый набор значений поля "Id", приведённый в [таблице ниже](#таблица). Соответствующее им поле "Name" заполняется произвольно. В справочнике «Итоговые выборки поисковой системы» этим значениям будут поставлены в соответствие поля в таблицах, по которым будет осуществляться поиск и фильтрация документов с вложениями. | Существует строго определённый набор значений поля "Id", приведённый в [таблице ниже](#таблица). Соответствующее им поле "Name" заполняется произвольно. В справочнике «Итоговые выборки поисковой системы» этим значениям будут поставлены в соответствие поля в таблицах, по которым будет осуществляться поиск и фильтрация документов с вложениями. | ||||||
|  |  | ||||||
|  | ### Примеры поисковых запросов | ||||||
|  |  | ||||||
|  | <table> | ||||||
|  |   <thead> | ||||||
|  |     <tr> | ||||||
|  |       <th>Имя</th> | ||||||
|  |       <th>Запрос</th> | ||||||
|  |       <th>Поля</th> | ||||||
|  |     </tr> | ||||||
|  |   </thead> | ||||||
|  |     <tbody> | ||||||
|  |       <tr> | ||||||
|  |         <td>Route</td> | ||||||
|  |         <td> | ||||||
|  |             ```sql | ||||||
|  |             SELECT t."DocCode", t."DocType" FROM comdoc."Route" AS t | ||||||
|  |             ``` | ||||||
|  |         </td> | ||||||
|  |   <td>DocName, DocSubject</td> | ||||||
|  |   </tr> | ||||||
|  |   <tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Акты аннулирования</td> | ||||||
|  |       <td> | ||||||
|  |       ```sql | ||||||
|  |       SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM dfd."CancellationAct" AS t | ||||||
|  |       ``` | ||||||
|  |       </td> | ||||||
|  |       <td>Subject, DocTypeName, DocCode</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Графики отпусков</td> | ||||||
|  |       <td> | ||||||
|  |       ```sql | ||||||
|  |       SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM aw."RP_DocVacation" AS t | ||||||
|  |       ``` | ||||||
|  |       </td> | ||||||
|  |       <td>NumDoc, NameDoc, Year, Note</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Дин. атрибуты: договоры</td> | ||||||
|  |       <td> | ||||||
|  |       ```sql | ||||||
|  |       select t."DocCode", t."DocType" from ( SELECT d."VCode" AS "DocCode",  | ||||||
|  |       d."TypeName" AS "DocType", t.* FROM comdoc."DocflowExists" AS d  | ||||||
|  |       join dfd."DocumentConstructor" dc on d."DocumentCategory" = dc."VCode"  | ||||||
|  |       join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode"  | ||||||
|  |       join dfd."DocumentAdditionalAttribute" AS a  | ||||||
|  |       ON dcat."VCode" = a."CategoryAttributeType"  | ||||||
|  |       and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.Contract'  | ||||||
|  |       join contract."VContract" t on a."BigIntValue" = t."VCode" ) as t | ||||||
|  |       ``` | ||||||
|  |       </td> | ||||||
|  |       <td>Name</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Дин. атрибуты: должность</td> | ||||||
|  |       <td> | ||||||
|  |       ```sql | ||||||
|  |       select t."DocCode", t."DocType"  | ||||||
|  |       from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.* FROM comdoc."DocflowExists" AS d  | ||||||
|  |       join dfd."DocumentConstructor" dc on d."DocumentCategory" = dc."VCode"  | ||||||
|  |       join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode"  | ||||||
|  |       join dfd."DocumentAdditionalAttribute" AS a ON dcat."VCode" = a."CategoryAttributeType"  | ||||||
|  |       and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.Post'  | ||||||
|  |       join rp."RP_Post" t on a."BigIntValue" = t."VCode" ) as t | ||||||
|  |       ``` | ||||||
|  | </td> | ||||||
|  |       <td>Name</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Дин. атрибуты: контрагенты</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | select t."DocCode", t."DocType" from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.*  | ||||||
|  | FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc  | ||||||
|  | on d."DocumentCategory" = dc."VCode" join dfd."DocumentCategoryAttributeType" dcat  | ||||||
|  | on dc."VCode" = dcat."PCode" join dfd."DocumentAdditionalAttribute" AS a  | ||||||
|  | ON dcat."VCode" = a."CategoryAttributeType" and d."VCode" = a."PCode"  | ||||||
|  | and dcat."AttributeType" = 'Base.Contractor' join comdoc."Contractor" t  | ||||||
|  | on a."BigIntValue" = t."VCode" ) as t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>FullName, Name</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Дин. атрибуты: подразделение</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | select t."DocCode", t."DocType"  | ||||||
|  | from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.*  | ||||||
|  | FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc  | ||||||
|  | on d."DocumentCategory" = dc."VCode" join dfd."DocumentCategoryAttributeType" dcat  | ||||||
|  | on dc."VCode" = dcat."PCode" join dfd."DocumentAdditionalAttribute" AS a  | ||||||
|  | ON dcat."VCode" = a."CategoryAttributeType" and d."VCode" = a."PCode"  | ||||||
|  | and dcat."AttributeType" = 'Base.Department' join comdoc."Department" t  | ||||||
|  | on a."BigIntValue" = t."VCode" ) as t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>FullName, Name</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Дин. атрибуты: польз. тип атрибутов</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | select t."DocCode", t."DocType"  | ||||||
|  | from ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.*  | ||||||
|  | FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc  | ||||||
|  | on d."DocumentCategory" = dc."VCode"  | ||||||
|  | join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode"  | ||||||
|  | join dfd."DocumentAdditionalAttribute" AS a ON dcat."VCode" = a."CategoryAttributeType"  | ||||||
|  | and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.Unispr'  | ||||||
|  | join dfd."Unispr" t on a."BigIntValue" = t."VCode" ) as t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>Name, AddInfo</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Дин. атрибуты: простые</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | select t."DocCode", t."DocType" from  | ||||||
|  | ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.*, | ||||||
|  |  comdoc."DTOC"(t."DateValue") as "DateFormatted" FROM comdoc."DocflowExists"  | ||||||
|  |  AS d join dfd."DocumentConstructor" dc on d."DocumentCategory" = dc."VCode"  | ||||||
|  |  join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode"  | ||||||
|  |  join dfd."DocumentAdditionalAttribute" AS t ON dcat."VCode" = t."CategoryAttributeType"  | ||||||
|  |  and d."VCode" = t."PCode" and dcat."AttributeType"  | ||||||
|  |  in ('Date', 'bigint', 'double', 'money', 'string', 'longstring', 'DateTime', 'Time') ) as t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>DateFormatted, DateValue, Value, BigIntValue, DoubleValue, MoneyValue, DateTimeValue, TimeValue</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Дин. атрибуты: работник</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | select t."DocCode", t."DocType" from  | ||||||
|  | ( SELECT d."VCode" AS "DocCode", d."TypeName" AS "DocType", t.*  | ||||||
|  | FROM comdoc."DocflowExists" AS d join dfd."DocumentConstructor" dc  | ||||||
|  | on d."DocumentCategory" = dc."VCode"  | ||||||
|  | join dfd."DocumentCategoryAttributeType" dcat on dc."VCode" = dcat."PCode"  | ||||||
|  | join dfd."DocumentAdditionalAttribute" AS a ON dcat."VCode" = a."CategoryAttributeType"  | ||||||
|  | and d."VCode" = a."PCode" and dcat."AttributeType" = 'Base.RP_Worker'  | ||||||
|  | join rp."RP_Worker" t on a."BigIntValue" = t."VCode" ) as t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>NameFull, NameShort</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Договора</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM contract."Contract" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>SubjectOfContract, Number, ContentContract, GoalContract, SpecialCondition, VnNumber</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Заявки на выпуск</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM comdoc."ECPCertificateApplication" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>DocumentNumber, FullName, DocflowUser</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Заявки на отзыв</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM comdoc."ECPCertificateRevocation" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>DocumentNumber, DocumentDate, FullName, Note</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Заявки на планирование отпусков</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM vac."VacationRequest" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>DocumentNumber, Note, PlanYear</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>КЭДО</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM dfd."UniversalDocument" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>Text, DocumentNumber, DocumentDate</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Канцелярия</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM dfd."DocflowDocument" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>Text, Subject, DocumentNumber</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Приложения</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM contract."AdditionalContract" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>SubjectOfContract, Number</td> | ||||||
|  |     </tr> | ||||||
|  |     <tr> | ||||||
|  |       <td>Трудовые договоры</td> | ||||||
|  |       <td> | ||||||
|  | ```sql | ||||||
|  | SELECT t."VCode" AS "DocCode", t."TypeName" AS "DocType" FROM rp."RP_WorkContract" AS t | ||||||
|  | ``` | ||||||
|  | </td> | ||||||
|  |       <td>NumDoc, DateDoc</td> | ||||||
|  |     </tr> | ||||||
|  |   </tbody> | ||||||
|  | </table> | ||||||
|  |  | ||||||
| ## Итоговые выборки поисковой системы | ## Итоговые выборки поисковой системы | ||||||
|  |  | ||||||
| Чтобы открыть справочник «Итоговые выборки поисковой системы», необходимо в меню в папке "Администрирование", подпапке "Документооборот", подпапке "Поисковая система" выбрать пункт «Итоговые выборки поисковой системы». | Чтобы открыть справочник «Итоговые выборки поисковой системы», необходимо в меню в папке "Администрирование", подпапке "Документооборот", подпапке "Поисковая система" выбрать пункт «Итоговые выборки поисковой системы». | ||||||
| @ -225,14 +449,14 @@ and | |||||||
|  |  | ||||||
| ### Настраиваемая выборка "Приложение" | ### Настраиваемая выборка "Приложение" | ||||||
|  |  | ||||||
| | Код          | Наименование           | SQLScript                                                                                                                                                                                                                                                           | | | Код           | Наименование        | SQLScript                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ||||||
| |--------------|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | | ------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||||||
| | Contractor   | Контрагент             | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)<br>)                                                                                             | | | Contractor    | Контрагент          | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)<br>)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | ||||||
| | Contract     | Договор                | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)<br>)                                                                                                 | | | Contract      | Договор             | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)<br>)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ||||||
| | CUser        | Создатель документа    | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)<br>)                                                                                                         | | | CUser         | Создатель документа | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)<br>)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ||||||
| | Initiator    | Инициатор             | and(<br>    exists(<br>      select 1<br>      from "tmp_anFilters_for_documentSearch" as an<br>        join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>      where an."id" = 'Initiator'<br>        and r."Initiator" = an."value"<br>    ))   | | | Initiator     | Инициатор           | and(<br>    exists(<br>      select 1<br>      from "tmp_anFilters_for_documentSearch" as an<br>        join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>      where an."id" = 'Initiator'<br>        and r."Initiator" = an."value"<br>    ))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ||||||
| | StageUser    | Участник маршрута      | and <br>        exists(<br>          select 1<br>          from "tmp_anFilters_for_documentSearch" as an<br>            join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>	          join comdoc."RouteStage" as s on s."PCode" = r."VCode"<br>	          join comdoc."StageItem" as i on i."PCode" = s."VCode"<br>        where an."id" = 'StageUser'<br>          and r."RouteStatus" NOT IN (4)<br>          and i."StageUser" = an."value"<br>        )  | | | StageUser     | Участник маршрута   | and <br>        exists(<br>          select 1<br>          from "tmp_anFilters_for_documentSearch" as an<br>            join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>	          join comdoc."RouteStage" as s on s."PCode" = r."VCode"<br>	          join comdoc."StageItem" as i on i."PCode" = s."VCode"<br>        where an."id" = 'StageUser'<br>          and r."RouteStatus" NOT IN (4)<br>          and i."StageUser" = an."value"<br>        )                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ||||||
| | 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"  ) )| | | 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"  ) ) | | ||||||
|  |  | ||||||
| **В левую часть указывается скрипт:** | **В левую часть указывается скрипт:** | ||||||
|  |  | ||||||
| @ -268,9 +492,9 @@ WHERE t."COrg" = _orgidparam | |||||||
|  |  | ||||||
| ### Настраиваемая выборка "Заявка на выпуск сертификата ЭП" | ### Настраиваемая выборка "Заявка на выпуск сертификата ЭП" | ||||||
|  |  | ||||||
| Код | Наименование | SQLScript | | Код           | Наименование | SQLScript                                                                                                                                                             | | ||||||
| ----|--------------|---------- | | ------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||||||
| SignatoryUser | Работник | "and exists(<br> select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'SignatoryUser' and an."value" = cast(t."DocflowUser" as character varying))" | | SignatoryUser | Работник     | "and exists(<br> select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'SignatoryUser' and an."value" = cast(t."DocflowUser" as character varying))" | | ||||||
|  |  | ||||||
| **В левую часть указывается скрипт:** | **В левую часть указывается скрипт:** | ||||||
|  |  | ||||||
| @ -306,13 +530,13 @@ WHERE t."COrg" = _orgidparam | |||||||
|  |  | ||||||
| ### Настраиваемая выборка "Канцелярия" | ### Настраиваемая выборка "Канцелярия" | ||||||
|  |  | ||||||
| | Код          | Наименование           | SQLScript                                                                                                                                                                                                                                                           | | | Код        | Наименование        | SQLScript                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ||||||
| |--------------|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | | ---------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||||||
| | Contractor   | Контрагент             | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)<br>)                                                                                             | | | Contractor | Контрагент          | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contractor' and an."value" = cast(t."Contractor" as character varying)<br>)                                                                                                                                                                                                                                                                                                                            | | ||||||
| | Contract     | Договор                | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)<br>)                                                                                                 | | | Contract   | Договор             | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."Contract" as character varying)<br>)                                                                                                                                                                                                                                                                                                                                | | ||||||
| | CUser        | Создатель документа    | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)<br>)                                                                                                         | | | CUser      | Создатель документа | and exists(<br>  select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)<br>)                                                                                                                                                                                                                                                                                                                                      | | ||||||
| | Initiator    | Инициатор             | and(<br>    exists(<br>      select 1<br>      from "tmp_anFilters_for_documentSearch" as an<br>        join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>      where an."id" = 'Initiator'<br>        and r."Initiator" = an."value"<br>    ))   | | | Initiator  | Инициатор           | and(<br>    exists(<br>      select 1<br>      from "tmp_anFilters_for_documentSearch" as an<br>        join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>      where an."id" = 'Initiator'<br>        and r."Initiator" = an."value"<br>    ))                                                                                                                                                                                                             | | ||||||
| | StageUser    | Участник маршрута      | and <br>        exists(<br>          select 1<br>          from "tmp_anFilters_for_documentSearch" as an<br>            join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>	          join comdoc."RouteStage" as s on s."PCode" = r."VCode"<br>	          join comdoc."StageItem" as i on i."PCode" = s."VCode"<br>        where an."id" = 'StageUser'<br>          and r."RouteStatus" NOT IN (4)<br>          and i."StageUser" = an."value"<br>        )  | | | StageUser  | Участник маршрута   | and <br>        exists(<br>          select 1<br>          from "tmp_anFilters_for_documentSearch" as an<br>            join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"<br>	          join comdoc."RouteStage" as s on s."PCode" = r."VCode"<br>	          join comdoc."StageItem" as i on i."PCode" = s."VCode"<br>        where an."id" = 'StageUser'<br>          and r."RouteStatus" NOT IN (4)<br>          and i."StageUser" = an."value"<br>        ) | | ||||||
|  |  | ||||||
| **В левую часть указывается скрипт:** | **В левую часть указывается скрипт:** | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user