소스 검색

[卡券][修复]:优化砍价统计列表

release_toaliyun_real
hupeng 6 년 전
부모
커밋
2415ae19dd
2개의 변경된 파일12개의 추가작업 그리고 23개의 파일을 삭제
  1. +0
    -6
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +12
    -17
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 0
- 6
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java 파일 보기

@@ -329,12 +329,6 @@ public class WxCouponController extends BaseController {
@SystemControllerLog(description = "券投放-砍价营销列表") @SystemControllerLog(description = "券投放-砍价营销列表")
public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) {
Map<String,Object> result = new HashedMap(); Map<String,Object> result = new HashedMap();
if(wxCoupon.getStartdate() == null){
wxCoupon.setStartdate(DateUtils.getFirstDayForCurrMonth());
}
if(wxCoupon.getEnddate() == null){
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));
}
wxCoupon.setTenantId(getTenantId()); wxCoupon.setTenantId(getTenantId());
PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,pageNum,pageSize); PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,pageNum,pageSize);
return new ResultData(pages); return new ResultData(pages);


+ 12
- 17
mallinkService/src/main/resources/mapper/WxCouponMapper.xml 파일 보기

@@ -654,23 +654,17 @@


<select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap">
select c.id, c.`cover_img`,c.`title`,c.`sale_price`,c.`price`, select c.id, c.`cover_img`,c.`title`,c.`sale_price`,c.`price`,
IFNULL(round((select count(o.id) from wx_order o where o.tenant_id = #{tenantId} and o.product_id = c.id and o.order_status = 1)/
(select count(op.id) from wx_order_press op where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id` and op.first = 1 )*100,2),0) change_rate,
(select count(op.id) from wx_order_press op
where op.`tenant_id` = #{tenantId} and op.first = 1 and op.coupon_id = c.id) as press_count,
(select count(o.id) from wx_order o
where o.`tenant_id` = #{tenantId} and o.product_id = c.id and o.order_status = 1) as press_succ_count,

(select count(op.id) from wx_order_press op
where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id`) as join_count,

IFNULL(round((select count(wco.id) xcount from wx_coupon_order wco
where wco.`tenant_id` = #{tenantId} and wco.coupon_id = c.id and wco.coupon_order_status = 1
)/(select count(op.id) from wx_order_press op
where op.`tenant_id` = #{tenantId} and op.`coupon_id` = c.`id` and op.first = 1)
*100,2),0) as payment_rate

from wx_coupon c where c.type = 8
ifnull(op.press_count,0) as press_count,
ifnull(o.press_succ_count,0) as press_succ_count,
ifnull(op2.join_count,0) as join_count,
ifnull(round(o.press_succ_count/op.press_count*100,2),0) as change_rate,
ifnull(round(cop.xCount/op.press_count*100,2),0) as payment_rate
FROM wx_coupon c
left join (SELECT count(id) as press_count, coupon_id FROM wx_order_press WHERE `tenant_id` = #{tenantId} AND `first` = 1 group by coupon_id) op on op.coupon_id = c.id
left join (SELECT count(id) as press_succ_count, product_id FROM wx_order WHERE `tenant_id` = #{tenantId} AND order_status = 1 group by product_id) o on o.product_id = c.id
left join (SELECT count(id) as join_count, coupon_id FROM wx_order_press op WHERE `tenant_id` = #{tenantId} group by coupon_id) op2 on op2.coupon_id = c.id
left join (SELECT count(id) as xCount, coupon_id FROM wx_coupon_order WHERE `tenant_id` = #{tenantId} AND coupon_order_status = 1) cop on cop.coupon_id = c.id
where c.type = 8
<if test="tenantId != null"> <if test="tenantId != null">
and c.tenant_id=#{tenantId} and c.tenant_id=#{tenantId}
</if> </if>
@@ -683,6 +677,7 @@
<if test=" null != startdate and null!=enddate"> <if test=" null != startdate and null!=enddate">
and c.`create_date` between #{startdate} and #{enddate} and c.`create_date` between #{startdate} and #{enddate}
</if> </if>

<if test=" null != sortColumns">order by ${sortColumns}</if> <if test=" null != sortColumns">order by ${sortColumns}</if>
<if test=" null == sortColumns">order by c.status asc,c.create_date desc</if> <if test=" null == sortColumns">order by c.status asc,c.create_date desc</if>
</select> </select>


불러오는 중...
취소
저장