From d96cbd5e1922ff9237d98d1266db783cf509d080 Mon Sep 17 00:00:00 2001 From: Fachba Date: Tue, 28 Oct 2025 12:24:52 +0700 Subject: [PATCH] fixing api history event alarm --- db/history_value.db.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/db/history_value.db.js b/db/history_value.db.js index 72710cd..41032b5 100644 --- a/db/history_value.db.js +++ b/db/history_value.db.js @@ -93,16 +93,9 @@ const getHistoryEventDb = async (searchParams = {}) => { const queryText = ` SELECT COUNT(*) OVER() AS total_data, - a.*, - b.tag_name, - b.tag_number, - b.lim_low_crash, - b.lim_low, - b.lim_high, - b.lim_high_crash, + a.*, c.status_color - FROM alarm_history a - LEFT JOIN m_tags b ON a.tagnum = b.tag_number AND b.deleted_at IS NULL + FROM event_alarm a LEFT JOIN m_status c ON a.status = c.status_number AND c.deleted_at IS NULL WHERE a.datetime IS NOT NULL ${whereConditions.length > 0 ? ` AND ${whereConditions.join(" AND ")}` : ""}