From 84759dac1add86112a974fb5fb0bf0e7f5921362 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期一, 02 三月 2026 17:03:55 +0800
Subject: [PATCH] 坤泰 设备保养备件领用查询
---
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml b/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
index 9917ce2..89f6b0c 100644
--- a/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
+++ b/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
@@ -20,7 +20,8 @@
dm.maintenance_actually_name,
dl.device_name,
dl.device_model,
- su.user_name as create_user_name
+ su.nick_name as create_user_name,
+ dm.spare_parts_ids
from device_maintenance dm
left join device_ledger dl on dm.device_ledger_id = dl.id
left join sys_user su on dm.create_user = su.user_id
@@ -32,14 +33,21 @@
<if test="deviceMaintenanceDto.deviceModel != null">
and dl.device_model like concat('%',#{deviceMaintenanceDto.deviceModel},'%')
</if>
+ <if test="deviceMaintenanceDto.status != null">
+ and dm.status = #{deviceMaintenanceDto.status}
+ </if>
<if test="deviceMaintenanceDto.maintenanceActuallyName != null">
and dm.maintenance_actually_name like concat('%',#{deviceMaintenanceDto.maintenanceActuallyName},'%')
</if>
- <if test="deviceMaintenanceDto.maintenancePlanTimeReq != null">
- and dm.maintenance_plan_time like concat('%',#{deviceMaintenanceDto.maintenancePlanTimeReq},'%')
+ <if test="deviceMaintenanceDto.maintenancePlanTime != null">
+ and dm.maintenance_plan_time like concat('%',#{deviceMaintenanceDto.maintenancePlanTime},'%')
</if>
- <if test="deviceMaintenanceDto.maintenanceActuallyTimeReq != null">
- and dm.maintenance_actually_time like concat('%',#{deviceMaintenanceDto.maintenanceActuallyTimeReq},'%')
+ <if test="deviceMaintenanceDto.maintenanceActuallyTime != null">
+ and dm.maintenance_actually_time like concat('%',#{deviceMaintenanceDto.maintenanceActuallyTime},'%')
+ </if>
+ <if test="deviceMaintenanceDto.maintenanceActuallyTime != null">
+ and dm.maintenance_actually_time >= str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d')
+ and dm.maintenance_actually_time < date_add(str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d'), interval 1 day)
</if>
</where>
</select>
--
Gitblit v1.9.3