varsql=$@"select t1.bailun_sku,t1.platform_type,sum(t1.bailun_sku_quantity_ordered) bailun_sku_quantity_ordered,sum(t2.bailun_sku_quantity_refund) bailun_sku_quantity_refund from dc_base_oms_sku t1
left join dc_base_crm_refund t2 on t1.origin_order_id=t2.origin_order_id and t1.bailun_sku=t2.bailun_sku and t2.is_deleted=0 and t2.is_freeze=0
where t1.bailun_order_status!='Canceled' and t1.has_cancle=0 and t1.has_delete=0 and t1.has_scalp=0 and t1.has_innersale=0 and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA')
varsql=$@"select t1.platform_type,t1.item_id,sum(t1.platform_sku_quantity_ordered) platform_sku_quantity_ordered from dc_base_oms_platform_sku t1 where t1.bailun_order_status!='Canceled' and t1.has_cancle=0 and t1.has_delete=0 and t1.has_scalp=0 and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA')