YASK#67148 -- Toevoegen deelsrtcontrole rapportage
svn path=/Customer/trunk/; revision=52045
This commit is contained in:
@@ -1112,6 +1112,91 @@ AS
|
||||
FROM yask_v_kosten_doorb_frozen f, mld_v_udr_melding u
|
||||
WHERE f.mld_melding_key = u.melding_key;
|
||||
|
||||
-- View met de resultaten van uitgevoerde en geplande inspecties
|
||||
-- gecombineerd met nog uit te voeren inspecties.
|
||||
CREATE OR REPLACE VIEW yask_v_deelsrtcontrole_mi
|
||||
AS
|
||||
SELECT ins_deel_key
|
||||
deel_key,
|
||||
dg.ins_discipline_omschrijving
|
||||
discipline,
|
||||
ins_srtdeel_omschrijving
|
||||
soort,
|
||||
ins_srtgroep_omschrijving
|
||||
groep,
|
||||
ins_srtdeel_upper
|
||||
soortcode,
|
||||
ins_deel_omschrijving
|
||||
omschrijving,
|
||||
ins_deel_opmerking
|
||||
opmerking,
|
||||
l.alg_locatie_omschrijving
|
||||
locatie_omschrijving,
|
||||
alg_gebouw_omschrijving
|
||||
gebouw,
|
||||
alg_ruimte_nr
|
||||
ruimtenr,
|
||||
ins_deel_aantal
|
||||
aantal,
|
||||
ins_srtcontrole_omschrijving
|
||||
srtcontrole_omschrijving,
|
||||
d.ins_discipline_omschrijving,
|
||||
NULL
|
||||
ins_deelsrtcontrole_datum,
|
||||
NULL
|
||||
controlemode_omschrijving,
|
||||
NULL
|
||||
ins_deelsrtcontrole_opmerking,
|
||||
NULL
|
||||
perslid,
|
||||
INS.nextcyclusdate (ins_deel_key, ins_srtcontrole_key, 1)
|
||||
ins_deelsrtcontrole_datum_org,
|
||||
NULL
|
||||
ins_deelsrtcontrole_plandatum,
|
||||
'Niet gepland'
|
||||
deelsrtcontrole_status
|
||||
FROM ins_v_deel_gegevens dg,
|
||||
ins_srtcontrole sc,
|
||||
ctr_discipline d,
|
||||
alg_locatie l
|
||||
WHERE dg.alg_locatie_key = l.alg_locatie_key
|
||||
AND sc.ctr_discipline_key = d.ins_discipline_key
|
||||
AND ( ( ins_srtcontrole_niveau = 'S'
|
||||
AND ins_srtinstallatie_key = dg.ins_srtdeel_key)
|
||||
OR ( ins_srtcontrole_niveau = 'G'
|
||||
AND ins_srtinstallatie_key = dg.ins_srtgroep_key)
|
||||
OR ( ins_srtcontrole_niveau = 'D'
|
||||
AND ins_srtinstallatie_key = dg.ins_discipline_key))
|
||||
AND NOT EXISTS
|
||||
(SELECT 1
|
||||
FROM ins_v_udr_deelinspect di
|
||||
WHERE deelsrtcontrole_status = 'Gepland'
|
||||
AND di.deel_key = dg.ins_deel_key
|
||||
AND di.ins_srtcontrole_key = sc.ins_srtcontrole_key)
|
||||
UNION ALL
|
||||
SELECT deel_key,
|
||||
discipline,
|
||||
soort,
|
||||
groep,
|
||||
soortcode,
|
||||
omschrijving,
|
||||
opmerking,
|
||||
locatie_omschrijving,
|
||||
gebouw,
|
||||
ruimtenr,
|
||||
aantal,
|
||||
srtcontrole_omschrijving,
|
||||
ctr_discipline_omschrijving,
|
||||
ins_deelsrtcontrole_datum,
|
||||
controlemode_omschrijving,
|
||||
ins_deelsrtcontrole_opmerking,
|
||||
perslid,
|
||||
ins_deelsrtcontrole_datum_org,
|
||||
ins_deelsrtcontrole_plandatum,
|
||||
deelsrtcontrole_status
|
||||
FROM ins_v_udr_deelinspect;
|
||||
|
||||
|
||||
CREATE OR REPLACE VIEW yask_v_export_pro_forma (
|
||||
result,
|
||||
result_order,
|
||||
|
||||
Reference in New Issue
Block a user