From ab58c534308acc2982a617b40b6b027c0c1f6c5d Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 22 Apr 2024 16:09:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=AE=BE=E5=A4=87=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E5=BA=93=E3=80=81=E6=97=A5=E5=B8=B8=E7=BB=B4=E6=8A=A4=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E3=80=81=E4=BB=BB=E5=8A=A1=E8=A1=A5=E5=85=85=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service/operational/src/main/resources/db/2.0.3.sql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/resources/db/2.0.3.sql b/hzims-service/operational/src/main/resources/db/2.0.3.sql index c8df871..4290cc0 100644 --- a/hzims-service/operational/src/main/resources/db/2.0.3.sql +++ b/hzims-service/operational/src/main/resources/db/2.0.3.sql @@ -11,4 +11,16 @@ alter table `hzims_oper_maintenance_task` add column `station_name` varchar(100 alter table `hzims_oper_maintenance_task` add column `em_name` varchar(255) comment '设备名称'; -- 日常维护计划、任务添加周期字段 alter table `hzims_oper_maintenance_plan` add column `period` int(11) comment '周期(单位:小时)'; -alter table `hzims_oper_maintenance_task` add column `period` int(11) comment '周期(单位:小时)'; \ No newline at end of file +alter table `hzims_oper_maintenance_task` add column `period` int(11) comment '周期(单位:小时)'; +-- 更新日常维护库设备名称 +update hzims_oper_maintenance_library t1,( + select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_library ml,equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null +-- 更新日常维护计划设备名称 +update hzims_oper_maintenance_plan t1,( + select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_plan ml,equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null +-- 更新日常维护任务设备名称 +update hzims_oper_maintenance_task t1,( + select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_task ml,prod_hzims_equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null \ No newline at end of file