select bo.*,omd.memberLevel from (select `id`,`type`,`status`,`order_amount` AS `orderAmount`, `real_amount`AS
select bo.*,omd.memberLevel,IFNULL(orvd.start_company_id,otd.start_company_id) AS `companyId` from (select `id`,`type`,`status`,`order_amount` AS `orderAmount`, `real_amount`AS
`realAmount`,`order_origin` AS `orderOrigin`,
`realAmount`,`order_origin` AS `orderOrigin`,
`pay_way` AS `payWay`,`crt_time`AS `crtTime`
`pay_way` AS `payWay`,`crt_time`AS `crtTime`
from `base_order` where `has_pay`=1 and `crt_time` between #{startDate} and #{endDate} and `type` IN <foreachcollection="types"
from `base_order` where `has_pay`=1 and `crt_time` between #{startDate} and #{endDate} and `type` IN <foreachcollection="types"