From 314fda70e41cf22b5abafaf86b08b8e8bf8c2d7d Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Thu, 08 May 2025 11:55:59 +0800
Subject: [PATCH] refactor(mall): 重构会员管理系统

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

diff --git a/src/main/resources/mapper/modules/MallMemberMapper.xml b/src/main/resources/mapper/modules/MallMemberMapper.xml
index 91ea9a7..7cf3420 100644
--- a/src/main/resources/mapper/modules/MallMemberMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -11,8 +11,8 @@
         left join mall_vip_config vipConfig on m.level = vipConfig.code
         <where>
             <if test="record != null" >
-                <if test="record.birthday!=null">
-                    and m.birthday = #{record.birthday}
+                <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},'%')
@@ -24,6 +24,47 @@
                         or m.bind_phone like concat('%',  #{record.account},'%')
                         or m.invite_id like concat('%',  #{record.account},'%')
                         )
+                </if>
+                <if test="record.accountStatus!=null">
+                    and m.account_status = #{record.accountStatus}
+                </if>
+                <if test="record.accountType != null" >
+                    and m.account_type = #{record.accountType}
+                </if>
+                <if test="record.level!=null and record.level!=''">
+                    and m.level=#{record.level}
+                </if>
+                <if test="record.isSale!=null and record.isSale!=''">
+                    and m.is_sale=#{record.isSale}
+                </if>
+            </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(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>
+                <if test="record.account!=null and record.account!=''">
+                    and (
+                    m.phone like concat('%',  #{record.account},'%')
+                    or m.email like concat('%',  #{record.account},'%')
+                    or m.bind_phone like concat('%',  #{record.account},'%')
+                    or m.invite_id like concat('%',  #{record.account},'%')
+                    )
                 </if>
                 <if test="record.accountStatus!=null">
                     and m.account_status = #{record.accountStatus}
@@ -442,4 +483,12 @@
         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