From 21fee5d76f3af3da1c379599ed3f68c534b869e6 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 13 May 2025 14:42:04 +0800
Subject: [PATCH] feat(mall): 新增我的推广相关功能

---
 src/main/resources/mapper/modules/MallMemberMapper.xml |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/modules/MallMemberMapper.xml b/src/main/resources/mapper/modules/MallMemberMapper.xml
index 307315a..f5daff9 100644
--- a/src/main/resources/mapper/modules/MallMemberMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -492,4 +492,73 @@
         where id = #{id}
     </update>
 
+
+
+    <select id="selectTeamPage" resultType="cc.mrbird.febs.mall.vo.sale.ApiTeamListInfoVo">
+
+        SELECT
+                a.name memberName,
+                a.CREATED_TIME createdTime,
+                (
+                    SELECT
+                    count(c.id)
+                    FROM
+                    mall_order_info c
+                    where a.id = c.member_id
+                    AND c.STATUS = 4
+                ) orderCnt,
+                ifnull(
+                    (
+                        SELECT
+                            sum(b.amount)
+                        FROM
+                            mall_order_info b
+                        where a.id = b.member_id
+                        AND b.STATUS = 4
+                    ),
+                0) amount
+        FROM mall_member a
+        <where>
+            and find_in_set(#{record.inviteId}, a.referrer_ids)
+            <if test="record != null" >
+                <if test="record.startTime != null and record.startTime != ''">
+                    and a.CREATED_TIME &gt;= #{record.startTime}
+                </if>
+                <if test="record.endTime != null and record.endTime != ''">
+                    and a.CREATED_TIME &lt;= #{record.endTime}
+                </if>
+            </if>
+        </where>
+        order by a.CREATED_TIME desc
+    </select>
+
+
+
+    <select id="selectSalePage" resultType="cc.mrbird.febs.mall.vo.sale.ApiSaleListInfoVo">
+        SELECT
+            (
+                SELECT
+                c.order_no
+                FROM
+                mall_order_info c
+                where a.order_id = c.id
+            ) orderNo,
+            a.CREATED_TIME createdTime,
+            a.cost_amount costAmount,
+            a.amount amount
+        FROM mall_achieve_record a
+        <where>
+            and a.member_id = #{record.memberId}
+            <if test="record != null" >
+                <if test="record.startTime != null and record.startTime != ''">
+                    and a.CREATED_TIME &gt;= #{record.startTime}
+                </if>
+                <if test="record.endTime != null and record.endTime != ''">
+                    and a.CREATED_TIME &lt;= #{record.endTime}
+                </if>
+            </if>
+        </where>
+        order by a.CREATED_TIME desc
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1