SGGR#81078 Sensoren: ondersteuning triggerwaarde voor status-sensoren

svn path=/Database/trunk/; revision=70081
This commit is contained in:
Peter Feij
2025-08-22 14:21:05 +00:00
parent 184328f5e1
commit f43925431a

View File

@@ -484,8 +484,10 @@ BEGIN
BEGIN
IF lstatethreshold IS NOT NULL
AND lstdmelding_key IS NOT NULL
AND ins.state_compare (:new.ins_deel_state, lstatethreshold) > 0
AND ins.state_compare (:old.ins_deel_state, lstatethreshold) <= 0
AND ( ( BITAND (lsensortype, 2) = 2
AND ins.state_compare (:new.ins_deel_state, lstatethreshold) > 0
AND ins.state_compare (:old.ins_deel_state, lstatethreshold) <= 0)
OR (BITAND (lsensortype, 1) = 1 AND UPPER (:new.ins_deel_state) = UPPER (lstatethreshold)))
THEN
-- Eerst controleren of er niet al een "heel recente" melding bestaat
-- waarmee deze zou kunnen gaan overlappen. We hebben geen behoefte aan veel meer
@@ -529,7 +531,7 @@ BEGIN
THEN
-- track this. This seems like an appropriate place.
UPDATE ins_deel_state_history
SET ins_deel_state_history_opmerk = REPLACE (REPLACE (lcl.l ('lcl_ins_sensorstate_already_mld'), '{0}', lmelding_key), '{1}', lstatethreshold)
SET ins_deel_state_history_opmerk = REPLACE (REPLACE (lcl.l ('lcl_ins_sensorstate_already_mld'), '{0}', ldubbelcheck_key), '{1}', lstatethreshold)
WHERE ins_deel_state_history_key = lstate_history_key;
END IF;
EXCEPTION