From 8238b458d6a3bec147fd4b639ed0427de7cf8be4 Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期一, 11 八月 2025 15:27:41 +0800
Subject: [PATCH] 添加附件

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

diff --git a/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
new file mode 100644
index 0000000..fc680d0
--- /dev/null
+++ b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "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,
+        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
+        FROM
+        measuring_instrument_ledger
+        <where>
+            <!-- 鏌ヨ鏉′欢鍚屼笂 -->
+            <if test="req.code != null and req.code != ''">
+                AND code LIKE CONCAT('%', #{req.code}, '%')
+            </if>
+            <if test="req.name != null and req.name != ''">
+                AND 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>
+            </if>
+            <if test="req.tenantId != null">
+                AND tenant_id = #{req.tenantId}
+            </if>
+            <if test="req.recordDate != null">
+                AND record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d')
+            </if>
+        </where>
+        ORDER BY update_time DESC
+    </select>
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3