From e84072e09a70e0795e464c91c7a81c91d205f29b Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 07 Jul 2020 20:19:51 +0800
Subject: [PATCH] modify

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

diff --git a/src/main/resources/mapper/modules/CoinMapper.xml b/src/main/resources/mapper/modules/CoinMapper.xml
index 4b363a2..f6ce48b 100644
--- a/src/main/resources/mapper/modules/CoinMapper.xml
+++ b/src/main/resources/mapper/modules/CoinMapper.xml
@@ -16,6 +16,9 @@
             from member a
             inner join member_quick_buy_sale b on a.id=b.member_id and b.order_type='B'
             where find_in_set(#{record.refererId}, a.referer_ids)
+            <if test="record.account!=null and record.account!=''">
+                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
+            </if>
             union
             select
                 a.invite_id inviteId,
@@ -29,6 +32,46 @@
             from member a
             inner join member_coin_charge b on a.id=b.member_id and b.status=2
             where find_in_set(#{record.refererId}, a.referer_ids)
+            <if test="record.account!=null and record.account!=''">
+                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
+            </if>
+            ) x
+        order by createTime desc
+    </select>
+
+    <select id="selectSaleList" resultType="com.xcong.excoin.modules.contract.vo.CoinVo">
+        select * from (
+            select
+                a.invite_id inviteId,
+                a.phone phone,
+                a.email email,
+                b.amount_usdt usdtAmount,
+                null coinAmount,
+                b.order_no orderNo,
+                'USDT' symbol,
+                b.create_time createTime
+            from member a
+            inner join member_quick_buy_sale b on a.id=b.member_id and b.order_type='S'
+            where find_in_set(#{record.refererId}, a.referer_ids)
+            <if test="record.account!=null and record.account!=''">
+                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
+            </if>
+            union
+            select
+                a.invite_id inviteId,
+                a.phone phone,
+                a.email email,
+                null usdtAmount,
+                b.amount coinAmount,
+                '' orderNo,
+                b.symbol symbol,
+                b.create_time createTime
+            from member a
+            inner join member_coin_withdraw b on a.id=b.member_id and b.status=2
+            where find_in_set(#{record.refererId}, a.referer_ids)
+            <if test="record.account!=null and record.account!=''">
+                and (a.phone=#{record.account} or a.email=#{record.account} or a.invite_id=#{record.account})
+            </if>
             ) x
         order by createTime desc
     </select>

--
Gitblit v1.9.1