|  |  |  | 
|---|
|  |  |  | on oi.order_id=o.id | 
|---|
|  |  |  | where oi.status in ('abnormal','reduce','lack','back') | 
|---|
|  |  |  | and  o.transfer_id is null | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND') | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND','RECEIVE') | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | on oi.order_id=o.id | 
|---|
|  |  |  | where oi.status in ('abnormal','reduce','lack','back') | 
|---|
|  |  |  | and  o.transfer_id is null | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND') | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND','RECEIVE') | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectOrderExportList" resultType="com.mzl.flower.dto.response.payment.OrderListExportDTO"> | 
|---|
|  |  |  | SELECT q.order_no,q.create_time,q.customer,q.customer_tel,q.total_amount,q.status_backend,q.partner_name,q.warehouse_location_code,q.remarks, | 
|---|
|  |  |  | SELECT q.order_no,q.create_time,q.customer,q.customer_tel,q.total_amount,q.status_backend,q.partner_name,q.warehouse_location_code,q.remarks,q.logistics_company_code, | 
|---|
|  |  |  | u.nick_name createName , | 
|---|
|  |  |  | code.label as statusBackendStr, | 
|---|
|  |  |  | code2.label as specialNeedsStr, | 
|---|
|  |  |  | 
|---|
|  |  |  | on oi.order_id=o.id | 
|---|
|  |  |  | where oi.status in ('abnormal','reduce','lack','back') | 
|---|
|  |  |  | and  o.transfer_id is null | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND') | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND','RECEIVE') | 
|---|
|  |  |  | ) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | union | 
|---|
|  |  |  | 
|---|
|  |  |  | on oi.order_id=o.id | 
|---|
|  |  |  | where oi.status in ('abnormal','reduce','lack','back') | 
|---|
|  |  |  | and  o.transfer_id is null | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND') | 
|---|
|  |  |  | and o.status in ('COLLECTION','SEND','RECEIVE') | 
|---|
|  |  |  | ) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </select> | 
|---|