|
|
|
@@ -186,27 +186,6 @@ |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumns"/>, |
|
|
|
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, |
|
|
|
(select count(distinct wcs.coupon_order_id) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id |
|
|
|
where wc.id = c.id) as transfer_count, |
|
|
|
(select sum(ci.sale_amount) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
where wc.id = c.id) as sale_amount, |
|
|
|
(select sum(wcs.real_payment) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
left join wx_card_spend wcs on wcs.card_id = ci.id |
|
|
|
where wc.id = c.id) as sum_payment |
|
|
|
from wx_coupon c where 1=1 |
|
|
|
<if test=" null != title "> |
|
|
|
and `title` like concat('%', #{title},'%') |
|
|
|
</if> |
|
|
|
order by status asc,create_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditionsForCard"> |
|
|
|
where `type` = 100 |
|
|
|
|
|
|
|
@@ -732,4 +711,46 @@ |
|
|
|
and c.title like concat('%', #{title},'%') |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumns"/>, |
|
|
|
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, |
|
|
|
(select count(distinct wcs.coupon_order_id) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id |
|
|
|
where wc.id = c.id) as transfer_count, |
|
|
|
(select sum(ci.sale_amount) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
where wc.id = c.id) as sale_amount, |
|
|
|
(select sum(wcs.real_payment) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
left join wx_card_spend wcs on wcs.card_id = ci.id |
|
|
|
where wc.id = c.id) as sum_payment |
|
|
|
from wx_coupon c where 1=1 |
|
|
|
<if test=" null != title "> |
|
|
|
and `title` like concat('%', #{title},'%') |
|
|
|
</if> |
|
|
|
order by status asc,create_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumns"/>, |
|
|
|
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, |
|
|
|
(select count(distinct wcs.coupon_order_id) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id |
|
|
|
where wc.id = c.id) as transfer_count, |
|
|
|
(select sum(ci.sale_amount) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
where wc.id = c.id) as sale_amount, |
|
|
|
(select sum(wcs.real_payment) from wx_card_info ci |
|
|
|
left join wx_coupon wc on wc.id = ci.coupon_id |
|
|
|
left join wx_card_spend wcs on wcs.card_id = ci.id |
|
|
|
where wc.id = c.id) as sum_payment |
|
|
|
from wx_coupon c where 1=1 |
|
|
|
<if test=" null != title "> |
|
|
|
and `title` like concat('%', #{title},'%') |
|
|
|
</if> |
|
|
|
order by status asc,create_date desc |
|
|
|
</select> |
|
|
|
</mapper> |