IVET#45368: Containers rapportage overzicht.
svn path=/Website/branches/v2017.2/; revision=35749
This commit is contained in:
@@ -1151,12 +1151,7 @@ ins = {checkAutLevel:
|
|||||||
+ (inspDone
|
+ (inspDone
|
||||||
? " SELECT 1 rn" // Afgehandelde inspecties.
|
? " SELECT 1 rn" // Afgehandelde inspecties.
|
||||||
+ " , di.ins_deel_key"
|
+ " , di.ins_deel_key"
|
||||||
+ " , (SELECT MAX(idsc.ins_deelsrtcontrole_datum)"
|
+ " , dsc.ins_deelsrtcontrole_datum inspectie_date"
|
||||||
+ " FROM ins_deelsrtcontrole idsc"
|
|
||||||
+ " WHERE idsc.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
|
||||||
+ " AND idsc.ins_deelsrtcontrole_status IN (5, 6)"
|
|
||||||
+ " AND idsc.ins_deel_key = di.ins_deel_key"
|
|
||||||
+ " AND idsc.ins_scenario_key = 1) inspectie_date"
|
|
||||||
+ " , di.ins_srtcontroledl_xcp_startdat"
|
+ " , di.ins_srtcontroledl_xcp_startdat"
|
||||||
+ " , NULL nonext"
|
+ " , NULL nonext"
|
||||||
+ " , di.ins_srtcontrole_eenheid inspectie_eenheid"
|
+ " , di.ins_srtcontrole_eenheid inspectie_eenheid"
|
||||||
@@ -1168,11 +1163,7 @@ ins = {checkAutLevel:
|
|||||||
+ " , NULL ins_deelsrtcontrole_key"
|
+ " , NULL ins_deelsrtcontrole_key"
|
||||||
+ " , (SELECT idsc.ins_deelsrtcontrole_plandatum"
|
+ " , (SELECT idsc.ins_deelsrtcontrole_plandatum"
|
||||||
+ " FROM ins_deelsrtcontrole idsc"
|
+ " FROM ins_deelsrtcontrole idsc"
|
||||||
+ " WHERE idsc.ins_deelsrtcontrole_key = (SELECT MAX(idsc2.ins_deelsrtcontrole_key)"
|
+ " WHERE idsc.ins_deelsrtcontrole_key = dsc.ins_deelsrtcontrole_key)" // Afgehandelde inspecties.
|
||||||
+ " FROM ins_deelsrtcontrole idsc2"
|
|
||||||
+ " WHERE idsc2.ins_deel_key = di.ins_deel_key"
|
|
||||||
+ " AND idsc2.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
|
||||||
+ " AND idsc2.ins_scenario_key = 1))" // Afgehandelde inspecties.
|
|
||||||
+ " ins_deelsrtcontrole_plandatum"
|
+ " ins_deelsrtcontrole_plandatum"
|
||||||
// Er moet naar de laatste UITGEVOERDE (afgeronde(6)) inspectie gekeken worden om te bepalen of de laatste inspectie een SUCCESS was.
|
// Er moet naar de laatste UITGEVOERDE (afgeronde(6)) inspectie gekeken worden om te bepalen of de laatste inspectie een SUCCESS was.
|
||||||
+ " , di.ctr_controle_type"
|
+ " , di.ctr_controle_type"
|
||||||
@@ -1183,12 +1174,7 @@ ins = {checkAutLevel:
|
|||||||
+ " FROM ins_deelsrtcontrole idsc"
|
+ " FROM ins_deelsrtcontrole idsc"
|
||||||
+ " , ins_controlemode cm"
|
+ " , ins_controlemode cm"
|
||||||
+ " WHERE idsc.ins_controlemode_key = cm.ins_controlemode_key"
|
+ " WHERE idsc.ins_controlemode_key = cm.ins_controlemode_key"
|
||||||
+ " AND idsc.ins_deelsrtcontrole_key = (SELECT MAX(idsc2.ins_deelsrtcontrole_key)"
|
+ " AND idsc.ins_deelsrtcontrole_key = dsc.ins_deelsrtcontrole_key)"
|
||||||
+ " FROM ins_deelsrtcontrole idsc2"
|
|
||||||
+ " WHERE idsc2.ins_deel_key = di.ins_deel_key"
|
|
||||||
+ " AND idsc2.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
|
||||||
+ " AND idsc2.ins_deelsrtcontrole_status IN (5, 6)"
|
|
||||||
+ " AND idsc2.ins_scenario_key = 1))"
|
|
||||||
+ " ins_controlemode_success"
|
+ " ins_controlemode_success"
|
||||||
+ " , di.ctr_discipline_key ctr_disc_key"
|
+ " , di.ctr_discipline_key ctr_disc_key"
|
||||||
+ " , (SELECT ins_discipline_omschrijving"
|
+ " , (SELECT ins_discipline_omschrijving"
|
||||||
@@ -1196,7 +1182,10 @@ ins = {checkAutLevel:
|
|||||||
+ " WHERE ins_discipline_key = di.ctr_discipline_key) ctr_disc_oms"
|
+ " WHERE ins_discipline_key = di.ctr_discipline_key) ctr_disc_oms"
|
||||||
: "")
|
: "")
|
||||||
+ " FROM ins_v_defined_inspect_xcp di"
|
+ " FROM ins_v_defined_inspect_xcp di"
|
||||||
+ " WHERE EXISTS (" + lastinspect + ")"
|
+ " , ins_deelsrtcontrole dsc" // Alle inspecties meenemen als het vinkbokje "Afgehandeld" (inspDone) is aangevinkt.
|
||||||
|
+ " WHERE di.ins_deel_key = dsc.ins_deel_key"
|
||||||
|
+ " AND di.ins_srtcontrole_key = dsc.ins_srtcontrole_key"
|
||||||
|
+ " AND di.ins_scenario_key = dsc.ins_scenario_key"
|
||||||
+ " AND di.ins_scenario_key = 1"
|
+ " AND di.ins_scenario_key = 1"
|
||||||
+ (srtcontrole > -1
|
+ (srtcontrole > -1
|
||||||
? " AND di.ins_srtcontrole_key = " + srtcontrole
|
? " AND di.ins_srtcontrole_key = " + srtcontrole
|
||||||
@@ -2240,7 +2229,7 @@ ins = {checkAutLevel:
|
|||||||
+ (koppel_key?" case when xx.ins_deel_key = ins_deelkoppeling_van_key THEN 1 ELSE 0 END,":"")
|
+ (koppel_key?" case when xx.ins_deel_key = ins_deelkoppeling_van_key THEN 1 ELSE 0 END,":"")
|
||||||
+ (outputmode == 2 // excel moet objecten met gelijke kenmerken bij elkaar hebben
|
+ (outputmode == 2 // excel moet objecten met gelijke kenmerken bij elkaar hebben
|
||||||
? " ins_srtdeel_upper, plaats, soort, ins_deel_omschrijving"
|
? " ins_srtdeel_upper, plaats, soort, ins_deel_omschrijving"
|
||||||
: (mobile? " plaats, ins_deel_omschrijving, soort" : " ins_deel_omschrijving, plaats, ins_disc_oms, ins_groep_oms, soort"));
|
: (mobile? " plaats, ins_deel_omschrijving, soort" : " ins_deel_omschrijving, inspectie_date, plaats, ins_disc_oms, ins_groep_oms, soort"));
|
||||||
|
|
||||||
return sql;
|
return sql;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user