оформление таблицы

This commit is contained in:
mirzakaev_tf 2024-07-16 12:02:53 +05:00
parent 6c473047f5
commit 7019b0a30e
1 changed files with 170 additions and 52 deletions

View File

@ -97,19 +97,176 @@ WHERE 1 = 1
<!-- ![Пример документа "Итог FTS"](./media/ResultFTSForm.png) -->
| Код | Наименование | 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)) |
| Contract | Договор | and exists(<br> select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Contract' and an."value" = cast(t."VCode" as character varying)) |
| Project | Проект | and exists(<br> select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Project' and an."value" = cast(t."Project" as character varying)) |
| Curator | Куратор | and(<br> exists(<br> select 1<br> from "tmp_anFilters_for_documentSearch" as an<br> join rp."RP_Worker" w ON t."Manager" = w."VCode"<br> JOIN rp."RP_Person" AS p ON w."IdPerson" = p."VCode"<br> JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode"<br> where an."id" = 'Curator'<br> and pc."IdTypeContact" = 6<br> and pc."Code" = an."value"<br> )) |
| StageUser | Участник маршрута | and exists(<br> select 1 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>) |
| 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)) |
| 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")) |
| Filial | Организация | and exists( select 1 from "tmp_anFilters_for_documentSearch" as an
where an."id" = 'Filial'
and t."COrg"::text = an."value"
) |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SQL Syntax Highlighting</title>
<style>
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
}
th {
background-color: #f2f2f2;
text-align: left;
}
code {
background-color: #f9f9f9;
padding: 2px 4px;
border-radius: 4px;
}
.sql-keyword {
color: #0000FF;
font-weight: bold;
}
.sql-identifier {
color: #A31515;
}
.sql-string {
color: #A31515;
}
.sql-comment {
color: #008000;
}
</style>
</head>
<body>
<h2>Примеры настраиваемых выборок</h2>
<h3>Настраиваемая выборка для кадрового электронного документооборота</h3>
<table>
<thead>
<tr>
<th>Код</th>
<th>Наименование</th>
<th>SQLScript</th>
</tr>
</thead>
<tbody>
<tr>
<td>CUser</td>
<td>Создатель документа</td>
<td><code>and exists( select 1 from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'CUser'</span> and an.<span class="sql-identifier">"value"</span> = cast(t.<span class="sql-identifier">"CUser"</span> as character varying) )</code></td>
</tr>
<tr>
<td>Initiator</td>
<td>Инициатор</td>
<td>
<code>and( <br>
exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
join <span class="sql-identifier">comdoc."Route"</span> as r on r.<span class="sql-identifier">"DocCode"</span> = t.<span class="sql-identifier">"VCode"</span> and r.<span class="sql-identifier">"DocType"</span> = t.<span class="sql-identifier">"TypeName"</span> <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'Initiator'</span> <br>
and r.<span class="sql-identifier">"Initiator"</span> = an.<span class="sql-identifier">"value"</span> <br>
)</code>
</td>
</tr>
<tr>
<td>StageUser</td>
<td>Участник маршрута</td>
<td>
<code>and <br>
exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
join <span class="sql-identifier">comdoc."Route"</span> as r on r.<span class="sql-identifier">"DocCode"</span> = t.<span class="sql-identifier">"VCode"</span> and r.<span class="sql-identifier">"DocType"</span> = t.<span class="sql-identifier">"TypeName"</span> <br>
join <span class="sql-identifier">comdoc."RouteStage"</span> as s on s.<span class="sql-identifier">"PCode"</span> = r.<span class="sql-identifier">"VCode"</span> <br>
join <span class="sql-identifier">comdoc."StageItem"</span> as i on i.<span class="sql-identifier">"PCode"</span> = s.<span class="sql-identifier">"VCode"</span> <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'StageUser'</span> <br>
and r.<span class="sql-identifier">"RouteStatus"</span> NOT IN (4) <br>
and i.<span class="sql-identifier">"StageUser"</span> = an.<span class="sql-identifier">"value"</span> <br>
)</code>
</td>
</tr>
<tr>
<td>SignatoryUser</td>
<td>Работник</td>
<td>
<code>and( <br>
exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
join <span class="sql-identifier">comdoc."Route"</span> as r on r.<span class="sql-identifier">"DocCode"</span> = t.<span class="sql-identifier">"VCode"</span> and r.<span class="sql-identifier">"DocType"</span> = t.<span class="sql-identifier">"TypeName"</span> <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'SignatoryUser'</span> <br>
and r.<span class="sql-identifier">"DocType"</span> = <span class="sql-string">'EmployeeStatement'</span> <br>
and r.<span class="sql-identifier">"Initiator"</span> = an.<span class="sql-identifier">"value"</span> <br>
) or exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
join <span class="sql-identifier">comdoc."Route"</span> as r on r.<span class="sql-identifier">"DocCode"</span> = t.<span class="sql-identifier">"VCode"</span> and r.<span class="sql-identifier">"DocType"</span> = t.<span class="sql-identifier">"TypeName"</span> <br>
join <span class="sql-identifier">comdoc."RouteStage"</span> as s on s.<span class="sql-identifier">"PCode"</span> = r.<span class="sql-identifier">"VCode"</span> <br>
join <span class="sql-identifier">comdoc."StageItem"</span> as i on i.<span class="sql-identifier">"PCode"</span> = s.<span class="sql-identifier">"VCode"</span> <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'SignatoryUser'</span> <br>
and r.<span class="sql-identifier">"DocType"</span> = <span class="sql-string">'LND'</span> <br>
AND r.<span class="sql-identifier">"RouteStatus"</span> NOT IN(4) <br>
AND s.<span class="sql-identifier">"IsMarked"</span> IS NOT true <br>
AND COALESCE(i.<span class="sql-identifier">"DocumentAction"</span>, 0) IN (20, 30) <br>
and i.<span class="sql-identifier">"StageUser"</span> = an.<span class="sql-identifier">"value"</span> <br>
) or exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
join <span class="sql-identifier">comdoc."ReadListItem"</span> as r on r.<span class="sql-identifier">"DocCode"</span> = t.<span class="sql-identifier">"VCode"</span> and r.<span class="sql-identifier">"DocType"</span> = t.<span class="sql-identifier">"TypeName"</span> <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'SignatoryUser'</span> <br>
and r.<span class="sql-identifier">"DocType"</span> = <span class="sql-string">'LND'</span> <br>
and r.<span class="sql-identifier">"DocflowUser"</span> = an.<span class="sql-identifier">"value"</span> <br>
) or exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
join <span class="sql-identifier">dfd."EmpowermentWorkerDetail"</span> as ewd on ewd.<span class="sql-identifier">"PCode"</span> = t.<span class="sql-identifier">"VCode"</span> <br>
JOIN <span class="sql-identifier">rp."RP_Person"</span> AS p ON ewd.<span class="sql-identifier">"PersonId"</span> = p.<span class="sql-identifier">"VCode"</span> <br>
JOIN <span class="sql-identifier">rp."RP_PersonContact"</span> AS pc on p.<span class="sql-identifier">"VCode"</span> = pc.<span class="sql-identifier">"Pcode"</span> <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'SignatoryUser'</span> <br>
and t.<span class="sql-identifier">"TypeName"</span> = <span class="sql-string">'EmpowermentConstructor'</span> <br>
and pc.<span class="sql-identifier">"IdTypeContact"</span> = 6 <br>
and pc.<span class="sql-identifier">"Code"</span> = an.<span class="sql-identifier">"value"</span> <br>
)
)
</code>
</td>
</tr>
<tr>
<td>EmpowermentSubject</td>
<td>Полномочия</td>
<td>
<code>and <br>
exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
join <span class="sql-identifier">dfd."EmpowermentSubjectDetail"</span> as esd on esd.<span class="sql-identifier">"PCode"</span> = t.<span class="sql-identifier">"VCode"</span> <br>
JOIN <span class="sql-identifier">dfd."EmpowermentSubject"</span> AS s ON esd.<span class="sql-identifier">"Subject"</span> = s.<span class="sql-identifier">"VCode"</span> <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'EmpowermentSubject'</span> <br>
and t.<span class="sql-identifier">"TypeName"</span> = <span class="sql-string">'EmpowermentConstructor'</span> <br>
and s.<span class="sql-identifier">"VCode"</span> = an.<span class="sql-identifier">"value"</span>::bigint <br>
)
</code>
</td>
</tr>
<tr>
<td>Filial</td>
<td>Организация</td>
<td>
<code>and exists( <br>
select 1 <br>
from <span class="sql-identifier">"tmp_anFilters_for_documentSearch"</span> as an <br>
where an.<span class="sql-identifier">"id"</span> = <span class="sql-string">'Filial'</span> <br>
and t.<span class="sql-identifier">"COrg"</span>::text = an.<span class="sql-identifier">"value"</span> <br>
)
</code>
</td>
</tr>
</tbody>
</table>
</body>
</html> |
## Настройка документов
@ -119,45 +276,6 @@ WHERE 1 = 1
## Примеры настраиваемых выборок
### Настраиваемая выборка для кадрового электронного документооборота
| Код | Наименование | 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( <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> ) |
| SignatoryUser | Работник | 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" = 'SignatoryUser' <br> and r."DocType" = 'EmployeeStatement' <br> and r."Initiator" = an."value" <br> ) or 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" = 'SignatoryUser' <br> and r."DocType" = 'LND' <br> AND r."RouteStatus" NOT IN(4) <br> AND s."IsMarked" IS NOT true <br> AND COALESCE(i."DocumentAction", 0) IN (20, 30) <br> and i."StageUser" = an."value" <br> ) or exists( <br> select 1 <br> from "tmp_anFilters_for_documentSearch" as an <br> join comdoc."ReadListItem" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName" <br> where an."id" = 'SignatoryUser' <br> and r."DocType" = 'LND' <br> and r."DocflowUser" = an."value" <br> ) or exists( <br> select 1 <br> from "tmp_anFilters_for_documentSearch" as an <br> join dfd."EmpowermentWorkerDetail" as ewd on ewd."PCode" = t."VCode" <br> JOIN rp."RP_Person" AS p ON ewd."PersonId" = p."VCode" <br> JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode" <br> where an."id" = 'SignatoryUser' <br> and t."TypeName" = 'EmpowermentConstructor' <br> and pc."IdTypeContact" = 6 <br> and pc."Code" = an."value" <br> )) |
| EmpowermentSubject | Полномочия | and <br> exists( <br> select 1 <br> from "tmp_anFilters_for_documentSearch" as an <br> join dfd."EmpowermentSubjectDetail" as esd on esd."PCode" = t."VCode" <br> JOIN dfd."EmpowermentSubject" AS s ON esd."Subject" = s."VCode" <br> where an."id" = 'EmpowermentSubject' <br> and t."TypeName" = 'EmpowermentConstructor' <br> and s."VCode" = an."value"::bigint <br> ) <br> |
Filial | Организация | and exists( select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'Filial' and t."COrg"::text = an."value" )|
```sql
SELECT t."VCode" AS "DocCode"
, t."TypeName" AS "DocType"
, :DateProperty AS "DocDate"
, :NumberProperty AS "DocNumber"
, NULL::bigint AS "ContractorId"
, NULL::bigint AS "ContractId"
, NULL::bigint AS "AddContractId"
, NULL::bigint AS "ProjectId"
FROM dfd."UniversalDocument" as t
WHERE 1 = 1
```
**В правую часть:**
```sql
SELECT t."VCode" AS "DocCode"
, t."TypeName" AS "DocType"
, :DateProperty AS "DocDate"
, :NumberProperty AS "DocNumber"
, NULL AS "DocName"
, NULL AS "DocTheme"
, NULL AS "DocDefinition"
FROM dfd."UniversalDocument" as t
WHERE 1 = 1
```
### Настраиваемая выборка "Приложение"
| Код | Наименование | SQLScript |