From 42aa4f39f08bce889d09963a2185d4fdb45d828e Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期六, 30 五月 2026 15:07:33 +0800
Subject: [PATCH] 协同审批返回采购,发货,报价单号
---
src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
index fc680d0..7de15bd 100644
--- a/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
+++ b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
@@ -15,14 +15,20 @@
next_date,
record_date,
CASE
- WHEN next_date >= DATE_FORMAT(now(),'%Y-%m-%d') THEN 1
+ WHEN most_date IS NOT NULL
+ AND valid IS NOT NULL
+ AND DATE_ADD(most_date, INTERVAL valid DAY) >= CURDATE() THEN 1
ELSE 2
END AS status,
create_user,
create_time,
update_user,
update_time,
- tenant_id
+ tenant_id,
+ unit,
+ dept_id,
+ instation_location,
+ cycle
FROM
measuring_instrument_ledger
<where>
@@ -36,10 +42,16 @@
<if test="req.status != null">
<choose>
<when test="req.status == 1">
- AND next_date >= DATE_FORMAT(now(),'%Y-%m-%d')
+ AND most_date IS NOT NULL
+ AND valid IS NOT NULL
+ AND DATE_ADD(most_date, INTERVAL valid DAY) >= CURDATE()
</when>
<when test="req.status == 2">
- AND next_date < DATE_FORMAT(now(),'%Y-%m-%d')
+ AND (
+ most_date IS NULL
+ OR valid IS NULL
+ OR DATE_ADD(most_date, INTERVAL valid DAY) < CURDATE()
+ )
</when>
</choose>
</if>
@@ -50,6 +62,6 @@
AND record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d')
</if>
</where>
- ORDER BY update_time DESC
+ ORDER BY create_time DESC
</select>
-</mapper>
\ No newline at end of file
+</mapper>
--
Gitblit v1.9.3