"(select count(1) from ecw_customer_follow l where l.biz_id = o.offer_id and l.follow_type = 4) as log_count, ",
"(select count(1) from ecw_customer_followup l where l.offer_id = o.offer_id) as log_count, ",
"u.nickname as creator_name, ",
"u.nickname as creator_name, ",
"(SELECT cc.`name` FROM ecw_customer_contacts cc WHERE ( o.relation = 1 AND cc.id = o.consignor_id ) OR ( o.relation = 2 AND cc.id = o.consignee_id)) AS relation_name ",
"u.nickname as business_manager_name, ",
// "(SELECT cc.`name` FROM ecw_customer_contacts cc WHERE ( o.relation = 1 AND cc.id = o.consignor_id ) OR ( o.relation = 2 AND cc.id = o.consignee_id)) AS relation_name ",
"cc.name as relation_name, ",
"cc.area_code as relation_area_code, ",
"cc.phone_new as relation_phone, ",
"line.start_warehouse_id, ",
"line.dest_warehouse_id, ",
"line.transport_type ",
"from ecw_offer o ",
"from ecw_offer o ",
// "left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"left join system_user u on u.id = o.follow_up_salesman_id ",
"left join system_user u on u.id = o.follow_up_salesman_id ",
"left join ecw_region s on o.objective_id = s.id ",
"left join ecw_warehouse_line line on o.line_id = line.id ",
"left join ecw_warehouse dst on line.dest_warehouse_id = dst.id ",
"where o.deleted = 0",
"where o.deleted = 0",
//destCountryIds
"<when test = 'pageVO.destCountryIds != null and pageVO.destCountryIds.size() > 0'>",