From f3a2e64d96e59bed492bb3eec8705a5f9ca269d7 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期四, 15 一月 2026 09:11:37 +0800
Subject: [PATCH] 设备校准修改

---
 src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml |   62 ++++++++++++++-----------------
 1 files changed, 28 insertions(+), 34 deletions(-)

diff --git a/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
index fc680d0..78aaaa6 100644
--- a/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
+++ b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
@@ -2,54 +2,48 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.measuringinstrumentledger.mapper.MeasuringInstrumentLedgerMapper">
 
-    <select id="listPage" resultType="com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedger">
+    <select id="listPage" resultType="com.ruoyi.measuringinstrumentledger.dto.MeasuringInstrumentLedgerPageDto">
         SELECT
-        id,
-        user_id,
-        user_name,
-        code,
-        name,
-        model,
-        most_date,
-        valid,
-        next_date,
-        record_date,
-        CASE
-        WHEN next_date &gt;=  DATE_FORMAT(now(),'%Y-%m-%d') THEN 1
-        ELSE 2
-        END AS status,
-        create_user,
-        create_time,
-        update_user,
-        update_time,
-        tenant_id
+        mil.id,
+        mil.user_id,
+        mil.user_name,
+        mil.code,
+        sd.dept_name,
+        mil.installation_location,
+        mil.unit,
+        mil.cycle,
+        mil.name,
+        mil.model,
+        mil.most_date,
+        mil.valid,
+        mil.next_date,
+        mil.record_date,
+        mil.create_user,
+        mil.create_time,
+        mil.update_user,
+        mil.update_time,
+        mil.tenant_id
         FROM
-        measuring_instrument_ledger
+        measuring_instrument_ledger mil
+        left join sys_dept sd on sd.id = mil.dept_id
         <where>
             <!-- 鏌ヨ鏉′欢鍚屼笂 -->
             <if test="req.code != null and req.code != ''">
-                AND code LIKE CONCAT('%', #{req.code}, '%')
+                AND mil.code LIKE CONCAT('%', #{req.code}, '%')
             </if>
             <if test="req.name != null and req.name != ''">
-                AND name LIKE CONCAT('%', #{req.name}, '%')
+                AND mil.name LIKE CONCAT('%', #{req.name}, '%')
             </if>
             <if test="req.status != null">
-                <choose>
-                    <when test="req.status == 1">
-                        AND next_date &gt;=  DATE_FORMAT(now(),'%Y-%m-%d')
-                    </when>
-                    <when test="req.status == 2">
-                        AND next_date &lt;  DATE_FORMAT(now(),'%Y-%m-%d')
-                    </when>
-                </choose>
+                AND mil.status = #{req.status}
             </if>
             <if test="req.tenantId != null">
-                AND tenant_id = #{req.tenantId}
+                AND mil.tenant_id = #{req.tenantId}
             </if>
             <if test="req.recordDate != null">
-                AND record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d')
+                AND mil.record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d')
             </if>
         </where>
-        ORDER BY update_time DESC
+        ORDER BY mil.update_time DESC
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3