| | |
| | | CAST(SUM(service_charge-coupon_discount_amount) AS DECIMAL(20, 6)) as servicecharge, |
| | | CAST(SUM(charging_capacity) AS DECIMAL(20, 6)) as electrovalence, |
| | | CAST(SUM(electrovalence) AS DECIMAL(20, 4)) AS paymentAmount, |
| | | SUM(payment_amount) AS paymoney, |
| | | count(1) as orderCount |
| | | FROM |
| | | t_charging_order |
| | |
| | | LEFT JOIN `charging_pile_service`.`t_charging_gun` tc on co.charging_gun_id = tc.id |
| | | LEFT JOIN `charging_pile_service`.`t_charging_pile` cp on tc.charging_pile_id = cp.id |
| | | WHERE |
| | | co.start_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 1 |
| | | co.start_time IS NOT NULL AND co.end_time IS NOT NULL and tc.type = 4 |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and co.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |
| | |
| | | LEFT JOIN `charging_pile_service`.`t_charging_gun` tc on co.charging_gun_id = tc.id |
| | | LEFT JOIN `charging_pile_service`.`t_charging_pile` cp on tc.charging_pile_id = cp.id |
| | | WHERE |
| | | co.start_time IS NOT NULL AND co.end_time IS NOT NULL and cp.type = 2 |
| | | co.start_time IS NOT NULL AND co.end_time IS NOT NULL and tc.type in (2,3) |
| | | <if test="siteIds != null and siteIds.size() > 0"> |
| | | and co.site_id IN |
| | | <foreach collection="siteIds" item="siteId" open="(" separator="," close=")"> |