|
|
|
@@ -413,17 +413,27 @@ |
|
|
|
<select id="findListOrder" resultMap="orderMap" parameterType="com.iformall.domain.vo.WxOrderQueryVo"> |
|
|
|
|
|
|
|
select o.* from ( |
|
|
|
select o.*,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone from ( |
|
|
|
select o.*,cm.merchant_id from wx_order o |
|
|
|
left join wx_coupon_merchant cm on o.product_id=cm.product_id |
|
|
|
where type in (0,3)) o |
|
|
|
left join wx_merchant m on o.merchant_id=m.id |
|
|
|
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time, |
|
|
|
o.order_status,o.create_date,o.update_date,o.detail,'多商户' merchant_name,cubi.`name` c_user_name,cubi.phone from |
|
|
|
( |
|
|
|
select o.* from wx_order o where o.type in (0,3) and o.id in( |
|
|
|
select o.id from wx_order o left join wx_coupon_merchant cm |
|
|
|
on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o |
|
|
|
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id |
|
|
|
union all |
|
|
|
select o.*,m.`name` merchantName,cubi.`name` c_user_name,cubi.phone from ( |
|
|
|
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time, |
|
|
|
o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone |
|
|
|
from( |
|
|
|
select o.*,cm.merchant_id from ( |
|
|
|
select o.* from wx_order o where o.type in (0,3) and o.id not in( |
|
|
|
select o.id from wx_order o left join wx_coupon_merchant cm |
|
|
|
on o.product_id=cm.product_id group by o.id having count(o.id)>1) |
|
|
|
) o |
|
|
|
left join wx_coupon_merchant cm on o.product_id=cm.product_id |
|
|
|
union all |
|
|
|
select o.*,mbu.merchant_id from wx_order o |
|
|
|
left join wx_merchant_b_user mbu on o.product_id=mbu.id |
|
|
|
where type in (1,2)) o |
|
|
|
where type in (1,2))o |
|
|
|
left join wx_merchant m on o.merchant_id=m.id |
|
|
|
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id |
|
|
|
) o |
|
|
|
|