25193 поиск динамическиъ атрибутов
This commit is contained in:
parent
7eb90a0ce3
commit
dce49059f9
@ -17,22 +17,246 @@
|
||||
|
||||

|
||||
|
||||
Id | Name | Description
|
||||
---|------|------------
|
||||
Contractor | Контрагент |
|
||||
Contract | Договор |
|
||||
SignatoryUser | Работник |
|
||||
Project | Проект |
|
||||
Initiator | Инициатор |
|
||||
CUser | Создатель документа |
|
||||
Curator | Куратор |
|
||||
StageUser | Участник маршрута |
|
||||
EmpowermentSubject | Полномочия |
|
||||
Filial | Организация |
|
||||
Subtype | Подтип |
|
||||
| Id | Name | Description |
|
||||
| ------------------ | ------------------- | ----------- |
|
||||
| Contractor | Контрагент |
|
||||
| Contract | Договор |
|
||||
| SignatoryUser | Работник |
|
||||
| Project | Проект |
|
||||
| Initiator | Инициатор |
|
||||
| CUser | Создатель документа |
|
||||
| Curator | Куратор |
|
||||
| StageUser | Участник маршрута |
|
||||
| EmpowermentSubject | Полномочия |
|
||||
| Filial | Организация |
|
||||
| Subtype | Подтип |
|
||||
|
||||
Существует строго определённый набор значений поля "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>
|
||||
|
||||
## Итоговые выборки поисковой системы
|
||||
|
||||
Чтобы открыть справочник «Итоговые выборки поисковой системы», необходимо в меню в папке "Администрирование", подпапке "Документооборот", подпапке "Поисковая система" выбрать пункт «Итоговые выборки поисковой системы».
|
||||
@ -226,7 +450,7 @@ and
|
||||
### Настраиваемая выборка "Приложение"
|
||||
|
||||
| Код | Наименование | 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>) |
|
||||
| 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>) |
|
||||
@ -268,9 +492,9 @@ WHERE t."COrg" = _orgidparam
|
||||
|
||||
### Настраиваемая выборка "Заявка на выпуск сертификата ЭП"
|
||||
|
||||
Код | Наименование | 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))"
|
||||
| Код | Наименование | 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))" |
|
||||
|
||||
**В левую часть указывается скрипт:**
|
||||
|
||||
@ -307,7 +531,7 @@ WHERE t."COrg" = _orgidparam
|
||||
### Настраиваемая выборка "Канцелярия"
|
||||
|
||||
| Код | Наименование | 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>) |
|
||||
| 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>) |
|
||||
|
Loading…
x
Reference in New Issue
Block a user