injectionTripPmfm.xml 1.79 KB
Newer Older
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
<?xml version="1.0" encoding="UTF-8"?>
<query type="select">
    <!-- double -->
    <select alias="&amp;pmfmLabel%pmfmAlias%" group="double%pmfmAlias%" type="number">(SELECT NUMERICAL_VALUE FROM VESSEL_USE_MEASUREMENT VUM WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)</select>

    <!-- integer -->
    <select alias="&amp;pmfmLabel%pmfmAlias%" group="integer%pmfmAlias%" type="number">
        (SELECT
            CAST(NUMERICAL_VALUE AS INT)
        FROM VESSEL_USE_MEASUREMENT VUM
        WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
    </select>

    <!-- text -->
    <select alias="&amp;pmfmLabel%pmfmAlias%" group="string%pmfmAlias%" type="text">(SELECT ALPHANUMERICAL_VALUE FROM VESSEL_USE_MEASUREMENT VUM WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)</select>

    <!-- qualitative value -->
    <select alias="&amp;pmfmLabel%pmfmAlias%" group="qualitative_value%pmfmAlias%" type="text">
     (SELECT QV.LABEL
     FROM VESSEL_USE_MEASUREMENT VUM
       INNER JOIN QUALITATIVE_VALUE QV on QV.ID = VUM.QUALITATIVE_VALUE_FK
     WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
    </select>

    <!-- boolean -->
    <select alias="&amp;pmfmLabel%pmfmAlias%" group="boolean%pmfmAlias%" type="text">
     (SELECT DECODE(VUM.NUMERICAL_VALUE, 1, 'Y', 0, 'N')
     FROM VESSEL_USE_MEASUREMENT VUM
     WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
    </select>

    <!-- date -->
    <select alias="&amp;pmfmLabel%pmfmAlias%" group="date%pmfmAlias%" type="text"><![CDATA[
        (SELECT
            TO_CHAR(TIMESTAMP(REPLACE(REPLACE(VUM.ALPHANUMERICAL_VALUE, 'T', ' '), 'Z', '')), 'YYYY-DD-MM')
        FROM VESSEL_USE_MEASUREMENT VUM
        WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
    ]]>
    </select>
</query>