From e2079ea034c7f6bb5fc096fd4d83ed9b2cc3ff13 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期日, 21 六月 2026 10:38:31 +0800
Subject: [PATCH] fix: 导入销售订单汇总修改

---
 src/main/resources/mapper/device/DeviceMaintenanceMapper.xml |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml b/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
index 347db76..21f60b8 100644
--- a/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
+++ b/src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
@@ -18,9 +18,12 @@
         dm.update_user,
         dm.tenant_id,
         dm.maintenance_actually_name,
+        dm.maintenance_person,
+        dm.maintenance_location,
+        dm.maintenance_items,
         dl.device_name,
         dl.device_model,
-        su.user_name as create_user_name
+        su.nick_name as create_user_name
         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
@@ -38,13 +41,24 @@
             <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.maintenanceLocation != null and deviceMaintenanceDto.maintenanceLocation != ''">
+                and dm.maintenance_location like concat('%',#{deviceMaintenanceDto.maintenanceLocation},'%')
             </if>
-            <if test="deviceMaintenanceDto.maintenanceActuallyTimeReq != null">
-                and dm.maintenance_actually_time like concat('%',#{deviceMaintenanceDto.maintenanceActuallyTimeReq},'%')
+            <if test="deviceMaintenanceDto.maintenanceItems != null and deviceMaintenanceDto.maintenanceItems != ''">
+                and dm.maintenance_items like concat('%',#{deviceMaintenanceDto.maintenanceItems},'%')
+            </if>
+            <if test="deviceMaintenanceDto.maintenancePlanTime != null">
+                and dm.maintenance_plan_time like concat('%',#{deviceMaintenanceDto.maintenancePlanTime},'%')
+            </if>
+            <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 &lt; date_add(str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d'), interval 1 day)
             </if>
         </where>
+        order by dm.create_time desc
     </select>
     <select id="detailById" resultType="com.ruoyi.device.dto.DeviceMaintenanceDto">
         select dm.id,
@@ -59,6 +73,9 @@
                dm.update_user,
                dm.tenant_id,
                dm.maintenance_actually_name,
+               dm.maintenance_person,
+               dm.maintenance_location,
+               dm.maintenance_items,
                dl.device_name,
                dl.device_model,
                su.user_name as create_user_name

--
Gitblit v1.9.3