From be8a63ba1e3f2e26f5cdefe519c37ad4cfd90435 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期日, 05 十一月 2023 09:45:11 +0800
Subject: [PATCH] 11.5

---
 cloud-server-activity/src/main/resources/mapper/UserPointsMerchandiseMapper.xml |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/cloud-server-activity/src/main/resources/mapper/UserPointsMerchandiseMapper.xml b/cloud-server-activity/src/main/resources/mapper/UserPointsMerchandiseMapper.xml
index 5db81fc..bc20cc5 100644
--- a/cloud-server-activity/src/main/resources/mapper/UserPointsMerchandiseMapper.xml
+++ b/cloud-server-activity/src/main/resources/mapper/UserPointsMerchandiseMapper.xml
@@ -24,4 +24,29 @@
         left join t_points_merchandise t2 on t1.pointsMerchandiseId = t2.id
         where t1.payStatus =2
     </select>
+    <select id="getConsumeDetails" resultType="com.dsh.activity.entity.ConsumeDetail">
+
+        SELECT
+            CASE  tm.type
+                WHEN 1 THEN '实体购买'
+                WHEN 2 THEN '课包购买'
+                WHEN 3 THEN '门票购买'
+                WHEN 4 THEN '优惠券购买'
+                END AS  consumeName  ,DATE_FORMAT(pm.insertTime, '%m-%d %H:%i')as `consumeTime`,2 as type,CONCAT('-',tm.cash) as consumeAmount
+        FROM t_user_points_merchandise pm
+                 LEFT JOIN t_points_merchandise tm ON tm.id = pm.pointsMerchandiseId
+        WHERE pm.pointsMerchandiseId IN(
+            SELECT id
+            FROM t_points_merchandise WHERE redemptionMethod IN (2,3)
+
+        )
+        <if test="null != monthStart and '' != monthStart and null != monthEnd and '' != monthEnd">
+            and DATE_FORMAT(pm.insertTime, '%Y-%m-%d %H:%i:%s') between #{monthStart} and #{monthEnd}
+        </if>
+        <if test="null != appUserId and '' != appUserId ">
+            and pm.userId = #{appUserId}
+        </if>
+
+
+    </select>
 </mapper>

--
Gitblit v1.7.1