| | |
| | | order by c.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectHistoryDocumentaryListInPage" resultType="com.xcong.excoin.modules.contract.entity.ContractOrderEntity"> |
| | | select |
| | | a.phone, |
| | | a.email, |
| | | a.referer_id, |
| | | concat(b.first_name, b.second_name) name, |
| | | c.opening_fee_amount*(select fee_spread_ratio from platform_trade_setting) opening_fee_amount, |
| | | c.closing_fee_amount*(select fee_spread_ratio from platform_trade_setting) closing_fee_amount, |
| | | c.* |
| | | from member a |
| | | left join member_authentication b on a.id=b.member_id |
| | | inner join contract_order c on a.id=c.member_id |
| | | <where> |
| | | <if test="record!=null"> |
| | | <if test="record.refererIds!=null and record.refererIds!=''"> |
| | | and a.invite_id=#{record.refererIds} |
| | | </if> |
| | | <if test="record.name!=null and record.name!=''"> |
| | | and (a.phone=#{record.name} or a.email=#{record.name} or a.invite_id=#{record.name}) |
| | | </if> |
| | | <if test='record.timeType=="1"'> |
| | | and TO_DAYS(c.create_time) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test='record.timeType=="2"'> |
| | | and TO_DAYS(NOW()) - TO_DAYS(c.create_time) = 1 |
| | | </if> |
| | | <if test='record.timeType=="3"'> |
| | | and YEARWEEK(date_format(c.create_time,'%Y-%m-%d')) = YEARWEEK(now()) |
| | | </if> |
| | | <if test='record.timeType=="4"'> |
| | | and DATE_FORMAT(c.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' ) |
| | | </if> |
| | | and c.order_status = 1 |
| | | and c.contract_type = 2 |
| | | and c.closing_time is not null |
| | | </if> |
| | | </where> |
| | | order by c.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectHistoryDocumentaryprofitListInPage" resultType="com.xcong.excoin.modules.contract.entity.ContractOrderEntity"> |
| | | select |
| | | a.phone, |
| | | a.email, |
| | | a.referer_id, |
| | | concat(b.first_name, b.second_name) name, |
| | | c.opening_fee_amount*(select fee_spread_ratio from platform_trade_setting) opening_fee_amount, |
| | | c.closing_fee_amount*(select fee_spread_ratio from platform_trade_setting) closing_fee_amount, |
| | | c.*, |
| | | d.amount rewardAmountProfit |
| | | from member a |
| | | left join member_authentication b on a.id=b.member_id |
| | | inner join contract_order c on a.id=c.member_id |
| | | left join follow_trader_profit_detail d on d.order_no = c.order_no |
| | | where |
| | | c.id in ( |
| | | <foreach collection="record.IDs" item="Ids" separator=","> |
| | | #{Ids} |
| | | </foreach> |
| | | ) |
| | | order by d.amount desc |
| | | </select> |
| | | |
| | | <select id="selectFollowContractIdList" resultType="long"> |
| | | SELECT |
| | | order_id |
| | | FROM |
| | | follow_follower_order_relation |
| | | WHERE |
| | | order_type = 2 |
| | | and trade_order_no = #{orderNoTrade} |
| | | and member_id != trade_member_id |
| | | </select> |
| | | |
| | | </mapper> |