fixed the jam area view and and modified query for the graphs

This commit is contained in:
Salijoghli 2025-10-06 13:41:17 +04:00
parent 448921a12e
commit 746c8ce7da
7 changed files with 232 additions and 137 deletions

View File

@ -221,7 +221,7 @@
}
},
"props": {
"address": "[0:0:0:0:0:0:0:1]",
"address": "127.0.0.1",
"device": {},
"geolocation": {},
"locale": "en-US",

View File

@ -9,8 +9,8 @@
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-10-03T13:26:19Z"
"timestamp": "2025-10-06T07:49:48Z"
},
"lastModificationSignature": "f7f5f0957929bbf813a4f991606e1608c9d30e44f0311affab94766c501b6e89"
"lastModificationSignature": "2f38ce959813b723f441c14a085aff2ba988c9ee238b898eb987106b615665e7"
}
}

View File

@ -10,8 +10,8 @@
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-10-01T15:01:58Z"
"timestamp": "2025-10-06T09:38:20Z"
},
"lastModificationSignature": "2e51da4ef82347f9f7ec9068ca6b4454941d0f31e40e06a1bcf5660536e3b617"
"lastModificationSignature": "18a0961b26efb0a4cf42b0266dd4ce6bc973b7c63f89d311b637c70e76e657ad"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -1,7 +1,7 @@
{
"custom": {},
"params": {
"Tab_ID": 10,
"Tab_ID": 11,
"Table": "Statistics"
},
"propConfig": {
@ -618,7 +618,7 @@
"$": [
"ds",
192,
1759330916954
1759743499239
],
"$columns": [
{
@ -633,27 +633,27 @@
},
{
"data": [],
"name": "Total (#)",
"name": "Total (pph)",
"type": "String"
},
{
"data": [],
"name": "Good Read (#)",
"name": "Good Read (pph)",
"type": "String"
},
{
"data": [],
"name": "No Read (#)",
"name": "No Read (pph)",
"type": "String"
},
{
"data": [],
"name": "Multi Read (#)",
"name": "Multi Read (pph)",
"type": "String"
},
{
"data": [],
"name": "No Code (#)",
"name": "No Code (pph)",
"type": "String"
}
]
@ -939,7 +939,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Good Read (#): [bold]{valueY}[/]"
"text": "Good Read (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -1199,7 +1199,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "No Read (#): [bold]{valueY}[/]"
"text": "No Read (pph): [bold]{valueY}[/]"
},
"visible": true,
"xAxis": "Hour",
@ -1459,7 +1459,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Multi Read (#): [bold]{valueY}[/]"
"text": "Multi Read (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -1719,7 +1719,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "No Code (#): [bold]{valueY}[/]"
"text": "No Code (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -2165,7 +2165,7 @@
"$": [
"ds",
192,
1759330916926
1759743499236
],
"$columns": [
{
@ -2180,7 +2180,7 @@
},
{
"data": [],
"name": "Total (#)",
"name": "Total (pph)",
"type": "String"
}
]
@ -2217,7 +2217,7 @@
"$": [
"ds",
192,
1759330916926
1759743499237
],
"$columns": [
{
@ -2232,7 +2232,7 @@
},
{
"data": [],
"name": "Total (#)",
"name": "Total (pph)",
"type": "String"
}
]
@ -2495,7 +2495,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Total (#): [bold]{valueY}[/]"
"text": "Total (pph): [bold]{valueY}[/] pph"
},
"visible": false,
"xAxis": "Hour",
@ -3538,7 +3538,7 @@
"$": [
"ds",
192,
1759330916954
1759743499240
],
"$columns": [
{
@ -3553,27 +3553,27 @@
},
{
"data": [],
"name": "Inducted (#)",
"name": "Inducted (pph)",
"type": "String"
},
{
"data": [],
"name": "Sorted (#)",
"name": "Sorted (pph)",
"type": "String"
},
{
"data": [],
"name": "Awcs Recirc (#)",
"name": "Awcs Recirc (pph)",
"type": "String"
},
{
"data": [],
"name": "Operational Recirc (#)",
"name": "Operational Recirc (pph)",
"type": "String"
},
{
"data": [],
"name": "Machine Recirc (#)",
"name": "Machine Recirc (pph)",
"type": "String"
}
]
@ -3858,7 +3858,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Sorted (#): [bold]{valueY}[/]"
"text": "Sorted (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -4118,7 +4118,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Awcs Recirc (#): [bold]{valueY}[/]"
"text": "Awcs Recirc (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -4378,7 +4378,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Operational Recirc (#): [bold]{valueY}[/]"
"text": "Operational Recirc (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -4638,7 +4638,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Machine Recirc (#): [bold]{valueY}[/]"
"text": "Machine Recirc (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -4880,7 +4880,7 @@
"$": [
"ds",
192,
1759330916920
1759743499242
],
"$columns": [
{
@ -4895,72 +4895,72 @@
},
{
"data": [],
"name": "Inducted (#)",
"name": "Inducted (pph)",
"type": "String"
},
{
"data": [],
"name": "Sorted (#)",
"name": "Sorted (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Inv (#)",
"name": "Dest Inv (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest None (#)",
"name": "Dest None (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Dis (#)",
"name": "Dest Dis (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Full (#)",
"name": "Dest Full (pph)",
"type": "String"
},
{
"data": [],
"name": "Unexpected (#)",
"name": "Unexpected (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Fault (#)",
"name": "Dest Fault (pph)",
"type": "String"
},
{
"data": [],
"name": "Div Fail (#)",
"name": "Div Fail (pph)",
"type": "String"
},
{
"data": [],
"name": "Gap Err (#)",
"name": "Gap Err (pph)",
"type": "String"
},
{
"data": [],
"name": "Lost (#)",
"name": "Lost (pph)",
"type": "String"
},
{
"data": [],
"name": "Track Err (#)",
"name": "Track Err (pph)",
"type": "String"
},
{
"data": [],
"name": "Unknown (#)",
"name": "Unknown (pph)",
"type": "String"
},
{
"data": [],
"name": "Unsafe (#)",
"name": "Unsafe (pph)",
"type": "String"
}
]
@ -5250,7 +5250,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Sorted (#): [bold]{valueY}[/]"
"text": "Sorted (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -5510,7 +5510,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Invalid (#): [bold]{valueY}[/]"
"text": "Dest Invalid (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -5770,7 +5770,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest None (#): [bold]{valueY}[/]"
"text": "Dest None (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -6030,7 +6030,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Disabled (#): [bold]{valueY}[/]"
"text": "Dest Disabled (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -6290,7 +6290,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Full (#): [bold]{valueY}[/]"
"text": "Dest Full (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -6550,7 +6550,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Unexpected (#): [bold]{valueY}[/]"
"text": "Unexpected (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -6810,7 +6810,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Fault (#): [bold]{valueY}[/]"
"text": "Dest Fault (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -7070,7 +7070,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Div Fail (#): [bold]{valueY}[/]"
"text": "Div Fail (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -7330,7 +7330,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Gap Error (#): [bold]{valueY}[/]"
"text": "Gap Error (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -7590,7 +7590,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Lost (#): [bold]{valueY}[/]"
"text": "Lost (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -7850,7 +7850,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Tracking Err (#): [bold]{valueY}[/]"
"text": "Tracking Err (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -8110,7 +8110,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Unknown (#): [bold]{valueY}[/]"
"text": "Unknown (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -8370,7 +8370,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Unsafe (#): [bold]{valueY}[/]"
"text": "Unsafe (pph): [bold]{valueY}[/]pph"
},
"visible": true,
"xAxis": "Hour",
@ -9629,7 +9629,7 @@
"$": [
"ds",
192,
1759330916920
1759743499241
],
"$columns": [
{
@ -9644,62 +9644,62 @@
},
{
"data": [],
"name": "Total (#)",
"name": "Total (pph)",
"type": "String"
},
{
"data": [],
"name": "Diverted (#)",
"name": "Diverted (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Full (#)",
"name": "Dest Full (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Jam (#)",
"name": "Dest Jam (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Disabled (#)",
"name": "Dest Disabled (pph)",
"type": "String"
},
{
"data": [],
"name": "Dest Fault (#)",
"name": "Dest Fault (pph)",
"type": "String"
},
{
"data": [],
"name": "Divert Fail (#)",
"name": "Divert Fail (pph)",
"type": "String"
},
{
"data": [],
"name": "Lost (#)",
"name": "Lost (pph)",
"type": "String"
},
{
"data": [],
"name": "Unsafe (#)",
"name": "Unsafe (pph)",
"type": "String"
},
{
"data": [],
"name": "Dim Err (#)",
"name": "Dim Err (pph)",
"type": "String"
},
{
"data": [],
"name": "Gap Err (#)",
"name": "Gap Err (pph)",
"type": "String"
},
{
"data": [],
"name": "Unknown (#)",
"name": "Unknown (pph)",
"type": "String"
}
]
@ -9987,7 +9987,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Diverted (#): [bold]{valueY}[/]"
"text": "Diverted (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -10247,7 +10247,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Full (#): [bold]{valueY}[/]"
"text": "Dest Full (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -10507,7 +10507,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Jam (#): [bold]{valueY}[/]"
"text": "Dest Jam (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -10767,7 +10767,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Disabled (#): [bold]{valueY}[/]"
"text": "Dest Disabled (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -11027,7 +11027,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dest Fault (#): [bold]{valueY}[/]"
"text": "Dest Fault (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -11287,7 +11287,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Divert Fail (#): [bold]{valueY}[/]"
"text": "Divert Fail (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -11547,7 +11547,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Lost (#): [bold]{valueY}[/]"
"text": "Lost (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -11807,7 +11807,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Unsafe (#): [bold]{valueY}[/]"
"text": "Unsafe (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -12067,7 +12067,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Dim Err (#): [bold]{valueY}[/]"
"text": "Dim Err (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -12327,7 +12327,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Gap Err (#): [bold]{valueY}[/]"
"text": "Gap Err (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -12587,7 +12587,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Unknown (#): [bold]{valueY}[/]"
"text": "Unknown (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Hour",
@ -24962,7 +24962,7 @@
"$": [
"ds",
192,
1759330917924
1759743499239
],
"$columns": [
{
@ -24972,12 +24972,12 @@
},
{
"data": [],
"name": "Total (#)",
"name": "Total (pph)",
"type": "String"
},
{
"data": [],
"name": "DestFull (#)",
"name": "DestFull (pph)",
"type": "String"
}
]
@ -25266,7 +25266,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "Total count (#): [bold]{valueY}[/]"
"text": "Total (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Lane",
@ -25526,7 +25526,7 @@
"cornerRadius": 3,
"enabled": true,
"pointerLength": 4,
"text": "DestFull count (#): [bold]{valueY}[/]"
"text": "DestFull Carrier (pph): [bold]{valueY}[/] pph"
},
"visible": true,
"xAxis": "Lane",
@ -25778,6 +25778,7 @@
"config": {
"expression": "{..../Aggregation_Mode/Dropdown_Aggregation_mode.props.value} \u003d \"Percentage\""
},
"enabled": false,
"type": "expr"
}
},
@ -25801,7 +25802,7 @@
"binding": {
"config": {
"parameters": {
"endtime": "{..../Period_not_Global_0/EndTime.props.endDate}",
"endtime": "{..../Period_not_Global_0.custom.EndDate}",
"starttime": "{..../Period_not_Global_0.custom.StartDate}"
},
"polling": {
@ -26219,6 +26220,7 @@
},
"viewParams": {},
"viewPath": "",
"visible": false,
"width": ""
},
{
@ -26402,6 +26404,98 @@
"viewParams": {},
"viewPath": "",
"width": ""
},
{
"align": "center",
"boolean": "checkbox",
"dateFormat": "MM/DD/YYYY",
"editable": false,
"field": "Total_perc",
"filter": {
"boolean": {
"condition": ""
},
"date": {
"condition": "",
"value": ""
},
"enabled": false,
"number": {
"condition": "",
"value": ""
},
"string": {
"condition": "",
"value": ""
},
"visible": "on-hover"
},
"footer": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"header": {
"align": "center",
"justify": "left",
"style": {
"classes": ""
},
"title": ""
},
"justify": "auto",
"nullFormat": {
"includeNullStrings": false,
"nullFormatValue": "",
"strict": false
},
"number": "value",
"numberFormat": "0,0.##",
"progressBar": {
"bar": {
"color": "",
"style": {
"classes": ""
}
},
"max": 100,
"min": 0,
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": true,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"render": "auto",
"resizable": true,
"sort": "none",
"sortable": true,
"strictWidth": false,
"style": {
"classes": ""
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"viewParams": {},
"viewPath": "",
"visible": false,
"width": ""
}
],
"filter": {
@ -26477,15 +26571,14 @@
"binding": {
"config": {
"parameters": {
"endtime": "{..../Period_not_Global_0/EndTime.props.endDate}",
"endtime": "{..../Period_not_Global_0.custom.EndDate}",
"starttime": "{..../Period_not_Global_0.custom.StartDate}"
},
"polling": {
"enabled": true,
"rate": "1"
},
"queryPath": "autStand/Jam_Area/Jam_graph",
"returnFormat": "dataset"
"queryPath": "autStand/Jam_Area/Jam_graph"
},
"type": "query"
}
@ -26929,7 +27022,7 @@
}
},
"props": {
"currentTabIndex": 10,
"currentTabIndex": 11,
"menuStyle": {
"backgroundColor": "#FFFFFFBD",
"fontSize": "1.0vmin",
@ -27024,7 +27117,7 @@
"style": {
"fontSize": "1.5vmin"
},
"value": "Count"
"value": "Rate"
},
"type": "ia.input.dropdown"
}
@ -29485,7 +29578,7 @@
},
"props": {
"dismissOnSelect": false,
"formattedValue": "Oct 1, 2025 6:01 PM",
"formattedValue": "Oct 6, 2025 12:38 PM",
"formattedValues": {
"date": "Mar 26, 2021",
"datetime": "Mar 26, 2021 12:00 AM",
@ -29503,9 +29596,9 @@
"$": [
"ts",
192,
1759330916952
1759743499233
],
"$ts": 1759327316000
"$ts": 1759739899000
}
},
"type": "ia.input.date-time-input"
@ -29656,7 +29749,7 @@
},
"props": {
"dismissOnSelect": false,
"formattedValue": "Oct 1, 2025 7:01 PM",
"formattedValue": "Oct 6, 2025 1:38 PM",
"formattedValues": {
"date": "Mar 29, 2021",
"datetime": "Mar 29, 2021 1:37 PM",
@ -29674,9 +29767,9 @@
"$": [
"ts",
192,
1759330916937
1759743499233
],
"$ts": 1759330916000
"$ts": 1759743499000
}
},
"type": "ia.input.date-time-input"

View File

@ -1,38 +1,40 @@
-- Step 1: generate dates using a numbers table (0 to 17 for 15 past + today + 2 future)
SELECT
roundtime,
Inbound_jam,
Sorter_jam
DATE(DATE_ADD(CURDATE(), INTERVAL n.n - 15 DAY)) AS jam_day,
COALESCE(SUM(CASE WHEN a.category = 'Inbound_jam' THEN 1 ELSE 0 END), 0) AS Inbound_jam,
COALESCE(SUM(CASE WHEN a.category = 'Sorter_jam' THEN 1 ELSE 0 END), 0) AS Sorter_jam
FROM (
SELECT 0 AS n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3
UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7
UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11
UNION ALL SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15
UNION ALL SELECT 16 UNION ALL SELECT 17
) AS n
LEFT JOIN (
SELECT
FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(a.eventtime) / 600) * 600) AS roundtime,
SUM(a.category = 'Inbound_jam') AS Inbound_jam,
SUM(a.category = 'Sorter_jam') AS Sorter_jam
FROM (
SELECT
ae.eventtime,
m.category
FROM alarm_events ae
JOIN (
-- Inbound devices
SELECT 'UL15_1_TPE1' AS device, 'Inbound_jam' AS category UNION ALL
SELECT 'UL14_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE3', 'Inbound_jam' UNION ALL
SELECT 'PS3_2_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_4_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_10_TPE1', 'Inbound_jam' UNION ALL
-- Sorter devices
SELECT 'PS3_12_TPE1', 'Sorter_jam'
) AS m
ON ae.displaypath = m.device
WHERE ae.eventtype = 0
AND ae.eventtime BETWEEN :starttime AND :endtime
AND ae.displaypath NOT LIKE '%System Startup%'
AND ae.source NOT LIKE '%System Startup%'
) AS a
GROUP BY FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(a.eventtime) / 600) * 600)
ORDER BY roundtime ASC
) AS okeyjam;
DATE(ae.eventtime) AS event_day,
CASE
WHEN m.category IS NOT NULL THEN m.category
ELSE 'Unknown'
END AS category
FROM alarm_events ae
JOIN (
SELECT 'UL15_1_TPE1' AS device, 'Inbound_jam' AS category UNION ALL
SELECT 'UL14_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE3', 'Inbound_jam' UNION ALL
SELECT 'PS3_2_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_4_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_10_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_12_TPE1', 'Sorter_jam'
) AS m ON ae.displaypath = m.device
WHERE ae.eventtype = 0
AND ae.eventtime BETWEEN DATE_SUB(CURDATE(), INTERVAL 15 DAY)
AND DATE_ADD(CURDATE(), INTERVAL 2 DAY)
AND ae.displaypath NOT LIKE '%System Startup%'
AND ae.source NOT LIKE '%System Startup%'
) AS a ON DATE(DATE_ADD(CURDATE(), INTERVAL n.n - 15 DAY)) = a.event_day
GROUP BY jam_day
ORDER BY jam_day ASC;

View File

@ -18,7 +18,7 @@
"cacheEnabled": false,
"database": "MariaDB",
"fallbackEnabled": false,
"lastModificationSignature": "c3aa459894a7bb465821b17aea7934569a6c76179e35ff4c9cb371de40fc0dc2",
"lastModificationSignature": "a5946a0f98a8ebc8614d33ac06e5076c16cd143ba99162899d9da4f2be39c4a4",
"permissions": [
{
"zone": "",
@ -27,7 +27,7 @@
],
"lastModification": {
"actor": "admin",
"timestamp": "2025-09-26T09:29:45Z"
"timestamp": "2025-10-06T09:38:19Z"
},
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [