/* 所有配资用户的运营数据 */SELECT F.client_id, U.language, U.country_code, FROM_UNIXTIME(U.register_time/1000,('%Y-%m-%d %H:%i:%S')) AS register_time, F.fund_value, T.total_deposit AS 'deposit',T.times_deposit AS 'times_d',T.total_withdraw AS 'withdraw', T.times_withdraw AS 'times_w', A.margin_balance/100000000 AS margin_balance, (A.margin_balance/100000000 - T.total_deposit - F.fund_value + T.total_withdraw) AS PNL, TRADE.volume, TRADE.netFee,IF(A.margin_balance/100000000<0.095,0.095-A.margin_balance/100000000,0)AS ex_loss, FROM_UNIXTIME(F.insert_time/1000+28800,'%Y-%m-%d %H:%i:%S') AS 'datetimeOfGet0.1'FROM management.`t_with_funding` AS FLEFT JOIN management.t_trade_user U ON F.client_id = U.USER_IDLEFT JOIN ( SELECT USER_ID, transaction_type, count(if(transaction_type='1',true,null)) as 'times_deposit', count(if(transaction_type='2',true,null)) as 'times_withdraw', SUM(IF(transaction_type='1',amount/100000000,0)) AS 'total_deposit', SUM(IF(transaction_type='2',amount/100000000,0)) AS 'total_withdraw' FROM management.t_wallet_transaction_history WHERE transaction_type IN ('1','2') GROUP BY USER_ID) AS T ON F.client_id = T.USER_ID LEFT JOIN `t_account` as AON F.client_id = A.client_idLEFT JOIN (SELECT client_id, SUM(taker_fee/1e8 - ABS(maker_fee/1e8)) AS netFee, SUM(trade_volume)AS volume FROM affiliate.t_daily_trade GROUP BY client_id ) AS TRADEON TRADE.client_id = F.client_idWHERE F.fund_value>0 AND F.client_id <> '8949355047' AND register_time> unix_timestamp('2020-03-24 12:00:00')*1000