|
|
|
@@ -423,4 +423,54 @@ |
|
|
|
update wx_merchant set credit_locked = #{creditLocked} where tenant_id = #{tenantId} |
|
|
|
</update> |
|
|
|
|
|
|
|
<select id="userTradeList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeVo"> |
|
|
|
select m.id,m.`cover_picture` cover,m.`name` merchantName,m.`link_person` linkName, |
|
|
|
(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) where cm.`merchant_id`=m.id and o.coupon_order_status=1 |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
</if> |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
) consumeCount, |
|
|
|
|
|
|
|
(select count(distinct c.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) where cm.`merchant_id`=m.id and o.coupon_order_status=1 |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
</if> |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
) consumeCountP, |
|
|
|
|
|
|
|
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) where cm.`merchant_id`=m.id and o.coupon_order_status=1 |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
</if> |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
),0) tradeAmt |
|
|
|
|
|
|
|
from wx_merchant m where 1=1 |
|
|
|
|
|
|
|
<if test=" null != name and ''!=name "> |
|
|
|
and `name` like concat('%', #{name},'%') |
|
|
|
</if> |
|
|
|
<if test=" null != linkPhone and ''!=linkPhone "> |
|
|
|
and `link_phone` like concat('%', #{linkPhone},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |