From 9fb1a68d11a8928f2ba602dd68dc00d19ca7429f Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Tue, 27 Feb 2024 15:47:57 +0800
Subject: [PATCH] 抽奖

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

diff --git a/src/main/resources/mapper/modules/MallMemberMapper.xml b/src/main/resources/mapper/modules/MallMemberMapper.xml
index f0ab081..e3d9b98 100644
--- a/src/main/resources/mapper/modules/MallMemberMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -5,7 +5,7 @@
     <select id="selectMallMemberListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember">
         SELECT
                m.*,
-               a.name referrerName,
+               a.account_login referrerName,
                IFNULL(c.balance,0) balance,
                IFNULL(c.score,0) score,
                IFNULL(c.prize_score,0) prizeScore,
@@ -14,7 +14,14 @@
                IFNULL(c.total_score,0) totalScore,
                IFNULL(c.voucher_cnt,0) voucherCnt,
                IFNULL(c.voucher_amount,0) voucherAmount,
-               d.description levelName
+               IFNULL(c.voucher_fire_cnt,0) voucherFireCnt,
+                (SELECT
+        sum(IFNULL(surplus_cnt, 0))
+        FROM
+        mall_score_record
+        WHERE
+        member_id = m.id) voucherCntSurplus,
+        d.description 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
@@ -23,6 +30,9 @@
             <if test="record != null" >
                 <if test="record.name!=null and record.name!=''">
                     and m.name like concat('%',  #{record.name},'%')
+                </if>
+                <if test="record.accountLogin!=null and record.accountLogin!=''">
+                    and m.account_login like concat('%',  #{record.accountLogin},'%')
                 </if>
                 <if test="record.account!=null and record.account!=''">
                     and (
@@ -70,7 +80,11 @@
     </select>
 
     <select id="selectInfoByAccount" resultType="cc.mrbird.febs.mall.entity.MallMember">
-        select * from mall_member where phone=#{account} or email=#{account} or invite_id=#{account}
+        select * from mall_member where phone = #{account} or email = #{account} or invite_id=#{account}
+    </select>
+
+    <select id="selectInfoByAccountNew" resultType="cc.mrbird.febs.mall.entity.MallMember">
+        select * from mall_member where phone = #{phone} and account_login = #{account}
     </select>
 
     <select id="selectInfoByInviteId" resultType="cc.mrbird.febs.mall.entity.MallMember">
@@ -84,7 +98,7 @@
     <select id="selectTeamListByInviteId" resultType="cc.mrbird.febs.mall.vo.TeamListVo">
         select
             a.id,
-            a.name,
+            a.account_login name,
             a.phone,
             a.invite_id,
             2 isCurrent,
@@ -163,6 +177,9 @@
         left join data_dictionary_custom a on a.code = m.level
         <where>
             <if test="record != null" >
+                <if test="record.accountLogin!=null and record.accountLogin!=''">
+                    and m.account_login like concat('%',  #{record.accountLogin},'%')
+                </if>
                 <if test="record.name!=null and record.name!=''">
                     and m.name like concat('%',  #{record.name},'%')
                 </if>
@@ -274,7 +291,7 @@
         SELECT a.id,d.code levelCode
         FROM mall_member a
                  LEFT JOIN data_dictionary_custom d on d.code = a.level
-        where a.id = #{id} and d.type = 'AGENT_LEVEL_REQUIRE'
+        where a.id = #{id} and d.type = 'AGENT_LEVEL'
         GROUP BY a.id
     </select>
 
@@ -445,4 +462,19 @@
             </if>
         </where>
     </select>
+
+    <select id="selectByLevel" resultType="cc.mrbird.febs.mall.entity.MallMember">
+        select * from mall_member
+        where level = #{level}
+    </select>
+
+    <select id="selectByAccountLogin" resultType="cc.mrbird.febs.mall.entity.MallMember">
+        select * from mall_member
+        where account_login = #{accountLogin}
+    </select>
+
+    <select id="selectInfoByAccountLoginAndPwd" resultType="cc.mrbird.febs.mall.entity.MallMember">
+        select * from mall_member
+        where account_login = #{accountLogin} and password = #{password}
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1