-- Customer specific once-script ARAI.
--
-- (c) 2015 Facilitor bv 
-- $Revision$ 
-- $Id$
--
-- Support: +31 53 4800700


SET ECHO ON
SPOOL arai22.lst
SET DEFINE OFF
------------------------------------------------------------------------------------------------------------------------------------------
--  ARAI#37911: Schoonmaak KPI herdefinitie

--                         kavel   1     2     3     4
-- mld_stdmelding_key  CSU      2944  2946  2948  2942
-- mld_stdmelding_key  RAI      2943  2945  2947  2941

-- 1. Opdrachtnemer is 24/7 bereikbaar &#61664; RAI ipv CSU
--> mld_srtkenmerk = 764, mld_kenmerk = 1531, 1563, 1590 (kavel 1, 2, 3)
update mld_kenmerk set mld_stdmelding_key = 2943 where mld_kenmerk_key = 1531;
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1563;
update mld_kenmerk set mld_stdmelding_key = 2947 where mld_kenmerk_key = 1590;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1531;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1563;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1590;


--2. Aantal incidenten badge &#61664; Rai ipv csu
--> mld_srtkenmerk = 741, mld_kenmerk = 1505, 1538, 1572, 1481 (kavel 1,2,3,4)
update mld_kenmerk set mld_stdmelding_key = 2943 where mld_kenmerk_key = 1505;
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1538;
update mld_kenmerk set mld_stdmelding_key = 2947 where mld_kenmerk_key = 1572;
update mld_kenmerk set mld_stdmelding_key = 2941 where mld_kenmerk_key = 1481;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1505;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1538;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1572;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1481;

--3. PBM en werkkleding &#61664; rai ipv csu
--> mld_srtkenmerk = 757, mld_kenmerk = 1532,1564,1591,1500 (kavel 1,2,3,4)
update mld_kenmerk set mld_stdmelding_key = 2943 where mld_kenmerk_key = 1532;
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1564;
update mld_kenmerk set mld_stdmelding_key = 2947 where mld_kenmerk_key = 1591;
update mld_kenmerk set mld_stdmelding_key = 2941 where mld_kenmerk_key = 1500;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1532;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1564;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1591;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1500;


--4. machines en materialen&#61664; rai ipv csu
--> mld_srtkenmerk = 763, mld_kenmerk = 1523, 1555 (kavel 1,2)
update mld_kenmerk set mld_stdmelding_key = 2943 where mld_kenmerk_key = 1523;
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1555;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1523;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1555;


--5. Gebruikte apparatuur voldoet aan de eisen&#61664; rai ipv csu 
--> mld_srtkenmerk = 762, mld_kenmerk = 1516, 1550 (kavel 1,2)
update mld_kenmerk set mld_stdmelding_key = 2943 where mld_kenmerk_key = 1516;
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1550;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1516;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1550;


--6. Facturatie vindt tijdig en correct plaats
--> mld_srtkenmerk = 744, mld_kenmerk = 1512, 1544, 1575, 1484 (kavel 1,2,3,4)
update mld_kenmerk set mld_stdmelding_key = 2943 where mld_kenmerk_key = 1512;
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1544;
update mld_kenmerk set mld_stdmelding_key = 2947 where mld_kenmerk_key = 1575;
update mld_kenmerk set mld_stdmelding_key = 2941 where mld_kenmerk_key = 1484;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1512;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1544;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1575;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1484;


--7. Managementrapportage,
--> mld_srtkenmerk = 750, mld_kenmerk = 1524,1556,1583,1492 (kavel 1,2,3,4)
update mld_kenmerk set mld_stdmelding_key = 2943 where mld_kenmerk_key = 1524;
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1556;
update mld_kenmerk set mld_stdmelding_key = 2947 where mld_kenmerk_key = 1583;
update mld_kenmerk set mld_stdmelding_key = 2941 where mld_kenmerk_key = 1492;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1524;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1556;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1583;
delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1492;


--8. Rapportage over afval is real time beschikbaar.
--> mld_srtkenmerk = 1537, mld_kenmerk = 1537 (kavel 2)
update mld_kenmerk set mld_stdmelding_key = 2945 where mld_kenmerk_key = 1537;

delete FROM mld_kenmerkmelding WHERE mld_kenmerkmelding_verwijder IS NULL AND mld_kenmerk_key = 1537;

------------------------------------------------------------------------------------------------------------------------------------------
BEGIN adm.systrackscriptId('$Id$'); END;
/

commit;

SPOOL OFF

@arai.sql
