From c501a7d724fefb38c99f5b1f4469b5b0833d3c95 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 09 Aug 2021 11:40:08 +0800
Subject: [PATCH] fix bug

---
 gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml b/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml
index 01997c5..6d4ef3b 100644
--- a/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml
+++ b/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml
@@ -48,13 +48,40 @@
         select
            status,
            count(1) cnt
-        from xzx_jhy_order where status=1
+        from xzx_jhy_order
+        <where>
+            status=1
+            <if test="type == 2">
+                and user_id=#{userId}
+            </if>
+        </where>
+        group by status
         union  all
         select
            status,
            count(1) cnt
         from xzx_jhy_order
-        where user_id=#{userId}
+        <where>
+            <if test="type == 1">
+                and jhy_id=#{userId}
+            </if>
+            <if test="type == 2" >
+                and user_id=#{userId}
+            </if>
+        </where>
         group by status
     </select>
+
+    <select id="selectJhyOrderListByStatus" resultType="com.xzx.gc.entity.JhyOrder">
+        select * from xzx_jhy_order
+        where user_id=#{userId} and status in
+        <foreach collection="list" index="index" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
+
+    <select id="selectJhyOrderNoWaitAndCancel" resultType="com.xzx.gc.entity.JhyOrder">
+        select * from xzx_jhy_order
+        where status not in (1, 5)
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1