-
Notifications
You must be signed in to change notification settings - Fork 0
/
EFFECTIVENESS.xml
132 lines (117 loc) · 7.29 KB
/
EFFECTIVENESS.xml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0" encoding="UTF-8"?>
<dbwebdescriptor version='2.0'>
<label>EFFECTIVENESS</label>
<description>Effectiveness</description>
<queries>
<querystring id='Report_Info' database='dbnode'>
select distinct r.*,count(v.dbn_repv_viewname) Views_Used, min(e.Ref_Status) Extr_Status from dbn_report r, dbn_report_views v, dbn_entities e where (v.dbn_repv_viewname = e.ViewName) and (v.dbn_repv_parid = r.dbn_rep_id) and r.dbn_rep_id ='pRID'
</querystring>
<querystring id='Report_Prompt' database='dbnode'>
select * from dbn_report_parameters
where dbn_repp_parid='pRID';
</querystring>
<!-- Effectiveness voor Ex
SELECT DATE_FORMAT(date_field, '%Y-%m-%d') AS date_field
, assets_planned 'assets_plan'
, ifnull(assets_count,0) 'assets_read'
FROM
(SELECT date_field,date_tk
, sum(mum.nbr_of_assets) AS assets_planned
from mrqr_mission_units_material mum
INNER JOIN mrqr_mission_participating_units mpu on mum.omu_id=mpu.omu_id, damrsysl_calendar_dates
WHERE mum.function like 'IV8T'
and mpu.mission_code='B017283'
AND date_field >= DATE_SUB(CURRENT_DATE, INTERVAL 1 YEAR) AND date_field < DATE_ADD(CURRENT_DATE, INTERVAL 1 YEAR)
AND date_field >= mpu.start_date AND date_field < mpu.end_date
GROUP BY date_field, date_tk) plan_sum
inner join
(
SELECT date_tk
, COUNT(distinct ma.asset) AS assets_count
FROM mrqr_assets ma inner join mrqr_readings mr on ma.asset=mr.asset
inner join mrqr_mission_codes mc on mr.mission_code_id=mc.mission_code_id, damrsysl_calendar_dates
WHERE ma.HIGHER_ASSET IS NULL
and ma.function like 'IV8T'
AND ma.STATUS NOT IN('D','A','B','E','O') AND (ma.STORE NOT LIKE('%VE') OR ma.STORE IS NULL)
AND date_field >= DATE_SUB(CURRENT_DATE, INTERVAL 1 YEAR) AND date_field < DATE_ADD(CURRENT_DATE, INTERVAL 1 YEAR)
AND MFRDATE <= date_field
and date(mr.readingdate)=date_field
and mc.mission_code='B017283'
GROUP BY date_tk) read_sum
on plan_sum.date_tk=read_sum.date_tk
-->
<querystring id='SUMMARY' database='dbnode' timeout="30000">
SELECT DATE_FORMAT(dates.date_field, '%Y-%m-%d') 'DATE_FIELD'
, ifnull(assets_planned,0) 'ASSETS_PLAN'
, assets_count 'ASSETS_THEO'
, (assets_count - ifnull(assets_PPM,0)) 'ASSETS_REAL'
FROM
(
select
date_field,
date_tk
from damrsysl_calendar_dates
where date_field >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) AND date_field <= DATE_ADD(CURRENT_DATE, INTERVAL 1 YEAR)
) dates
left join
(
SELECT date_field, date_tk
, COUNT(ASSET) AS assets_count
FROM mrqr_assets ma, damrsysl_calendar_dates
WHERE ma.HIGHER_ASSET IS NULL
and ma.function like 'pFUNCTION'
AND ma.STATUS NOT IN('D','A','B','E','O') AND (ma.STORE NOT LIKE('%VE') OR ma.STORE IS NULL)
AND date_field >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) AND date_field <= DATE_ADD(CURRENT_DATE, INTERVAL 1 YEAR)
AND MFRDATE <= date_field
GROUP BY date_tk
) exist_sum
on dates.date_tk=exist_sum.date_tk
left join
(
SELECT date_field, date_tk
, sum(mum.nbr_of_assets) AS assets_planned
from mrqr_mission_units_material mum
INNER JOIN mrqr_mission_participating_units mpu on mum.omu_id=mpu.omu_id, damrsysl_calendar_dates
WHERE mum.function like 'pFUNCTION'
AND date_field >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) AND date_field < DATE_ADD(CURRENT_DATE, INTERVAL 1 YEAR)
AND date_field >= mpu.start_date AND date_field < mpu.end_date
GROUP BY date_tk
) plan_sum
on plan_sum.date_tk=dates.date_tk
left join
(
select date_field, date_tk
, ifnull(COUNT(distinct marp.ASSET),0) AS assets_PPM
FROM mrqr_assets_remaining_potential marp
inner join mrqr_assets ma on marp.asset=ma.asset
inner join mrqr_ppms mp on marp.ppm=mp.ppm
, damrsysl_calendar_dates
WHERE ma.HIGHER_ASSET IS NULL
and ma.function like 'pFUNCTION'
and marp.meter='CD'
AND ma.STATUS NOT IN('D','A','B','E','O') AND (ma.STORE NOT LIKE('%VE') OR ma.STORE IS NULL)
AND date_field >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) AND date_field <= DATE_ADD(CURRENT_DATE, INTERVAL 1 YEAR)
AND date_field >= DATE_ADD(CURRENT_DATE, INTERVAL marp.remaining_potential DAY)
AND date_field <= DATE_ADD(CURRENT_DATE, INTERVAL marp.remaining_potential+mp.duration DAY)
GROUP BY date_tk
) ppm_sum
on dates.date_tk=ppm_sum.date_tk
WHERE
(length(replace(replace('pFUNCTION','%',''),'_',''))>=2
)
</querystring>
</queries>
<parameters>
<parameter name='pRID' value='100106'/>
<parameter name='pLANG' value='EN'/>
<parameter name='pMODE' value='Main'/>
<parameter name='pINFO' value='IPDT'/>
<parameter name='pFUNCTION' value='IV8T' />
<parameter name='pR1' value='STATUS'/>
<parameter name='pR2' value='STATUS'/>
<parameter name='pC1' value='DATE_FIELD'/>
<parameter name='pGR1' value='DATE_FIELD'/>
<parameter name='pGR2' value='DATE_FIELD'/>
<parameter name='pGC1' value='STATUS'/>
</parameters>
</dbwebdescriptor>