| | |
| | | <select id="chargingOrderShareIncomeByOrderIds" resultType="map"> |
| | | select |
| | | o.id as orderId, |
| | | sum(IFNULL(s.channel_pay_amount, 0) - IFNULL(s.share_amount, 0)) as platformIncome, |
| | | sum(CASE WHEN s.pay_channel = 'WHITELIST' THEN 0 |
| | | ELSE IFNULL(s.channel_pay_amount, 0) - IFNULL(s.share_amount, 0) END) as platformIncome, |
| | | sum(IFNULL(s.share_amount, 0)) as partnerIncome, |
| | | CASE WHEN o.is_whitelist = 1 AND o.status = 5 THEN IFNULL(o.whitelist_electric_refund_amount, 0) |
| | | + IFNULL(o.whitelist_service_refund_amount, 0) ELSE 0 END as whitelistRefund |
| | |
| | | |
| | | <select id="chargingOrderShareIncomeSummaryByOrderIds" resultType="map"> |
| | | select |
| | | sum(IFNULL(s.channel_pay_amount, 0) - IFNULL(s.share_amount, 0)) as platformIncomeTotal, |
| | | sum(CASE WHEN s.pay_channel = 'WHITELIST' THEN 0 |
| | | ELSE IFNULL(s.channel_pay_amount, 0) - IFNULL(s.share_amount, 0) END) as platformIncomeTotal, |
| | | sum(IFNULL(s.share_amount, 0)) as partnerIncomeTotal |
| | | from `charging_pile_order`.t_charging_order_share_record s |
| | | inner join `charging_pile_order`.t_charging_order o on o.id = s.charging_order_id |