| @@ -662,7 +662,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| markingCouponDataReportDto.setEndTime(markingCouponDataReportDto.getEndTime()); | markingCouponDataReportDto.setEndTime(markingCouponDataReportDto.getEndTime()); | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto); | |||||
| //获取领取人数 | //获取领取人数 | ||||
| //获取领取量 | //获取领取量 | ||||
| @@ -674,17 +674,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| params2.put("endTime", markingCouponDataReportDto.getEndTime()); | params2.put("endTime", markingCouponDataReportDto.getEndTime()); | ||||
| List<TouchUsersReportVo> couponDatalist = wxCouponOrderMapper.touchUsersReportList(params2); | |||||
| Map<String,TouchUsersReportVo> visitMap = couponDatalist.stream().collect(Collectors.toMap(TouchUsersReportVo::getXTime, p -> p)); | |||||
| for (TouchUsersReportVo temp:wxUserVisitList) { | |||||
| if(visitMap.get(temp.getXTime())!=null){ | |||||
| temp.setCouponCount(visitMap.get(temp.getXTime()).getCouponCount()); | |||||
| temp.setUserCount(visitMap.get(temp.getXTime()).getUserCount()); | |||||
| temp.setVerifyCount(visitMap.get(temp.getXTime()).getVerifyCount()); | |||||
| temp.setVerifyUserCount(visitMap.get(temp.getXTime()).getVerifyUserCount()); | |||||
| } | |||||
| } | |||||
| List<TouchUsersReportVo> wxUserVisitList = wxCouponOrderMapper.touchUsersReportList(params2); | |||||
| return new PageInfo<>(wxUserVisitList); | return new PageInfo<>(wxUserVisitList); | ||||
| } | } | ||||
| @@ -149,39 +149,14 @@ | |||||
| </select> | </select> | ||||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | ||||
| SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as xTime | |||||
| ,COUNT(DISTINCT c_user_id) as userCount,count(*) as couponCount | |||||
| ,(select Count(*) from wx_coupon_order c | |||||
| where coupon_order_status=1 | |||||
| and DATE_FORMAT(create_date,'%Y-%m-%d')=xTime | |||||
| and tenant_id=#{tenantId} | |||||
| SELECT xTime, tenant_id, pv, uv, couponCount, userCount, verifyCount, verifyUserCount | |||||
| FROM view_touch_user | |||||
| WHERE view_touch_user.tenant_id=#{tenantId} | |||||
| <if test="startTime != null"> | <if test="startTime != null"> | ||||
| and c.update_date >= #{startTime} | |||||
| and view_touch_user.xTime >= DATE_FORMAT(#{startTime},'%Y-%m-%d') | |||||
| </if> | </if> | ||||
| <if test="endTime != null"> | <if test="endTime != null"> | ||||
| and c.update_date <= #{endTime} | |||||
| </if> | |||||
| ) | |||||
| as verifyCount | |||||
| ,(select Count(DISTINCT c_user_id) from wx_coupon_order d | |||||
| where coupon_order_status=1 | |||||
| and DATE_FORMAT(create_date,'%Y-%m-%d')=xTime | |||||
| and tenant_id=#{tenantId} | |||||
| <if test="startTime != null"> | |||||
| and d.update_date >= #{startTime} | |||||
| </if> | |||||
| <if test="endTime != null"> | |||||
| and d.update_date <= #{endTime} | |||||
| </if> | |||||
| ) | |||||
| as verifyUserCount | |||||
| from wx_coupon_order | |||||
| where tenant_id=#{tenantId} | |||||
| <if test="startTime != null"> | |||||
| AND create_date >= #{startTime} | |||||
| </if> | |||||
| <if test="endTime != null"> | |||||
| and create_date <= #{endTime} | |||||
| and view_touch_user.xTime <= DATE_FORMAT(#{endTime},'%Y-%m-%d') | |||||
| </if> | </if> | ||||
| GROUP BY xTime | GROUP BY xTime | ||||
| order by xTime desc | order by xTime desc | ||||