|
|
|
@@ -428,8 +428,7 @@ |
|
|
|
(select count(*) from wx_coupon_order o |
|
|
|
left join wx_coupon co on(o.`coupon_id`=co.id) |
|
|
|
left join wx_coupon_merchant cm on(cm.product_id=co.id) |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) |
|
|
|
inner join wx_merchant_b_user mb on(mb.id=c.id) |
|
|
|
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id) |
|
|
|
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
@@ -439,11 +438,10 @@ |
|
|
|
</if> |
|
|
|
) consumeCount, |
|
|
|
|
|
|
|
(select count(distinct c.id) from wx_coupon_order o |
|
|
|
(select count(distinct mb.id) from wx_coupon_order o |
|
|
|
left join wx_coupon co on(o.`coupon_id`=co.id) |
|
|
|
left join wx_coupon_merchant cm on(cm.product_id=co.id) |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) |
|
|
|
inner join wx_merchant_b_user mb on(mb.id=c.id) |
|
|
|
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id) |
|
|
|
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
@@ -456,8 +454,7 @@ |
|
|
|
IFNULL((select sum(co.price) from wx_coupon_order o |
|
|
|
left join wx_coupon co on(o.`coupon_id`=co.id) |
|
|
|
left join wx_coupon_merchant cm on(cm.product_id=co.id) |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) |
|
|
|
inner join wx_merchant_b_user mb on(mb.id=c.id) |
|
|
|
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id) |
|
|
|
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
@@ -465,7 +462,6 @@ |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
|
|
|
|
),0) tradeAmt |
|
|
|
|
|
|
|
from wx_merchant m where m.status=1 |
|
|
|
@@ -482,12 +478,13 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="userTradeDetailList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeDetailVo"> |
|
|
|
select c.`nick_name` 'userName',c.`phone`,co.title couponName,co.`sale_price` couponSale ,co.price couponPrice, co.price tradeAmt,o.create_date tradeDate |
|
|
|
from wx_coupon_order o |
|
|
|
select mb.`name` 'userName',mb.`phone`,co.title couponName,co.`sale_price` couponSale ,co.price couponPrice, co.price tradeAmt,o.create_date tradeDate |
|
|
|
from wx_coupon_order o |
|
|
|
left join wx_coupon co on(o.`coupon_id`=co.id) |
|
|
|
left join wx_coupon_merchant cm on(cm.product_id=co.id) |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) |
|
|
|
where o.coupon_order_status=1 and o.tenant_id=#{tenantId} |
|
|
|
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id) |
|
|
|
where o.coupon_order_status=1 |
|
|
|
and o.tenant_id=#{tenantId} |
|
|
|
<if test=" null != id "> |
|
|
|
and cm.`merchant_id` = #{id} |
|
|
|
</if> |
|
|
|
@@ -510,5 +507,12 @@ |
|
|
|
order by o.create_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findByTrade" parameterType="java.util.Map" resultMap="BaseResultMap"> |
|
|
|
select * from wx_merchant where id in( |
|
|
|
select merchant_id from wx_coupon_merchant where product_id=#{id} |
|
|
|
)limit 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |