From 1bf7a7cb5be7c82a3d0c615429e272fd6860ecbe Mon Sep 17 00:00:00 2001
From: admin <841110950@qq.com>
Date: 星期六, 28 八月 2021 08:28:32 +0800
Subject: [PATCH] Merge branch 'xgmasrs' of https://gitee.com/luxiaotao1123/zy-asrs into HEAD

---
 src/main/resources/mapper/WaitMatinMapper.xml |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/main/resources/mapper/WaitMatinMapper.xml b/src/main/resources/mapper/WaitMatinMapper.xml
index 02eafe9..622c43b 100644
--- a/src/main/resources/mapper/WaitMatinMapper.xml
+++ b/src/main/resources/mapper/WaitMatinMapper.xml
@@ -28,11 +28,11 @@
     </resultMap>
 
     <sql id="condition">
-        <if test="loc_no!=null and loc_no!='' ">
-            and a.loc_no like '%' + #{loc_no} + '%'
+        <if test="bill_no!=null and bill_no!='' ">
+            and bill_no like '%' + #{bill_no} + '%'
         </if>
-        <if test="mat_no!=null and mat_no!='' ">
-            and a.mat_no like '%' + #{mat_no} + '%'
+        <if test="bill_type!=null and bill_type!='' ">
+            and bill_type like '%' + #{bill_type} + '%'
         </if>
         <if test="mat_name!=null and mat_name!='' ">
             and a.mat_name like '%' + #{mat_name} + '%'
@@ -44,27 +44,35 @@
             and a.unit like '%' + #{unit} + '%'
         </if>
         <if test="startTime!=null and endTime!=null">
-            and a.modi_time between #{startTime} and #{endTime}
+            and appe_time between #{startTime} and #{endTime}
         </if>
     </sql>
 
     <select id="getHeadPage" resultMap="BaseResultMap">
         select * from
         (
-        select distinct bill_no, bill_type, appe_time,
-        ROW_NUMBER() over (order by appe_time) as row
-        from ints_wait_matin
-        <include refid="condition"></include>
+            select *,
+            ROW_NUMBER() over (order by appe_time desc) as row
+            from (
+                select distinct bill_no, bill_type, appe_time
+                from ints_wait_matin
+                where 1=1
+                <include refid="condition"></include>
+            ) r
         ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
     </select>
 
     <select id="getHeadPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
         select count(1) from
         (
-        select distinct bill_no, bill_type, appe_time,
-        ROW_NUMBER() over (order by appe_time) as row
-        from ints_wait_matin
-        <include refid="condition"></include>
+            select *,
+            ROW_NUMBER() over (order by appe_time desc) as row
+            from (
+                select distinct bill_no, bill_type, appe_time
+                from ints_wait_matin
+                where 1=1
+                <include refid="condition"></include>
+            ) r
         ) t
     </select>
 

--
Gitblit v1.9.1