SELECT
id,
member_id memberId,
trade_id tradeId,
trade_member_id tradeMemberId,
total_principal totalPrincipal,
is_follow isFollow,
total_profit totalProfit
FROM
follow_follower_profit
WHERE
trade_member_id = #{tradeMemberId}
and is_follow = 1
order by create_time desc
SELECT
*
FROM
follow_follower_profit
WHERE
member_id = #{memberId}
and is_follow = 1
order by create_time desc
SELECT
*
FROM
follow_follower_profit
WHERE
trade_member_id = #{memberId}
and is_follow = 1
order by create_time desc
SELECT
*
FROM
contract_order
WHERE
member_id = #{memberId}
and contract_type = 2
and order_type in (3,4)
and closing_type not in (4,5)
order by create_time desc
SELECT
*
FROM
contract_hold_order
WHERE
member_id = #{memberId}
and contract_type = 2
order by create_time desc
SELECT
*
FROM
contract_hold_order
WHERE
member_id = #{memberId}
and contract_type = 2
order by opening_time desc
SELECT
*
FROM
follow_follower_profit
WHERE
member_id = #{memberId}
and trade_id = #{traderId}
update follow_follower_profit
set total_principal=total_principal+#{principal},
total_profit=total_profit+#{profit}
where trade_member_id=#{tradeMemberId} and member_id=#{memberId}
select count(1) from follow_follower_profit
where trade_member_id=#{tradeMemberId}
select sum(total_profit)
from follow_follower_profit
where trade_member_id=#{tradeMemberId}