Просмотр исходного кода

[券数据列表][修改]添加过滤条件券类型

release_toaliyun_real
masterspirit 7 лет назад
committed by Stormeye.Wu
Родитель
Сommit
cb3cd2813b
3 измененных файлов: 23 добавлений и 4 удалений
  1. +9
    -0
      mallinkService/src/main/java/com/simple/domain/dto/MarkingCouponDataReportDto.java
  2. +4
    -0
      mallinkService/src/main/java/com/simple/service/impl/MarkingDataReportServiceImpl.java
  3. +10
    -4
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 9
- 0
mallinkService/src/main/java/com/simple/domain/dto/MarkingCouponDataReportDto.java Просмотреть файл

@@ -10,6 +10,7 @@ public class MarkingCouponDataReportDto {
private Date startTime;
private Date endTime;
private Integer type;
private Integer couponType;

public Integer getType() {
return type;
@@ -34,4 +35,12 @@ public class MarkingCouponDataReportDto {
public void setEndTime(Date endTime) {
this.endTime = endTime;
}

public Integer getCouponType() {
return couponType;
}

public void setCouponType(Integer couponType) {
this.couponType = couponType;
}
}

+ 4
- 0
mallinkService/src/main/java/com/simple/service/impl/MarkingDataReportServiceImpl.java Просмотреть файл

@@ -195,6 +195,10 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService {
params.put("tenantId", tenantId);
params.put("startTime", convertDate(markingCouponDataReportDto.getStartTime()));
params.put("endTime", convertDateAndAdd(convertDate(markingCouponDataReportDto.getEndTime()), 1));
if(markingCouponDataReportDto.getCouponType()!=null){
params.put("couponType", markingCouponDataReportDto.getCouponType());
}

PageHelper.startPage(pageIndex, pageSize);
List<MarkingCouponDataReportVo> couponDatalist = wxCouponOrderMapper.couponDataList(params);
if(couponDatalist.isEmpty()){


+ 10
- 4
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -387,11 +387,17 @@
</select>

<select id="couponDataList" resultType="com.simple.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap">
SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as createTime,coupon_id as couponId
SELECT DATE_FORMAT(wx_coupon_order.create_date,'%Y-%m-%d') as createTime,wx_coupon_order.coupon_id as couponId
,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount
,(select Count(*) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=createTime and tenant_id=#{tenantId} and c.coupon_id=couponId AND c.update_date &gt;= #{startTime} and c.update_date &lt;= #{endTime}) 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')=createTime and tenant_id=#{tenantId} and d.coupon_id=couponId AND d.update_date &gt;= #{startTime} and d.update_date &lt;= #{endTime}) as verifyUserCount
from wx_coupon_order where tenant_id=#{tenantId} AND create_date &gt;= #{startTime} and create_date &lt;= #{endTime} GROUP BY createTime,couponId
,(select Count(coupon_id) from wx_coupon_order c where coupon_order_status=1 AND DATE_FORMAT(create_date,'%Y-%m-%d')=createTime and tenant_id=#{tenantId} and c.coupon_id=couponId AND c.update_date &gt;= #{startTime} and c.update_date &lt;= #{endTime}) as verifyCount
,(select Count(DISTINCT c_user_id) from wx_coupon_order d where coupon_order_status=1 AND d.coupon_id=couponId AND DATE_FORMAT(create_date,'%Y-%m-%d')=createTime and tenant_id=#{tenantId} and d.coupon_id=couponId AND d.update_date &gt;= #{startTime} and d.update_date &lt;= #{endTime}) as verifyUserCount
from wx_coupon_order join wx_coupon on wx_coupon_order.coupon_id=wx_coupon.id where wx_coupon_order.tenant_id=#{tenantId} AND wx_coupon_order.create_date &gt;= #{startTime} and wx_coupon_order.create_date &lt;= #{endTime}

<if test="couponType != null">
AND wx_coupon.type = #{couponType}
</if>

GROUP BY createTime,couponId
</select>

<select id="touchUsersReportList" resultType="com.simple.domain.vo.TouchUsersReportVo" parameterType="hashmap">


Загрузка…
Отмена
Сохранить