select `year`,`date`,IFNULL(sum(`total_amount`-`order_refund_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_received_statistics` where 1=1
select `year`,`month`,IFNULL(sum(`total_amount`-`order_refund_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_received_statistics` where 1=1
select `year`,`week_of_year`,IFNULL(sum(`total_amount`-`order_refund_amount`),0) as `totalAmount`,IFNULL(sum(`total_quantity`),0) as `totalQuantity` from `order_received_statistics` where 1=1
select `date`,(`total_amount`+`deposit_amount`+`no_deductible_amount`) as `totalAmount`,`total_quantity` as `totalQuantity`,(`rent_vehicle_amount`+`deposit_amount`+`no_deductible_amount`) as `rentVehicleAmount`,`rent_vehicle_quantity` as `rentVehicleQuantity`,
`company_id` as `companyId`,`pay_way` as `payWay`,`company_name` as `companyName` from `order_received_statistics` where `has_pay`=1
select `id` as `compnayId`,`name` as `companyName`,`zone_id` as `areaId`,`area`.name as `areaName` from `branch_company` as `bc` inner join `area` on bc.zone_id=area.id