1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
create or replace view hls_document_use_seal_vl as
select t.document_use_seal_id,
t.document_table,
t.document_id AS contract_id,
t.instruments_types,
(select v.code_value_name
from sys_code_values_v v
where v.code_value = t.instruments_types
and v.code = 'REPURCHASE_TYPES') as instruments_types_n,
t.common_seal,
(select v.code_value_name
from sys_code_values_v v
where v.code_value = t.common_seal
and v.code = 'YES_OR_NO') as common_seal_n,
t.corporate_visa_seal,
(select v.code_value_name
from sys_code_values_v v
where v.code_value = t.corporate_visa_seal
and v.code = 'YES_OR_NO') as corporate_visa_seal_n,
t.legal_seal,
(select v.code_value_name
from sys_code_values_v v
where v.code_value = t.legal_seal
and v.code = 'YES_OR_NO') as legal_seal_n,
t.con_special_seal,
(select v.code_value_name
from sys_code_values_v v
where v.code_value = t.con_special_seal
and v.code = 'YES_OR_NO') as con_special_seal_n,
t.financial_seal,
(select v.code_value_name
from sys_code_values_v v
where v.code_value = t.financial_seal
and v.code = 'YES_OR_NO') as financial_seal_n,
t.supervisio_seal,
(select v.code_value_name
from sys_code_values_v v
where v.code_value = t.supervisio_seal
and v.code = 'YES_OR_NO') as supervisio_seal_n,
t.seal_number as SEAL_QUANTITY
from HLS_DOCUMENT_USE_SEAL t;