From b289b531521f3f3e67b1ca0251c75e41e51fc88f Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 16 Mar 2022 17:00:12 +0800
Subject: [PATCH] fix

---
 src/main/resources/mapper/member/MemberDao.xml |   64 ++++++++++++++++++++++++++++++-
 1 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mapper/member/MemberDao.xml b/src/main/resources/mapper/member/MemberDao.xml
index cddbacf..b3532e1 100644
--- a/src/main/resources/mapper/member/MemberDao.xml
+++ b/src/main/resources/mapper/member/MemberDao.xml
@@ -6,8 +6,66 @@
         select * from member where phone=#{account} or email=#{account}
     </select>
 
-    <select id="selectMemberInfoByRefererId" resultType="com.xcong.excoin.modules.member.entity.MemberEntity">
-        select * from member where invite_id=#{refererId}
+    <select id="selectMemberInfoByInviteId" resultType="com.xcong.excoin.modules.member.entity.MemberEntity">
+        select * from member where invite_id=#{inviteId}
     </select>
-    
+
+    <select id="selectFriendRelationUserByMemberId" parameterType="long" resultType="com.xcong.excoin.modules.member.parameter.vo.NeedMoneyMemberVo">
+        SELECT
+            t1.id memberId,
+            t1.invite_id inviteId,
+            t2.referer_id referenceId,
+            t2.return_ratio returnRatio,
+            t2.level_id levelId,
+            t2.fee_is_self feeIsSelf
+        FROM
+            member t1
+        INNER JOIN agent_friend_relation t2 ON t1.id = t2.member_id
+        WHERE
+            t1.id = #{memberId}
+        AND t2.referer_id IS NOT NULL
+    </select>
+
+    <select id="selectAllNeedMoneyMember" parameterType="map" resultType="com.xcong.excoin.modules.member.parameter.vo.NeedMoneyMemberVo">
+        SELECT
+        t1.id memberId,
+        t1.invite_id inviteId,
+        t2.referer_id referenceId,
+        t2.return_ratio returnRatio,
+        t2.level_id levelId,
+        t2.fee_is_self feeIsSelf
+        FROM
+        member t1
+        INNER JOIN agent_friend_relation t2 ON t1.id = t2.member_id
+        WHERE
+        t2.referer_id IS NOT NULL
+        AND t1.invite_id IN
+        <foreach collection = "list" item = "item"  separator=","  open = "(" close = ")" >
+            #{item}
+        </foreach >
+    </select>
+
+    <select id="selectMemberInfoByRefererId" resultType="com.xcong.excoin.modules.member.entity.MemberEntity">
+        SELECT m.* FROM member m WHERE m.referer_id = #{inviteId}
+    </select>
+
+    <select id="selectZhiYaTeamRecordByMemberId" resultType="com.xcong.excoin.modules.coin.entity.ZhiYaTeam">
+        SELECT m.* FROM zhiya_Team m WHERE m.member_id = #{memberId}
+    </select>
+
+
+    <select id="selectMemberCountByInvitedId" resultType="integer">
+        SELECT count(*) FROM member m where FIND_IN_SET(#{inviteId}, referer_ids)
+    </select>
+
+
+
+    <select id="selectAllTeamByInviteIdInPage" resultType="com.xcong.excoin.modules.member.parameter.vo.MemberTeamVo">
+        SELECT
+            ifnull(m.zhiya_cnt,0) zhiyaCnt,
+            ifnull(m.reward_cnt,0) rewardCnt,
+            ifnull((SELECT count(*) FROM member b where FIND_IN_SET(#{inviteId}, referer_ids)),0) teamCnt
+        FROM zhiya_team m where m.member_id = #{memberId}
+        order by m.create_time desc
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1