|
|
|
@@ -335,7 +335,9 @@ |
|
|
|
<sql id="allAdminCouponOrderListColumns"> |
|
|
|
co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, |
|
|
|
c.title,c.sale_price,c.use_price,c.price,c.unit, |
|
|
|
m.name as merchant_name |
|
|
|
(case when com.mc=1 then |
|
|
|
(select m.name from wx_merchant m, wx_coupon_merchant cm |
|
|
|
where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) as merchant_name |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="allAdminCouponOrderDetailColumns"> |
|
|
|
@@ -348,20 +350,16 @@ |
|
|
|
|
|
|
|
<select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> |
|
|
|
select <include refid="allAdminCouponOrderListColumns" /> |
|
|
|
from wx_coupon_merchant cm, |
|
|
|
(select tco.id as tcoid, |
|
|
|
(select count(*) from wx_coupon_merchant tcm |
|
|
|
where tcm.product_id = tco.coupon_id) as mc |
|
|
|
from wx_coupon_order tco) com, |
|
|
|
from |
|
|
|
wx_coupon_order co, |
|
|
|
wx_coupon c, |
|
|
|
wx_merchant m, |
|
|
|
wx_coupon_order co |
|
|
|
where com.mc = 1 |
|
|
|
and com.tcoid = co.id |
|
|
|
and cm.product_id = c.id |
|
|
|
and cm.status = 0 |
|
|
|
(select tco.id as tcoid, |
|
|
|
(select count(*) from wx_coupon_merchant tcm |
|
|
|
where tcm.product_id = tco.coupon_id |
|
|
|
and tcm.status = 0) as mc |
|
|
|
from wx_coupon_order tco) com |
|
|
|
where com.tcoid = co.id |
|
|
|
and c.id = co.coupon_id |
|
|
|
and m.id = cm.merchant_id |
|
|
|
<if test=" null != tenantId "> |
|
|
|
and co.tenant_id = #{tenantId} |
|
|
|
</if> |
|
|
|
@@ -371,7 +369,10 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != merchantName "> |
|
|
|
and m.name like concat('%', #{merchantName},'%') |
|
|
|
and (case when com.mc=1 then |
|
|
|
(select m.name from wx_merchant m, wx_coupon_merchant cm |
|
|
|
where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) |
|
|
|
like concat('%', #{merchantName},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="startDate != null"> |
|
|
|
|