From a87b4573c7f4e8aa2ae52cc1fe9ccd2d2d44482d Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Sat, 11 Jul 2020 17:55:15 +0800
Subject: [PATCH] modify

---
 src/main/resources/mapper/modules/AgentReturnDao.xml |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mapper/modules/AgentReturnDao.xml b/src/main/resources/mapper/modules/AgentReturnDao.xml
index 17d214c..1126df7 100644
--- a/src/main/resources/mapper/modules/AgentReturnDao.xml
+++ b/src/main/resources/mapper/modules/AgentReturnDao.xml
@@ -5,12 +5,34 @@
     <select id="selectAgentReturnList" resultType="com.xcong.excoin.modules.contract.entity.AgentReturnEntity">
         select
             CONCAT(b.first_name, b.second_name) account,
+            a.closing_fee_amount*(select fee_spread_ratio from platform_trade_setting) closing_fee_amount,
+            a.opening_fee_amount*(select fee_spread_ratio from platform_trade_setting) opening_fee_amount,
             a.*,
             c.phone,
             c.email
-        from kss_framework.agent_return a
+        from agent_return a
         left join member_authentication b on a.member_id=b.member_id
-        left join member c on a.member_id=c.id
-        where invite_id=#{record.inviteId}
+        inner join member c on a.member_id=c.id
+        <where>
+            <if test="record.inviteId!='rxadr3'">
+               and a.invite_id=#{record.inviteId}
+            </if>
+            <if test='record.timeType=="1"'>
+                and TO_DAYS(a.create_time) = TO_DAYS(NOW())
+            </if>
+            <if test='record.timeType=="2"'>
+                and TO_DAYS(NOW()) - TO_DAYS(a.create_time) = 1
+            </if>
+            <if test='record.timeType=="3"'>
+                and YEARWEEK(date_format(a.create_time,'%Y-%m-%d')) = YEARWEEK(now())
+            </if>
+            <if test='record.timeType=="4"'>
+                and DATE_FORMAT(a.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' )
+            </if>
+            <if test='record.account!=null and record.account!=""'>
+                and (c.phone=#{record.account} or c.email=#{record.account} or c.invite_id=#{record.account})
+            </if>
+        </where>
+        order by create_time desc
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1