From 01096a4ed0cfb97d6ac01b5c73f0336c6abe10d3 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 08 May 2025 16:38:58 +0800
Subject: [PATCH] feat(mall): 签到功能返回用户积分

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

diff --git a/src/main/resources/mapper/modules/MallMemberMapper.xml b/src/main/resources/mapper/modules/MallMemberMapper.xml
index e653c6b..307315a 100644
--- a/src/main/resources/mapper/modules/MallMemberMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -4,13 +4,16 @@
 
     <select id="selectMallMemberListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember">
         SELECT m.*,a.name referrerName,IFNULL(c.balance,0) balance,IFNULL(c.score,0) score,IFNULL(c.prize_score,0) prizeScore,IFNULL(c.commission,0) commission
-        ,d.description levelName
+        ,vipConfig.name levelName
         FROM mall_member m
         left join mall_member a on m.referrer_id = a.invite_id
         LEFT JOIN mall_member_wallet c on c.member_id = m.id
-        LEFT JOIN data_dictionary_custom d on d.code = m.level and type='AGENT_LEVEL'
+        left join mall_vip_config vipConfig on m.level = vipConfig.code
         <where>
             <if test="record != null" >
+                <if test="record.birthdayQuery!=null">
+                    and date_format(m.birthday, '%m-%d') = date_format(#{record.birthdayQuery}, '%m-%d')
+                </if>
                 <if test="record.name!=null and record.name!=''">
                     and m.name like concat('%',  #{record.name},'%')
                 </if>
@@ -37,6 +40,48 @@
             </if>
         </where>
         GROUP BY m.id order by m.CREATED_TIME desc
+    </select>
+
+    <select id="selectHappyMemberListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember">
+        SELECT
+               a.*,
+               b.name storeMasterName,
+               c.name directorName
+        FROM mall_member a
+        left join happy_sale_level b on b.code = a.store_master
+        left join happy_member_level c on c.code = a.director
+        <where>
+            <if test="record != null" >
+                <if test="record.birthdayQuery!=null">
+                    and date_format(a.birthday, '%m-%d') = date_format(#{record.birthdayQuery}, '%m-%d')
+                </if>
+                <if test="record.name!=null and record.name!=''">
+                    and a.name like concat('%',  #{record.name},'%')
+                </if>
+                <if test="record.phone!=null and record.phone!=''">
+                    and a.phone like concat('%',  #{record.phone},'%')
+                </if>
+                <if test="record.accountStatus!=null">
+                    and a.account_status = #{record.accountStatus}
+                </if>
+                <if test="record.director!=null">
+                    and a.director = #{record.director}
+                </if>
+                <if test="record.storeMaster!=null">
+                    and a.store_master = #{record.storeMaster}
+                </if>
+                <if test="record.accountType != null" >
+                    and a.account_type = #{record.accountType}
+                </if>
+                <if test="record.level!=null and record.level!=''">
+                    and a.level=#{record.level}
+                </if>
+                <if test="record.checkOrder!=null">
+                    and a.check_order=#{record.checkOrder}
+                </if>
+            </if>
+        </where>
+        GROUP BY a.id order by a.CREATED_TIME desc
     </select>
 
     <select id="getMallMemberInfoById" resultType="cc.mrbird.febs.mall.vo.MallMemberVo">
@@ -88,11 +133,10 @@
             (select sum(e.amount)
              from mall_order_info e
                       inner join mall_member b on e.member_id=b.ID
-                      inner join mall_order_item c on e.id = c.order_id
              where e.status in (2, 3, 4) and e.order_type=1 and (b.invite_id=a.invite_id or b.referrer_id=a.invite_id)) amount,
             (select count(1) from mall_member e
                       inner join mall_order_info b on e.id=b.member_id and b.status in (2, 3, 4)
-             where find_in_set(a.invite_id, e.referrer_ids)) orderCnt,
+             where find_in_set(a.invite_id, e.referrer_ids) or a.invite_id=e.invite_id) orderCnt,
             (select count(1) from mall_member x where find_in_set(a.invite_id, x.referrer_ids)) cnt
         from mall_member a
         where a.referrer_id=#{inviteId}
@@ -431,4 +475,21 @@
         order by m.CREATED_TIME desc
     </select>
 
+
+
+    <update id="updateReferrerId">
+        update mall_member
+        set referrer_id = '',
+            referrer_ids = ''
+        where id = #{id}
+    </update>
+
+
+
+    <update id="updateLastLoginTime">
+        update mall_member
+        set last_login_time = #{lastLoginTime}
+        where id = #{id}
+    </update>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1