wu
2025-10-29 13ebc9b93dffc61f5124a9871000f2335d5ae7f8
gmms.sql
@@ -11,7 +11,7 @@
 Target Server Version : 80022
 File Encoding         : 65001
 Date: 22/10/2025 12:15:25
 Date: 29/10/2025 15:03:38
*/
SET NAMES utf8mb4;
@@ -981,8 +981,8 @@
INSERT INTO `machine_content` VALUES (7, '耗材3更换', 0, '2025-05-13 19:09:16', 'A7', 1);
INSERT INTO `machine_content` VALUES (7, '玻璃状态', 0, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (7, '油位低报警', NULL, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (7, '故障内容', NULL, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (7, '报警内容', NULL, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (7, '故障内容', 0, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (7, '报警内容', 0, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (28, 'MES发送配方', 18, '2025-05-13 19:09:16', 'A18', 3);
INSERT INTO `machine_content` VALUES (28, 'MES发送清除计数', 0, '2025-05-13 19:09:16', 'A7', 1);
INSERT INTO `machine_content` VALUES (28, '紧急停止', 0, '2025-05-13 19:09:16', 'A9', 1);
@@ -996,8 +996,8 @@
INSERT INTO `machine_content` VALUES (28, '耗材3更换', 0, '2025-05-13 19:09:16', 'A7', 1);
INSERT INTO `machine_content` VALUES (28, '玻璃状态', 0, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (28, '油位低报警', NULL, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (28, '故障内容', NULL, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (28, '报警内容', NULL, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (28, '故障内容', 0, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (28, '报警内容', 0, '2025-05-13 19:09:16', 'A9', 1);
INSERT INTO `machine_content` VALUES (19, '烘干玻璃总数', 1, '2025-05-18 15:15:11', 'A18', 10);
INSERT INTO `machine_content` VALUES (16, '玻璃计数', 0, '2025-05-18 15:39:13', 'A7', 10);
INSERT INTO `machine_content` VALUES (5, 'W2磨边玻璃计数', 442, '2025-05-19 14:31:31', 'A16', 10);
@@ -1158,22 +1158,22 @@
INSERT INTO `machine_content` VALUES (8, 'S4玻璃状态', 0, '2025-05-19 14:31:33', 'A14', 1);
INSERT INTO `machine_content` VALUES (8, 'Z8玻璃状态', 0, '2025-05-19 14:31:33', 'A16', 1);
INSERT INTO `machine_content` VALUES (8, 'S5玻璃状态', 0, '2025-05-19 14:31:33', 'A17', 1);
INSERT INTO `machine_content` VALUES (8, 'S1故障内容', NULL, '2025-05-19 14:31:33', 'A18', 1);
INSERT INTO `machine_content` VALUES (8, 'Z3故障内容', NULL, '2025-05-19 14:31:33', 'A4', 1);
INSERT INTO `machine_content` VALUES (8, 'G3故障内容', NULL, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (8, 'G4故障内容', NULL, '2025-05-19 14:31:33', 'A9', 1);
INSERT INTO `machine_content` VALUES (8, 'Z4故障内容', NULL, '2025-05-19 14:31:33', 'A11', 1);
INSERT INTO `machine_content` VALUES (8, 'G5故障内容', NULL, '2025-05-19 14:31:33', 'A15', 1);
INSERT INTO `machine_content` VALUES (8, 'Z9故障内容', NULL, '2025-05-19 14:31:33', 'A10', 1);
INSERT INTO `machine_content` VALUES (8, 'G6故障内容', NULL, '2025-05-19 14:31:33', 'A14', 1);
INSERT INTO `machine_content` VALUES (8, 'S2故障内容', NULL, '2025-05-19 14:31:33', 'A16', 1);
INSERT INTO `machine_content` VALUES (8, 'Z5故障内容', NULL, '2025-05-19 14:31:33', 'A17', 1);
INSERT INTO `machine_content` VALUES (8, 'S3故障内容', NULL, '2025-05-19 14:31:33', 'A18', 1);
INSERT INTO `machine_content` VALUES (8, 'Z6故障内容', NULL, '2025-05-19 14:31:33', 'A10', 1);
INSERT INTO `machine_content` VALUES (8, 'Z7故障内容', NULL, '2025-05-19 14:31:33', 'A14', 1);
INSERT INTO `machine_content` VALUES (8, 'S4故障内容', NULL, '2025-05-19 14:31:33', 'A16', 1);
INSERT INTO `machine_content` VALUES (8, 'Z8故障内容', NULL, '2025-05-19 14:31:33', 'A17', 1);
INSERT INTO `machine_content` VALUES (8, 'S5故障内容', NULL, '2025-05-19 14:31:33', 'A18', 1);
INSERT INTO `machine_content` VALUES (8, 'S1故障内容', 0, '2025-05-19 14:31:33', 'A18', 1);
INSERT INTO `machine_content` VALUES (8, 'Z3故障内容', 0, '2025-05-19 14:31:33', 'A4', 1);
INSERT INTO `machine_content` VALUES (8, 'G3故障内容', 0, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (8, 'G4故障内容', 0, '2025-05-19 14:31:33', 'A9', 1);
INSERT INTO `machine_content` VALUES (8, 'Z4故障内容', 0, '2025-05-19 14:31:33', 'A11', 1);
INSERT INTO `machine_content` VALUES (8, 'G5故障内容', 0, '2025-05-19 14:31:33', 'A15', 1);
INSERT INTO `machine_content` VALUES (8, 'Z9故障内容', 0, '2025-05-19 14:31:33', 'A10', 1);
INSERT INTO `machine_content` VALUES (8, 'G6故障内容', 0, '2025-05-19 14:31:33', 'A14', 1);
INSERT INTO `machine_content` VALUES (8, 'S2故障内容', 0, '2025-05-19 14:31:33', 'A16', 1);
INSERT INTO `machine_content` VALUES (8, 'Z5故障内容', 0, '2025-05-19 14:31:33', 'A17', 1);
INSERT INTO `machine_content` VALUES (8, 'S3故障内容', 0, '2025-05-19 14:31:33', 'A18', 1);
INSERT INTO `machine_content` VALUES (8, 'Z6故障内容', 0, '2025-05-19 14:31:33', 'A10', 1);
INSERT INTO `machine_content` VALUES (8, 'Z7故障内容', 0, '2025-05-19 14:31:33', 'A14', 1);
INSERT INTO `machine_content` VALUES (8, 'S4故障内容', 0, '2025-05-19 14:31:33', 'A16', 1);
INSERT INTO `machine_content` VALUES (8, 'Z8故障内容', 0, '2025-05-19 14:31:33', 'A17', 1);
INSERT INTO `machine_content` VALUES (8, 'S5故障内容', 0, '2025-05-19 14:31:33', 'A18', 1);
INSERT INTO `machine_content` VALUES (26, 'MES发送配方', 18, '2025-05-19 14:31:33', 'A18', 3);
INSERT INTO `machine_content` VALUES (26, 'MES发送清除计数', 0, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (26, '紧急停止', 0, '2025-05-19 14:31:33', 'A9', 1);
@@ -1182,7 +1182,7 @@
INSERT INTO `machine_content` VALUES (26, '出片当前速度', 0, '2025-05-19 14:31:33', 'A9', 1);
INSERT INTO `machine_content` VALUES (26, '设备状态', 1, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (26, '玻璃状态', 0, '2025-05-19 14:31:33', 'A9', 1);
INSERT INTO `machine_content` VALUES (26, '故障内容', NULL, '2025-05-19 14:31:33', 'A9', 1);
INSERT INTO `machine_content` VALUES (26, '故障内容', 0, '2025-05-19 14:31:33', 'A9', 1);
INSERT INTO `machine_content` VALUES (23, '当前配方', 3, '2025-05-19 14:31:33', 'A18', 2);
INSERT INTO `machine_content` VALUES (23, '25#设备状态', 1, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '26#设备状态', 1, '2025-05-19 14:31:33', 'A18', 1);
@@ -1197,8 +1197,8 @@
INSERT INTO `machine_content` VALUES (23, '烘干玻璃总数', 5971, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '25#故障内容', 0, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '26#故障内容', 0, '2025-05-19 14:31:33', 'A18', 1);
INSERT INTO `machine_content` VALUES (23, '烘干机故障内容1', 84, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '烘干机故障内容2', 32, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '烘干机故障内容1', 0, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '烘干机故障内容2', 0, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '29#故障内容', 0, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, '30#故障内容', 0, '2025-05-19 14:31:33', 'A7', 1);
INSERT INTO `machine_content` VALUES (23, 'MES发送配方', 18, '2025-05-19 14:31:33', 'A7', 3);
@@ -1215,7 +1215,7 @@
INSERT INTO `machine_content` VALUES (18, '片台3玻璃数量', 0, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (18, '片台1故障内容', 0, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (18, '片台2故障内容', 0, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (18, '印刷机故障内容1', 768, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (18, '印刷机故障内容1', 0, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (18, '印刷机故障内容2', 0, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (18, '片台3故障内容', 0, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (18, '印刷机玻璃总数', 410, '2025-05-19 14:31:34', 'A18', 1);
@@ -1256,7 +1256,7 @@
INSERT INTO `machine_content` VALUES (20, '片台3玻璃数量', 0, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (20, '片台1故障内容', 0, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (20, '片台2故障内容', 0, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (20, '印刷机故障内容1', 768, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (20, '印刷机故障内容1', 0, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (20, '印刷机故障内容2', 0, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (20, '片台3故障内容', 0, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (20, '印刷机玻璃总数', 393, '2025-05-19 14:31:34', 'A18', 1);
@@ -1304,11 +1304,11 @@
INSERT INTO `machine_content` VALUES (10, 'Z13故障内容', 0, '2025-05-19 14:31:34', 'A14', 1);
INSERT INTO `machine_content` VALUES (10, 'G10故障内容', 0, '2025-05-19 14:31:34', 'A16', 1);
INSERT INTO `machine_content` VALUES (10, 'G11故障内容', 0, '2025-05-19 14:31:34', 'A17', 1);
INSERT INTO `machine_content` VALUES (10, 'G12故障内容', NULL, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (10, 'G13故障内容', NULL, '2025-05-19 14:31:34', 'A4', 1);
INSERT INTO `machine_content` VALUES (10, 'S6故障内容', NULL, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (10, 'S7故障内容', NULL, '2025-05-19 14:31:34', 'A9', 1);
INSERT INTO `machine_content` VALUES (10, 'Z11故障内容', NULL, '2025-05-19 14:31:34', 'A11', 1);
INSERT INTO `machine_content` VALUES (10, 'G12故障内容', 0, '2025-05-19 14:31:34', 'A18', 1);
INSERT INTO `machine_content` VALUES (10, 'G13故障内容', 0, '2025-05-19 14:31:34', 'A4', 1);
INSERT INTO `machine_content` VALUES (10, 'S6故障内容', 0, '2025-05-19 14:31:34', 'A7', 1);
INSERT INTO `machine_content` VALUES (10, 'S7故障内容', 0, '2025-05-19 14:31:34', 'A9', 1);
INSERT INTO `machine_content` VALUES (10, 'Z11故障内容', 0, '2025-05-19 14:31:34', 'A11', 1);
INSERT INTO `machine_content` VALUES (10, 'Z13皮带入片速度', NULL, '2025-05-19 14:31:34', 'A15', 1);
INSERT INTO `machine_content` VALUES (21, '当前配方', 2, '2025-05-19 14:31:34', 'A18', 2);
INSERT INTO `machine_content` VALUES (21, '14#设备状态', 1, '2025-05-19 14:31:34', 'A7', 1);
@@ -1360,7 +1360,7 @@
INSERT INTO `machine_content` VALUES (24, '片台3玻璃数量', 0, '2025-05-19 14:31:35', 'A18', 1);
INSERT INTO `machine_content` VALUES (24, '片台1故障内容', 0, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (24, '片台2故障内容', 0, '2025-05-19 14:31:35', 'A18', 1);
INSERT INTO `machine_content` VALUES (24, '印刷机故障内容1', 768, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (24, '印刷机故障内容1', 0, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (24, '印刷机故障内容2', 0, '2025-05-19 14:31:35', 'A18', 1);
INSERT INTO `machine_content` VALUES (24, '片台3故障内容', 0, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (24, '印刷机玻璃总数', 346, '2025-05-19 14:31:35', 'A18', 1);
@@ -1378,7 +1378,7 @@
INSERT INTO `machine_content` VALUES (22, '片台3玻璃数量', 1, '2025-05-19 14:31:35', 'A18', 1);
INSERT INTO `machine_content` VALUES (22, '片台1故障内容', 0, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (22, '片台2故障内容', 0, '2025-05-19 14:31:35', 'A18', 1);
INSERT INTO `machine_content` VALUES (22, '印刷机故障内容1', 768, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (22, '印刷机故障内容1', 0, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (22, '印刷机故障内容2', 0, '2025-05-19 14:31:35', 'A18', 1);
INSERT INTO `machine_content` VALUES (22, '片台3故障内容', 0, '2025-05-19 14:31:35', 'A7', 1);
INSERT INTO `machine_content` VALUES (22, '印刷机玻璃总数', 362, '2025-05-19 14:31:35', 'A18', 1);
@@ -10410,11 +10410,12 @@
 SET loadTime = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 6 DAY),'%Y-%m-%d 00:00:00');
 SET endTime = DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 DAY),'%Y-%m-%d 00:00:00');
   select sum(a.electric_consumption),
    SUM(SUM(a.electric_consumption)) OVER () AS total_consumption,
   a.create_time from glog.electric_comsumption a
   select sum(a.electric_consumption) as jiqidianliang,DATE_FORMAT(a.create_time, '%m/%d') as date,
    SUM(SUM(a.electric_consumption)) OVER () AS total_consumption from glog.electric_comsumption a
   where a.create_time BETWEEN loadtime AND endtime
   GROUP BY a.create_time;
   GROUP BY left(a.create_time,10)
   ORDER BY a.create_time;
END
;;
delimiter ;
@@ -10427,8 +10428,10 @@
CREATE PROCEDURE `bigScreen_order`()
BEGIN
   #获取当前订单
   select a.order_id,(a.smallglass_no-a.smallglass_completed),a.smallglass_completed,b.count,b.count_task
   from `order` a INNER JOIN yieid b where a.order_status=2;
select a.order_id,recipe_no,a.smallglass_completed,(a.smallglass_no-a.smallglass_completed) as smallglass_processing
,b.count,b.count_task,
(select sum(num) from glog.sum_glass where machine_id=13 AND DATE(createTime) = CURDATE())as glassSum
from `order` a INNER JOIN yieid b where a.order_status=2;
END
;;
delimiter ;
@@ -10447,9 +10450,9 @@
 SET loadTime = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 6 DAY),'%Y-%m-%d 00:00:00');
 SET endTime = DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 DAY),'%Y-%m-%d 00:00:00');
   select sum(a.water_consumption),
   select sum(a.water_consumption)as jiqidianliang,DATE_FORMAT(a.create_time, '%m/%d') as date,
   SUM(SUM(a.water_consumption)) OVER () AS total_consumption
   ,a.create_time from glog.water_consumption a
    from glog.water_consumption a
   where a.create_time BETWEEN loadtime AND endtime
   GROUP BY a.create_time;
END
@@ -11374,6 +11377,26 @@
delimiter ;
-- ----------------------------
-- Procedure structure for machine_warningScreen
-- ----------------------------
DROP PROCEDURE IF EXISTS `machine_warningScreen`;
delimiter ;;
CREATE PROCEDURE `machine_warningScreen`()
BEGIN
   select DISTINCT a.id,b.machine_id,b.content,IFNULL(b.content_value,0)as content_value,
   CASE
    WHEN b.content_value IS NOT NULL AND b.content_value != 0 THEN 1
    ELSE 0
  END AS state
   from machine_analysis a
   left join machine_content b on a.beizhu=b.content and a.machine_id=b.machine_id
   where b.content LIKE '%内容%';
END
;;
delimiter ;
-- ----------------------------
-- Procedure structure for message
-- ----------------------------
DROP PROCEDURE IF EXISTS `message`;