IVET#88572 CUST09+10-notijob/RES-wijzigingen brandveiligheid (naar Disc en aanvrager)
svn path=/Customer/trunk/; revision=69017
This commit is contained in:
255
IVET/ivet.sql
255
IVET/ivet.sql
@@ -4489,36 +4489,6 @@ AS
|
||||
FROM rescatl) loc
|
||||
ON nl.mnd = loc.mnd AND nl.catalogus = loc.catalogus;
|
||||
|
||||
-- IVET#69716: CUST07-notificatie naar bezitter om PBM om te wisselen.
|
||||
CREATE OR REPLACE VIEW IVET_V_NOTI_PBM
|
||||
(
|
||||
code,
|
||||
sender,
|
||||
receiver,
|
||||
text,
|
||||
key,
|
||||
xkey,
|
||||
xemail,
|
||||
xmobile
|
||||
)
|
||||
AS
|
||||
SELECT sn.fac_srtnotificatie_code,
|
||||
NULL,
|
||||
d.ins_alg_ruimte_key,
|
||||
REPLACE (sn.fac_srtnotificatie_oms, '##OBJSRT##', sd.ins_srtdeel_omschrijving),
|
||||
d.ins_deel_key,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
FROM ins_v_aanwezigdeel d,
|
||||
ins_srtdeel sd,
|
||||
fac_srtnotificatie sn
|
||||
WHERE d.ins_srtdeel_key IN (3501, 3521, 3541, 3561, 3581) -- Beeldschermbril/Correctiebril/Oordop/Steunzool/Insert
|
||||
AND d.ins_alg_ruimte_type = 'P'
|
||||
AND d.ins_srtdeel_key = sd.ins_srtdeel_key
|
||||
AND ADD_MONTHS (TRUNC (d.ins_deel_vervaldatum), -2) = TRUNC (SYSDATE)
|
||||
AND sn.fac_srtnotificatie_code = 'CUST07';
|
||||
|
||||
-- IVET#69249: Bronview tbv. lopende meldingen per vakgroep op tijd/te laat!
|
||||
CREATE OR REPLACE VIEW IVET_V_UDR_MELDING_OPEN
|
||||
(
|
||||
@@ -4557,6 +4527,231 @@ AS
|
||||
AND m.mld_melding_status = ms.mld_statuses_key
|
||||
AND ms.mld_statuses_key IN (0, 2, 3, 4, 7, 99);
|
||||
|
||||
-- IVET#69716: CUST07-notificatie naar bezitter om PBM om te wisselen.
|
||||
CREATE OR REPLACE VIEW IVET_V_NOTI_PBM
|
||||
(
|
||||
code,
|
||||
sender,
|
||||
receiver,
|
||||
text,
|
||||
key,
|
||||
xkey,
|
||||
xemail,
|
||||
xmobile
|
||||
)
|
||||
AS
|
||||
SELECT sn.fac_srtnotificatie_code,
|
||||
NULL,
|
||||
d.ins_alg_ruimte_key,
|
||||
REPLACE (sn.fac_srtnotificatie_oms, '##OBJSRT##', sd.ins_srtdeel_omschrijving),
|
||||
d.ins_deel_key,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
FROM ins_v_aanwezigdeel d,
|
||||
ins_srtdeel sd,
|
||||
fac_srtnotificatie sn
|
||||
WHERE d.ins_srtdeel_key IN (3501, 3521, 3541, 3561, 3581) -- Beeldschermbril/Correctiebril/Oordop/Steunzool/Insert
|
||||
AND d.ins_alg_ruimte_type = 'P'
|
||||
AND d.ins_srtdeel_key = sd.ins_srtdeel_key
|
||||
AND ADD_MONTHS (TRUNC (d.ins_deel_vervaldatum), -2) = TRUNC (SYSDATE)
|
||||
AND sn.fac_srtnotificatie_code = 'CUST07';
|
||||
|
||||
-- IVET#87353: QR-codes/Terein issues (standaardmeldingen onder vakgroep met
|
||||
-- key=2821)?!
|
||||
CREATE OR REPLACE VIEW IVET_V_RAP_QRC
|
||||
AS
|
||||
SELECT b.fac_bookmark_naam || '|' || pa.alg_plaatsaanduiding hide_f_sort,
|
||||
b.fac_bookmark_naam fclt_f_bookmark,
|
||||
--'Plaats' gekoppeld_aan,
|
||||
l.alg_locatie_omschrijving fclt_f_locatie,
|
||||
--pa.alg_plaatsaanduiding || ' / ' || t.alg_terreinsector_omschrijving fclt_f_plaats,
|
||||
--pa.alg_plaatsaanduiding || ' / ' || r.alg_ruimte_omschrijving fclt_f_plaats,
|
||||
pa.alg_plaatsaanduiding || ' / ' || g.alg_gebouw_naam fclt_f_plaats,
|
||||
--NULL fclt_f_persoon,
|
||||
pa.alg_plaatsaanduiding fclt_f_identificatie,
|
||||
l.alg_locatie_key fclt_3d_locatie_key,
|
||||
--'R' alg_onroerendgoed_type,
|
||||
--t.alg_terreinsector_key alg_onroerendgoed_keys,
|
||||
--r.alg_ruimte_key alg_onroerendgoed_keys,
|
||||
g.alg_gebouw_key alg_onroerendgoed_keys,
|
||||
NULL ins_deel_key,
|
||||
NULL res_ruimte_key,
|
||||
b.fac_bookmark_id hide_f_bookmark_id
|
||||
FROM --fac_bookmark b,
|
||||
(SELECT fac_bookmark_naam, fac_bookmark_id
|
||||
FROM fac_bookmark
|
||||
WHERE (fac_bookmark_expire IS NULL OR fac_bookmark_expire > SYSDATE)
|
||||
--AND UPPER (TRIM (fac_bookmark_path)) = 'APPL/PDA/MELDING.ASP'
|
||||
--AND INSTR (UPPER (fac_bookmark_query), 'STDM_KEYS=') > 0
|
||||
AND INSTR (fac_bookmark_id, 'uL61l6zQysov0J3h') > 0) b, -- Bookmark tbv. Terrein issues
|
||||
--alg_v_aanwezigterreinsector t,
|
||||
--alg_v_aanwezigruimte r,
|
||||
--alg_verdieping v,
|
||||
alg_gebouw g,
|
||||
alg_locatie l,
|
||||
alg_v_plaatsaanduiding pa
|
||||
WHERE 1 = 1
|
||||
--AND t.alg_locatie_key = l.alg_locatie_key
|
||||
--AND r.alg_srtruimte_key = 306 -- Sanitair!
|
||||
--AND r.alg_verdieping_key = v.alg_verdieping_key
|
||||
--AND v.alg_gebouw_key = g.alg_gebouw_key
|
||||
AND g.alg_locatie_key = l.alg_locatie_key
|
||||
--AND pa.alg_onroerendgoed_type = 'T'
|
||||
--AND t.alg_terreinsector_key = pa.alg_onroerendgoed_keys
|
||||
--AND pa.alg_onroerendgoed_type = 'R'
|
||||
--AND r.alg_ruimte_key = pa.alg_onroerendgoed_keys
|
||||
AND pa.alg_onroerendgoed_type = 'G'
|
||||
AND g.alg_gebouw_key = pa.alg_onroerendgoed_keys;
|
||||
/*
|
||||
UNION ALL
|
||||
SELECT b.fac_bookmark_naam || '|' || d.ins_deel_omschrijving hide_f_sort,
|
||||
b.fac_bookmark_naam fclt_f_bookmark,
|
||||
--'Plaats' gekoppeld_aan,
|
||||
l.alg_locatie_omschrijving fclt_f_locatie,
|
||||
o.alg_plaatsaanduiding fclt_f_plaats,
|
||||
--NULL fclt_f_persoon,
|
||||
d.ins_deel_omschrijving fclt_f_identificatie,
|
||||
l.alg_locatie_key fclt_3d_locatie_key,
|
||||
--d.ins_alg_ruimte_type alg_onroerendgoed_type,
|
||||
d.ins_alg_ruimte_key alg_onroerendgoed_keys,
|
||||
d.ins_deel_key,
|
||||
NULL res_ruimte_key,
|
||||
b.fac_bookmark_id hide_f_bookmark_id
|
||||
FROM --fac_bookmark b,
|
||||
(SELECT fac_bookmark_naam, fac_bookmark_id
|
||||
FROM fac_bookmark
|
||||
WHERE (fac_bookmark_expire IS NULL OR fac_bookmark_expire > SYSDATE)
|
||||
--AND UPPER (TRIM (fac_bookmark_path)) = 'APPL/PDA/INS_DEEL.ASP'
|
||||
--AND INSTR (UPPER (fac_bookmark_query), 'STDMKINA=') > 0
|
||||
AND INSTR (fac_bookmark_id, 'KIx4a1nTxSUEMVU-') > 0) b, -- Bookmark tbv. objectmeldingen KOFFIEAUTOMAAT!
|
||||
ins_v_aanwezigdeel d,
|
||||
ins_srtdeel sd,
|
||||
ins_srtgroep sg,
|
||||
--ins_discipline dd,
|
||||
alg_locatie l,
|
||||
ins_v_alg_overzicht o
|
||||
--mld_stdmelding sm,
|
||||
--mld_stdmelding_srtinst smsd
|
||||
WHERE d.ins_srtdeel_key IN (258830) -- 454=Automaten/1232=Koffieautomaat/258830=Koffieautomaat
|
||||
AND d.ins_deel_actief = 1
|
||||
AND (d.ins_deel_vervaldatum IS NULL OR d.ins_deel_vervaldatum > SYSDATE)
|
||||
AND d.ins_srtdeel_key = sd.ins_srtdeel_key
|
||||
AND sd.ins_srtgroep_key = sg.ins_srtgroep_key
|
||||
--AND sg.ins_discipline_key = dd.ins_discipline_key
|
||||
AND d.ins_deel_parent_key IS NULL
|
||||
AND d.ins_alg_ruimte_type IN ('R') --TODO:IN ('T', 'R', 'W')
|
||||
AND d.ins_alg_locatie_key = l.alg_locatie_key
|
||||
AND d.ins_alg_ruimte_type = o.alg_onroerendgoed_type
|
||||
AND d.ins_alg_ruimte_key = o.alg_onroerendgoed_keys
|
||||
--AND sm.mld_stdmelding_key = smsd.mld_stdmelding_key
|
||||
--AND smsd.ins_srtinstallatie_key = DECODE (smsd.ins_srtinstallatie_niveau, 'S', sd.ins_srtdeel_key, 'G', sg.ins_srtgroep_key, 'D', dd.ins_discipline_key)
|
||||
UNION ALL
|
||||
SELECT b.fac_bookmark_naam || '|' || l.alg_locatie_code || rr.res_ruimte_nr hide_f_sort,
|
||||
b.fac_bookmark_naam fclt_f_bookmark,
|
||||
--NULL gekoppeld_aan,
|
||||
l.alg_locatie_omschrijving fclt_f_locatie,
|
||||
l.alg_locatie_code || ' / ' || rr.res_ruimte_nr fclt_f_plaats,
|
||||
--NULL fclt_f_persoon,
|
||||
rr.res_ruimte_nr fclt_f_identificatie,
|
||||
l.alg_locatie_key fclt_3d_locatie_key,
|
||||
--NULL alg_onroerendgoed_type,
|
||||
NULL alg_onroerendgoed_keys,
|
||||
NULL ins_deel_key,
|
||||
rr.res_ruimte_key,
|
||||
b.fac_bookmark_id
|
||||
FROM --fac_bookmark b,
|
||||
(SELECT fac_bookmark_naam, fac_bookmark_id
|
||||
FROM fac_bookmark
|
||||
WHERE (fac_bookmark_expire IS NULL OR fac_bookmark_expire > SYSDATE)
|
||||
--AND UPPER (TRIM (fac_bookmark_path)) = 'APPL/PDA/RESERVERINGEN.ASP'
|
||||
AND INSTR (fac_bookmark_id, '3XaYsCdQbN36seGf') > 0) b, -- Bookmark tbv. ruimtereserveringen VERGADERING!
|
||||
res_ruimte rr,
|
||||
( SELECT res_ruimte_key, MAX (alg_ruimte_key) alg_ruimte_key
|
||||
FROM res_alg_ruimte
|
||||
WHERE res_alg_ruimte_verwijder IS NULL
|
||||
GROUP BY res_ruimte_key) rar,
|
||||
alg_ruimte r,
|
||||
ins_v_alg_overzicht o,
|
||||
alg_locatie l
|
||||
WHERE rr.res_ruimte_verwijder IS NULL
|
||||
AND (rr.res_ruimte_vervaldatum IS NULL OR rr.res_ruimte_vervaldatum > SYSDATE)
|
||||
AND rr.res_discipline_key IN (89, 276, 492, 500) -- Vergaderruimte/Video-overleg/Vergaderruimte Hybride/Kolf- en gebedsruimte
|
||||
AND rr.res_ruimte_key = rar.res_ruimte_key
|
||||
AND rar.alg_ruimte_key = r.alg_ruimte_key
|
||||
AND o.alg_onroerendgoed_type = 'R'
|
||||
AND r.alg_ruimte_key = o.alg_onroerendgoed_keys
|
||||
AND o.alg_locatie_key = l.alg_locatie_key;
|
||||
*/
|
||||
-- IVET#88572: Controleert uurlijks of een Veiligheidsinzet-reservering is
|
||||
-- gemaakt (key=34), gewijzigd (key=35) of verwijderd (key=38)
|
||||
-- op de activiteit Veiligheidsinzet (key=1021) en stuurt deze
|
||||
-- naar Disc (CUST09) of aanvrager (CUST10).
|
||||
CREATE OR REPLACE VIEW IVET_V_NOTI_RES_VEILIGHINZ
|
||||
(
|
||||
code,
|
||||
sender,
|
||||
receiver,
|
||||
text,
|
||||
key,
|
||||
xkey,
|
||||
xemail,
|
||||
xmobile
|
||||
)
|
||||
AS
|
||||
SELECT DISTINCT
|
||||
'CUST09',
|
||||
NULL,
|
||||
NULL,
|
||||
REPLACE (
|
||||
REPLACE (
|
||||
sn.fac_srtnotificatie_oms,
|
||||
'##KEY##',
|
||||
TO_CHAR (rrr.res_reservering_key) || '/' || TO_CHAR (rrr.res_rsv_ruimte_volgnr)),
|
||||
'##DESC##',
|
||||
rrr.res_rsv_ruimte_omschrijving) text,
|
||||
rrr.res_reservering_key,
|
||||
rrr.res_rsv_ruimte_key,
|
||||
'mail@disc.eu' xemail,
|
||||
NULL xmobile
|
||||
FROM res_rsv_ruimte rrr, fac_tracking t, fac_srtnotificatie sn, fac_notificatie_job nj
|
||||
WHERE 1 = 1
|
||||
--AND rrr.res_discipline_key IN (5701) -- Veiligheidsinzet
|
||||
AND rrr.res_activiteit_key IN (1021) -- Veiligheidsinzet
|
||||
AND rrr.res_rsv_ruimte_key = t.fac_tracking_refkey
|
||||
AND t.fac_srtnotificatie_key IN (34, 35, 38) -- RESNEW/RESUPD/RESDEL
|
||||
AND t.prs_perslid_key IN (rrr.res_rsv_ruimte_contact_key, rrr.res_rsv_ruimte_host_key) -- Door aanvrager of gastheer/vrouw
|
||||
AND sn.fac_srtnotificatie_code = 'CUST09'
|
||||
AND nj.fac_notificatie_job_view = 'IVET_V_NOTI_RES_VEILIGHINZ'
|
||||
AND t.fac_tracking_datum > COALESCE (nj.fac_notificatie_job_lastrun, TRUNC (SYSDATE))
|
||||
UNION ALL
|
||||
SELECT DISTINCT
|
||||
'CUST10',
|
||||
NULL,
|
||||
NULL,
|
||||
REPLACE (
|
||||
REPLACE (
|
||||
sn.fac_srtnotificatie_oms,
|
||||
'##KEY##',
|
||||
TO_CHAR (rrr.res_reservering_key) || '/' || TO_CHAR (rrr.res_rsv_ruimte_volgnr)),
|
||||
'##DESC##',
|
||||
rrr.res_rsv_ruimte_omschrijving) text,
|
||||
rrr.res_reservering_key,
|
||||
rrr.res_rsv_ruimte_key,
|
||||
p.prs_perslid_email xemail,
|
||||
NULL xmobile
|
||||
FROM res_rsv_ruimte rrr, prs_perslid p, fac_tracking t, fac_srtnotificatie sn, fac_notificatie_job nj
|
||||
WHERE 1 = 1
|
||||
--AND rrr.res_discipline_key IN (5701) -- Veiligheidsinzet
|
||||
AND rrr.res_activiteit_key IN (1021) -- Veiligheidsinzet
|
||||
AND rrr.res_rsv_ruimte_contact_key = p.prs_perslid_key
|
||||
AND rrr.res_rsv_ruimte_key = t.fac_tracking_refkey
|
||||
AND t.fac_srtnotificatie_key IN (34, 35, 38) -- RESNEW/RESUPD/RESDEL
|
||||
AND t.prs_perslid_key NOT IN (rrr.res_rsv_ruimte_contact_key, rrr.res_rsv_ruimte_host_key) -- Niet door aanvrager of gastheer/vrouw
|
||||
AND sn.fac_srtnotificatie_code = 'CUST10'
|
||||
AND nj.fac_notificatie_job_view = 'IVET_V_NOTI_RES_VEILIGHINZ'
|
||||
AND t.fac_tracking_datum > COALESCE (nj.fac_notificatie_job_lastrun, TRUNC (SYSDATE))
|
||||
|
||||
------ payload end ------
|
||||
|
||||
SET DEFINE OFF
|
||||
|
||||
Reference in New Issue
Block a user