| | |
| | | a.unit_amount AS "unitAmount", |
| | | a.amount_close AS "amountClose", |
| | | a.fee AS "fee", |
| | | a.funding_fee AS "fundingFee", |
| | | a.deposit AS "deposit", |
| | | a.deposit_open AS "depositOpen", |
| | | a.profit AS "profit", |
| | |
| | | </foreach> |
| | | </update> |
| | | |
| | | |
| | | <select id="sumClosedTraderOwnAggByPartyIds" resultType="com.yami.trading.bean.contract.dto.TraderOwnClosedAggDTO"> |
| | | SELECT party_id AS partyId, |
| | | COALESCE(SUM(IFNULL(profit, 0)), 0) AS closedProfitSum, |
| | | COALESCE(SUM(IFNULL(deposit_open, 0)), 0) AS closedMarginSum |
| | | FROM t_contract_order |
| | | WHERE state = 'created' |
| | | AND (follow IS NULL OR follow != 1) |
| | | AND party_id IN |
| | | <foreach collection="partyIds" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | | GROUP BY party_id |
| | | </select> |
| | | |
| | | </mapper> |