| @@ -669,9 +669,6 @@ | |||||
| select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(ci.sale_amount) xcount from wx_card_info ci | select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(ci.sale_amount) xcount from wx_card_info ci | ||||
| left join wx_coupon c on c.id = ci.coupon_id | left join wx_coupon c on c.id = ci.coupon_id | ||||
| where ci.create_date between #{startdate} and #{enddate} | where ci.create_date between #{startdate} and #{enddate} | ||||
| <if test="id != null"> | |||||
| and c.id = #{id} | |||||
| </if> | |||||
| group by xtime | group by xtime | ||||
| </select> | </select> | ||||
| @@ -680,21 +677,15 @@ | |||||
| left join wx_coupon c on c.id = ci.coupon_id | left join wx_coupon c on c.id = ci.coupon_id | ||||
| left join wx_card_spend wcs on wcs.card_id = ci.id | left join wx_card_spend wcs on wcs.card_id = ci.id | ||||
| where ci.create_date between #{startdate} and #{enddate} | where ci.create_date between #{startdate} and #{enddate} | ||||
| <if test="id != null"> | |||||
| and c.id = #{id} | |||||
| </if> | |||||
| group by xtime | group by xtime | ||||
| </select> | </select> | ||||
| <select id="findSaleCardCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | <select id="findSaleCardCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | ||||
| select count(distinct co.owner_id) | |||||
| select count(co.id) | |||||
| from wx_card_info ci | from wx_card_info ci | ||||
| left join wx_coupon c on c.id = ci.coupon_id | left join wx_coupon c on c.id = ci.coupon_id | ||||
| left join wx_coupon_order co on co.id = ci.id | left join wx_coupon_order co on co.id = ci.id | ||||
| where c.create_date between #{startdate} and #{enddate} | where c.create_date between #{startdate} and #{enddate} | ||||
| <if test="id != null"> | |||||
| and c.id = #{id} | |||||
| </if> | |||||
| </select> | </select> | ||||
| <select id="findTranCardCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | <select id="findTranCardCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | ||||
| @@ -702,9 +693,6 @@ | |||||
| left join wx_coupon c on c.id = ci.coupon_id | left join wx_coupon c on c.id = ci.coupon_id | ||||
| left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id | left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id | ||||
| where c.create_date between #{startdate} and #{enddate} | where c.create_date between #{startdate} and #{enddate} | ||||
| <if test="id != null"> | |||||
| and c.id = #{id} | |||||
| </if> | |||||
| </select> | </select> | ||||
| <select id="findSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | <select id="findSubsidyMoney" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long"> | ||||
| @@ -738,7 +726,7 @@ | |||||
| <select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | <select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | ||||
| select c.*, | select c.*, | ||||
| (select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, | |||||
| (select count(distinct wco.id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, | |||||
| (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as payment_count, | (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as payment_count, | ||||
| (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count | (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count | ||||
| from wx_coupon c where 1=1 | from wx_coupon c where 1=1 | ||||