| @@ -335,7 +335,9 @@ | |||||
| <sql id="allAdminCouponOrderListColumns"> | <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, | 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, | 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> | ||||
| <sql id="allAdminCouponOrderDetailColumns"> | <sql id="allAdminCouponOrderDetailColumns"> | ||||
| @@ -348,20 +350,16 @@ | |||||
| <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> | <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> | ||||
| select <include refid="allAdminCouponOrderListColumns" /> | 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_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 c.id = co.coupon_id | ||||
| and m.id = cm.merchant_id | |||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and co.tenant_id = #{tenantId} | and co.tenant_id = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -371,7 +369,10 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != merchantName "> | <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> | ||||
| <if test="startDate != null"> | <if test="startDate != null"> | ||||