From bcd97b6cc18a7d3b608c0b5d01d86496e659de51 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 04 三月 2025 16:45:03 +0800
Subject: [PATCH] art: 所有设备 台账 二保工单 根据设备id查询二保工单,并过滤掉已完成和已取消的二保工单
---
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml | 36 ++++++++++++++++++++++++++++++++----
1 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml
index a63838e..77de9af 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml
@@ -52,15 +52,12 @@
t3.sleep_start_date,
t3.sleep_end_date,
t3.is_day_span,
- t4.equipment_name,
- t5.start_time overtimeStartTime,
- t5.end_time overtimeEndTime
+ t4.equipment_name
FROM
mdc_device_calendar t1
LEFT JOIN mdc_shift t2 ON t1.shift_id = t2.id
LEFT JOIN mdc_shift_sub t3 ON t1.shift_sub_id = t3.id
LEFT JOIN mdc_equipment t4 ON t1.equipment_id = t4.equipment_id
- LEFT JOIN mdc_equipment_overtime t5 ON t5.calendar_id = t1.id
<where>
<if test="equipmentId != null and equipmentId != ''">
AND t4.equipment_id = #{ equipmentId }
@@ -124,4 +121,35 @@
SELECT TOP 1 * FROM mdc_device_calendar WHERE equipment_id = #{ equipmentId } ORDER BY effective_date ASC
</select>
+ <select id="listByEquipmentAndDates" resultType="org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo">
+ SELECT
+ t1.*,
+ t2.shift_name,
+ t3.shift_sub_name,
+ t3.start_date,
+ t3.end_date,
+ t3.sleep_start_date,
+ t3.sleep_end_date,
+ t3.is_day_span,
+ t4.equipment_name
+ FROM
+ mdc_device_calendar t1
+ LEFT JOIN mdc_shift t2 ON t1.shift_id = t2.id
+ LEFT JOIN mdc_shift_sub t3 ON t1.shift_sub_id = t3.id
+ LEFT JOIN mdc_equipment t4 ON t1.equipment_id = t4.equipment_id
+ <where>
+ <if test="equipmentId != null and equipmentId != ''">
+ AND t4.equipment_id = #{ equipmentId }
+ </if>
+ <if test="stringDates != null and stringDates.size() > 0 ">
+ AND t1.effective_date IN
+ <foreach collection="stringDates" item="stringDate" index="index" open="(" close=")" separator=",">
+ #{ stringDate }
+ </foreach>
+ </if>
+ </where>
+ ORDER BY
+ t1.effective_date ASC
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3