id, code, order_type, order_classification, app_user_id, app_user_car_id,site_id, parking_lot_id, charging_pile_id, charging_gun_id, start_time, end_time, status, recharge_amount, recharge_payment_type, recharge_payment_status, pay_method, balance_pay_amount, third_pay_amount, balance_refund_amount, third_refund_amount, recharge_serial_number, order_amount, app_coupon_id, coupon_discount_amount, is_whitelist, whitelist_id, whitelist_benefit_type, whitelist_discount_amount, whitelist_electric_refund_amount, whitelist_service_refund_amount, vip_discount, vip_discount_amount, payment_amount, refund_code, refund_amount, refund_status, refund_serial_number, refund_time, create_time, del_flag,need_elec,total_electricity where t1.del_flag = 0 and t1.code LIKE CONCAT('%',#{req.code},'%') and t1.app_user_id in #{item} and t1.site_id in #{item} and t1.order_type = #{req.orderType} and t1.status = #{req.status} and (t1.order_source = 0 or t1.order_source = 1 ) and t1.tripartite_platform_name = 'KuaiDian' and t1.tripartite_platform_name = 'XinDianTu' and t1.is_whitelist = #{req.isWhitelist} and t1.recharge_payment_type = 1 and t1.recharge_payment_type in (2, 3) and t1.pay_method in (1, 2) and t1.site_id = #{req.siteId} and t1.charging_pile_id = #{req.pileId} and t1.charging_gun_id = #{req.gunId} and (t1.pay_time between #{startTime1} and #{startTime2}) and (t1.end_time between #{endTime1} and #{endTime2}) where b.del_flag = 0 and b.recharge_payment_status = 2 and b.start_time IS NOT NULL and b.end_time is not null and b.code LIKE CONCAT('%',#{req.code},'%') and b.app_user_id in #{item} and app_user.phone LIKE CONCAT('%',#{req.phone},'%') and b.site_id in #{item} and b.order_type = #{req.orderType} and b.status = #{req.status} and (b.order_source = 0 or b.order_source = 1 ) and b.tripartite_platform_name = 'KuaiDian' and b.tripartite_platform_name = 'XinDianTu' and b.is_whitelist = #{req.isWhitelist} and b.recharge_payment_type = 1 and b.recharge_payment_type in (2, 3) and b.pay_method in (1, 2) and b.site_id = #{req.siteId} and b.charging_pile_id = #{req.pileId} and b.charging_gun_id = #{req.gunId} and (b.pay_time between #{startTime1} and #{startTime2}) and (b.end_time between #{endTime1} and #{endTime2}) co.id IN #{orderId} AND s.site_type = #{data.siteType} AND s.partner_id = #{data.partnerId} AND co.site_id = #{data.siteId} AND co.create_time >= #{data.createTime1} AND co.create_time <= #{data.createTime2} AND co.code LIKE CONCAT('%', #{data.code}, '%') AND co.order_type = #{data.orderType} AND au.phone LIKE CONCAT('%', #{data.phone}, '%') AND co.status = #{data.status} AND p.name LIKE CONCAT('%', #{data.partnerName}, '%') AND co.order_source = #{data.orderSource} AND co.start_time >= #{data.startTime1} AND co.start_time <= #{data.startTime2} AND co.end_time >= #{data.endTime1} AND co.end_time <= #{data.endTime2} SELECT co.id, co.code, co.order_type AS orderType, co.order_classification AS orderClassification, s.name AS siteName, CONCAT(IFNULL(cp.name, ''), IFNULL(cg.name, '')) AS terminalName, co.status, (UNIX_TIMESTAMP(co.end_time) - UNIX_TIMESTAMP(co.start_time)) AS chargingSecond, co.recharge_amount AS totalAmount, IFNULL(co.coupon_discount_amount, 0) AS couponDiscountAmount, IFNULL(co.vip_discount_amount, 0) AS vipDiscountAmount, co.payment_amount AS paymentAmount, IFNULL(co.refund_amount, 0) AS refundAmount, co.order_source AS orderSource, p.name AS partnerName, au.phone AS phone, car.license_plate AS licensePlate, co.charging_capacity AS chargingCapacity, co.end_mode AS endMode, co.create_time AS createTime, co.start_time AS startTime, co.end_time AS endTime, co.pay_time AS payTime FROM t_charging_order co LEFT JOIN charging_pile_service.t_site s ON s.id = co.site_id LEFT JOIN charging_pile_service.t_partner p ON p.id = s.partner_id LEFT JOIN charging_pile_service.t_charging_pile cp ON cp.id = co.charging_pile_id LEFT JOIN charging_pile_service.t_charging_gun cg ON cg.id = co.charging_gun_id LEFT JOIN charging_pile_account.t_app_user au ON au.id = co.app_user_id LEFT JOIN charging_pile_account.t_app_user_car car ON car.id = co.app_user_car_id INSERT IGNORE INTO t_large_screen_user_site (site_id, app_user_id) VALUES (#{row.siteId}, #{row.appUserId}) REPLACE INTO t_large_screen_site_stat (stat_type, period, site_id, order_count, user_count, capacity, electric_fee, service_fee, income, total_power, registered_user_count, update_time) VALUES (#{row.statType}, #{row.period}, #{row.siteId}, #{row.orderCount}, #{row.userCount}, #{row.capacity}, #{row.electricFee}, #{row.serviceFee}, #{row.income}, #{row.totalPower}, #{row.registeredUserCount}, NOW())