-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetSP.dbs
30 lines (30 loc) · 2.71 KB
/
getSP.dbs
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
<data name="getSP" transports="http">
<config enableOData="false" id="rcs">
<property name="carbon_datasource_name">RCS</property>
</config>
<query id="query" useConfig="rcs">
<sql>SELECT A.K_SP,B.VOL_ZNAK,A.KC_SP_DRUH,(SELECT NC_RD_DRUH FROM ISV_SYSTEM.C_RD_DRUH WHERE KC_RD_DRUH = B.KC_RD_DRUH) AS NC_RD_DRUH,(SELECT NC_SP_VYR FROM ISV_SYSTEM.C_SP_VYR WHERE KC_SP_VYR = A.KC_SP_VYR) AS NC_SP_VYR, (SELECT NC_SP_TYP FROM ISV_SYSTEM.C_SP_TYP WHERE KC_SP_TYP = A.KC_SP_TYP) AS NC_SP_TYP,A.N_SP,A.VYR_CISLO,A.INV_CISLO,A.E_SP,B.SEL_PRI,NULL as RFSI,(SELECT K_JPO FROM H_SP WHERE H_SP.K_SP = A.K_SP AND XH_SP = 1 AND ROWNUM = 1) AS JPO,(SELECT K_TPO FROM H_SP WHERE H_SP.K_SP = A.K_SP AND XH_SP = 1 AND ROWNUM = 1) AS K_TPO FROM SP A JOIN SP_ANALOG B ON A.K_SP = B.K_SP WHERE X_SP = 1 AND KC_SP_DRUH = 1 AND VOL_ZNAK IS NOT NULL UNION SELECT A.K_SP,B.VOL_ZNAK,A.KC_SP_DRUH,(SELECT NC_RD_DRUH FROM ISV_CSC.C_RD_DRUH WHERE KC_RD_DRUH = B.KC_RD_DRUH) AS NC_RD_DRUH,(SELECT NC_SP_VYR FROM ISV_CSC.C_SP_VYR WHERE KC_SP_VYR = A.KC_SP_VYR) AS NC_SP_VYR, (SELECT NC_SP_TYP FROM ISV_CSC.C_SP_TYP WHERE KC_SP_TYP = A.KC_SP_TYP) AS NC_SP_TYP,A.N_SP,A.VYR_CISLO,A.INV_CISLO,A.E_SP,'' as SEL_PRI,TO_CHAR(C.RFSI_R)||'.'||TO_CHAR(C.RFSI_F)||'.'||TO_CHAR(C.RFSI_S)||'.'||TO_CHAR(C.RFSI_I) AS RFSI,(SELECT K_JPO FROM H_SP WHERE H_SP.K_SP = A.K_SP AND XH_SP = 1 AND ROWNUM = 1) AS JPO,(SELECT K_TPO FROM H_SP WHERE H_SP.K_SP = A.K_SP AND XH_SP = 1 AND ROWNUM = 1) AS K_TPO FROM SP A JOIN SP_MATRA B ON A.K_SP = B.K_SP JOIN RFSI C ON B.K_RFSI = C.K_RFSI WHERE X_SP = 1 AND KC_SP_DRUH = 2 AND B.VOL_ZNAK IS NOT NULL</sql>
<result element="list" rowName="sp">
<element column="K_SP" name="k" xsdType="number"/>
<element column="KC_SP_DRUH" name="druh" xsdType="string"/>
<element column="NC_RD_DRUH" name="pdruh" xsdType="string"/>
<element column="NC_SP_VYR" name="vyr" xsdType="string"/>
<element column="NC_SP_TYP" name="typ" xsdType="string"/>
<element column="VOL_ZNAK" name="z" xsdType="string"/>
<element column="N_SP" name="nazev" xsdType="string"/>
<element column="E_SP" name="ident" xsdType="string"/>
<element column="VYR_CISLO" name="vcis" xsdType="string"/>
<element column="INV_CISLO" name="icis" xsdType="string"/>
<element column="SEL_PRI" name="svol" xsdType="string"/>
<element column="RFSI" name="rfsi" xsdType="string"/>
<element column="JPO" name="evcj" xsdType="string"/>
<element column="K_TPO" name="tpo" xsdType="integer"/>
</result>
</query>
<operation name="get">
<call-query href="query"/>
</operation>
<resource method="GET" path="/">
<call-query href="query"/>
</resource>
</data>