From ff030a19308da2f20f141024638e66f42e0a6fbc Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Thu, 22 Jul 2021 10:30:46 +0800
Subject: [PATCH] fix
---
gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml b/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml
index e796b6d..dac82a6 100644
--- a/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml
+++ b/gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml
@@ -43,4 +43,32 @@
group by a.id
order by a.receiving_time desc, a.id desc
</select>
+
+ <select id="selectOrderStatusCount" resultType="com.xzx.gc.order.vo.JhyStatusCountVo">
+ select
+ status,
+ count(1) cnt
+ 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>
+ <if test="type == 1">
+ and jhy_id=#{userId}
+ </if>
+ <if test="type == 2" >
+ and user_id=#{userId}
+ </if>
+ </where>
+ group by status
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1