From 539d9ffc477d28a23a923b41fdeabc8c37c99ce6 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 23 九月 2024 14:43:31 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/ManPakOutMapper.xml |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/mapper/ManPakOutMapper.xml b/src/main/resources/mapper/ManPakOutMapper.xml
index 17daba0..b22b0f5 100644
--- a/src/main/resources/mapper/ManPakOutMapper.xml
+++ b/src/main/resources/mapper/ManPakOutMapper.xml
@@ -6,26 +6,38 @@
         <if test="docnum != null and docnum != '' ">
             and doc_num like '%' + #{docnum} + '%'
         </if>
-
+        <if test="custName != null and custName != ''">
+            and cust_name like '%' + #{custName} + '%'
+        </if>
+        <if test="stime != null">
+            and create_time >= #{stime}
+        </if>
+        <if test="etime != null">
+            and create_time &lt;= #{etime}
+        </if>
+        <if test="userId != null">
+            and (create_by = #{userId} or create_by is null)
+        </if>
 
     </sql>
 
     <select id="selectPakOut" resultType="com.zy.asrs.entity.param.PakOutDTO">
         select * from (
-          SELECT ROW_NUMBER() over (order by doc_num) as row,  doc_num,MAX(create_time) as create_time FROM man_pakout
+          SELECT status, doc_num,MAX(create_time) as create_time,MAX(update_time) as update_time, cust_name as custName FROM man_pakout
            where 1=1
             <include refid="selectPakOutSql"></include>
-          GROUP BY doc_num
-      ) t where t.row BETWEEN ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit})
-        ORDER BY create_time DESC
+          GROUP BY doc_num,cust_name,status
+      ) t ORDER BY status,update_time DESC
+        OFFSET ((#{curr}-1)*#{limit}) ROWS
+        FETCH NEXT #{limit} ROWS ONLY;
 
     </select>
     <select id="selectPakOutCount" resultType="java.lang.Integer">
         select count(1) from (
-          SELECT ROW_NUMBER() over (order by doc_num) as row,  doc_num,MAX(create_time) as create_time FROM man_pakout
+          SELECT status,  doc_num,MAX(create_time) as create_time FROM man_pakout
        where 1=1
         <include refid="selectPakOutSql"></include>
-          GROUP BY doc_num
+          GROUP BY doc_num,cust_name,status
       ) t
     </select>
 </mapper>

--
Gitblit v1.9.1