| @@ -535,17 +535,11 @@ | |||||
| <select id="queryOrderForSum" resultType="Long" parameterType="hashmap"> | <select id="queryOrderForSum" resultType="Long" parameterType="hashmap"> | ||||
| select ifnull(sum(o.payment),0) payment from ( | select ifnull(sum(o.payment),0) payment from ( | ||||
| select o.*,m.`name` merchantName from ( | |||||
| select o.*,cm.merchant_id from wx_order o | |||||
| left join wx_coupon_merchant cm on o.product_id=cm.product_id | |||||
| where o.type = 0 and o.order_status = #{order_status}) o | |||||
| left join wx_merchant m on o.merchant_id=m.id | |||||
| select o.* from wx_order o | |||||
| where o.type = 0 and o.order_status = #{order_status} | |||||
| union all | union all | ||||
| select o.*,m.`name` merchantName from ( | |||||
| select o.*,mbu.merchant_id from wx_order o | |||||
| left join wx_merchant_b_user mbu on o.product_id=mbu.id | |||||
| where o.type in (1,2) and o.order_status = #{order_status}) o | |||||
| left join wx_merchant m on o.merchant_id=m.id | |||||
| select o.* from wx_order o | |||||
| where o.type in (1,2) and o.order_status = #{order_status} | |||||
| ) o | ) o | ||||
| <where> | <where> | ||||
| <if test="tenantId!=null"> | <if test="tenantId!=null"> | ||||