added new queries

This commit is contained in:
Salijoghli 2025-09-01 11:05:26 +04:00
parent 79fe5a7fdd
commit e48f8ed7c5
10 changed files with 323 additions and 0 deletions

View File

@ -0,0 +1,9 @@
SELECT concat(date(dumper_cycles.t_stamp), ' ', hour(dumper_cycles.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(dumper_cycles.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
SUM (dumper_cycles.ulgl1 = 1) as ULGL1,
SUM (dumper_cycles.ulgl2 = 1) as ULGL2,
SUM (dumper_cycles.ulgl3 = 1) as ULGL3
FROM dumper_cycles
Where (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(dumper_cycles.t_stamp)

View File

@ -0,0 +1,51 @@
{
"scope": "DG",
"version": 2,
"restricted": false,
"overridable": true,
"files": [
"query.sql"
],
"attributes": {
"useMaxReturnSize": false,
"autoBatchEnabled": false,
"fallbackValue": "",
"maxReturnSize": 100,
"cacheUnit": "SEC",
"type": "Query",
"enabled": true,
"cacheAmount": 1,
"cacheEnabled": false,
"database": "MariaDB",
"fallbackEnabled": false,
"lastModificationSignature": "2dd7fc2b293cbf019cdbed6126eda9851471bbb604243c89b79dc3f9551650c6",
"permissions": [
{
"zone": "",
"role": ""
}
],
"lastModification": {
"actor": "admin",
"timestamp": "2025-09-01T07:03:32Z"
},
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [
{
"type": "Parameter",
"identifier": "starttime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "endtime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "dumper",
"sqlType": 7
}
]
}
}

View File

@ -0,0 +1,13 @@
SELECT concat(date(dumper_cycles.t_stamp), ' ', hour(dumper_cycles.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(dumper_cycles.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
concat(round(SUM(dumper_cycles.ulgl1 = 1)/COUNT(*) * 100*2,2),'%') AS ULGL1,
concat(round(SUM(dumper_cycles.ulgl2 = 1)/COUNT(*) * 100*2,2),'%') AS ULGL2,
concat(round(SUM(dumper_cycles.ulgl3 = 1)/COUNT(*) * 100*2,2),'%') AS ULGL3
FROM dumper_cycles
Where (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(dumper_cycles.t_stamp)

View File

@ -0,0 +1,51 @@
{
"scope": "DG",
"version": 2,
"restricted": false,
"overridable": true,
"files": [
"query.sql"
],
"attributes": {
"useMaxReturnSize": false,
"autoBatchEnabled": false,
"fallbackValue": "",
"maxReturnSize": 100,
"cacheUnit": "SEC",
"type": "Query",
"enabled": true,
"cacheAmount": 1,
"cacheEnabled": false,
"database": "MariaDB",
"fallbackEnabled": false,
"lastModificationSignature": "00e50a9c5f780eb57e9895979fb0f70df83ac9d6771f9a562fc452b46555b938",
"permissions": [
{
"zone": "",
"role": ""
}
],
"lastModification": {
"actor": "admin",
"timestamp": "2025-09-01T07:03:32Z"
},
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [
{
"type": "Parameter",
"identifier": "starttime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "endtime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "dumper",
"sqlType": 7
}
]
}
}

View File

@ -0,0 +1,10 @@
SELECT concat(date(dumper_cycles.t_stamp), ' ', hour(dumper_cycles.t_stamp), ':00') as StartTimestamp,
concat('H',TIMESTAMPDIFF(HOUR,DATE_FORMAT(dumper_cycles.t_stamp,"%Y-%m-%d %H:00:00"),DATE_FORMAT(now(),"%Y-%m-%d %H:00:00"))) as Hour,
concat(cast(SUM(dumper_cycles.ulgl1 = 1) as char),' cph') AS ULGL1,
concat(cast(SUM(dumper_cycles.ulgl2 = 1) as char),' cph') AS ULGL2,
concat(cast(SUM(dumper_cycles.ulgl3 = 1) as char),' cph') AS ULGL3
FROM dumper_cycles
Where (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(dumper_cycles.t_stamp)

View File

@ -0,0 +1,51 @@
{
"scope": "DG",
"version": 2,
"restricted": false,
"overridable": true,
"files": [
"query.sql"
],
"attributes": {
"useMaxReturnSize": false,
"autoBatchEnabled": false,
"fallbackValue": "",
"maxReturnSize": 100,
"cacheUnit": "SEC",
"type": "Query",
"enabled": true,
"cacheAmount": 1,
"cacheEnabled": false,
"database": "MariaDB",
"fallbackEnabled": false,
"lastModificationSignature": "ab5f21c30d6e17439ac74653867d29731917ba811b0f5491a165a199b5f01185",
"permissions": [
{
"zone": "",
"role": ""
}
],
"lastModification": {
"actor": "admin",
"timestamp": "2025-09-01T07:03:32Z"
},
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [
{
"type": "Parameter",
"identifier": "starttime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "endtime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "dumper",
"sqlType": 7
}
]
}
}

View File

@ -0,0 +1,26 @@
Select
Total_Jam,Dumpers_jam,Inbound_jam,Runout_jam,Sorter_Recirc_jam,Startstamp,Endtstamp,Sorter_jam,
1 as Total_perc,
Dumpers_jam/Total_Jam as Dumpers_perc,
Inbound_jam/Total_Jam as Inbound_perc,
Runout_jam/Total_Jam as Runout_perc,
Sorter_Recirc_jam/Total_Jam as Sorter_Recirc_perc,
Sorter_jam/Total_Jam as Sorter_perc
FROM
(SELECT
MIN(jam_area.t_stamp) AS Startstamp,
Max(jam_area.t_stamp) AS Endtstamp,
SUM (IFNULL(`jam_ulgl`,0) + IFNULL(`Inbound_jam`, 0)+ IFNULL(`Runout_jam`, 0) + IFNULL(`Sorter_recirc`,0)+ IFNULL(`Sorter_jam`,0)) AS Total_Jam,
SUM(jam_area.jam_ulgl = 1) AS Dumpers_jam,
SUM(jam_area.Inbound_jam = 1) AS Inbound_jam,
SUM(jam_area.Runout_jam = 1) AS Runout_jam,
SUM(jam_area.Sorter_recirc = 1) AS Sorter_Recirc_jam,
SUM(jam_area.Sorter_jam = 1) AS Sorter_jam
FROM jam_area
Where (jam_area.t_stamp BETWEEN :starttime AND :endtime)) basajam

View File

@ -0,0 +1,46 @@
{
"scope": "DG",
"version": 2,
"restricted": false,
"overridable": true,
"files": [
"query.sql"
],
"attributes": {
"useMaxReturnSize": false,
"autoBatchEnabled": false,
"fallbackValue": "",
"maxReturnSize": 100,
"cacheUnit": "SEC",
"type": "Query",
"enabled": true,
"cacheAmount": 1,
"cacheEnabled": false,
"database": "MariaDB",
"fallbackEnabled": false,
"lastModificationSignature": "8f954ad562de8add9bfe686ee77a0138e0d063386e4c45a6cc7b35520db43744",
"permissions": [
{
"zone": "",
"role": ""
}
],
"lastModification": {
"actor": "admin",
"timestamp": "2025-09-01T07:03:32Z"
},
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [
{
"type": "Parameter",
"identifier": "endtime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "starttime",
"sqlType": 8
}
]
}
}

View File

@ -0,0 +1,20 @@
Select
roundtime,Dumpers_jam,Inbound_jam,Runout_jam,Sorter_Recirc_jam,Sorter_jam
FROM
(Select
SUM(jam_area.jam_ulgl = 1) AS Dumpers_jam,
SUM(jam_area.Inbound_jam = 1) AS Inbound_jam,
SUM(jam_area.Runout_jam = 1) AS Runout_jam,
SUM(jam_area.Sorter_recirc = 1) AS Sorter_Recirc_jam,
SUM(jam_area.Sorter_jam = 1) AS Sorter_jam,
FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(jam_area.t_stamp) / 600) * 600) roundtime
FROM jam_area
Where (jam_area.t_stamp BETWEEN :starttime AND :endtime)
Group BY FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(jam_area.t_stamp) / 600) * 600)
Order By jam_area.t_stamp ASC
) okeyjam

View File

@ -0,0 +1,46 @@
{
"scope": "DG",
"version": 2,
"restricted": false,
"overridable": true,
"files": [
"query.sql"
],
"attributes": {
"useMaxReturnSize": false,
"autoBatchEnabled": false,
"fallbackValue": "",
"maxReturnSize": 100,
"cacheUnit": "SEC",
"type": "Query",
"enabled": true,
"cacheAmount": 1,
"cacheEnabled": false,
"database": "MariaDB",
"fallbackEnabled": false,
"lastModificationSignature": "e0fee947502496558ee94f8abad24fdad6c7b6a16c9488810dd1b14f0d133667",
"permissions": [
{
"zone": "",
"role": ""
}
],
"lastModification": {
"actor": "admin",
"timestamp": "2025-09-01T07:03:32Z"
},
"syntaxProvider": "class com.adbs.syntax.MySQLSyntaxProvider",
"parameters": [
{
"type": "Parameter",
"identifier": "starttime",
"sqlType": 8
},
{
"type": "Parameter",
"identifier": "endtime",
"sqlType": 8
}
]
}
}