Commit de331684 by 章家宝

feat:【优惠券需求】优惠券活动代码分页查询

1 parent 50d06f8a
...@@ -163,6 +163,7 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity, ...@@ -163,6 +163,7 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity,
ca.send_notification AS sendNotification, ca.send_notification AS sendNotification,
ca.remark AS remark, ca.remark AS remark,
ca.update_time AS updateTime, ca.update_time AS updateTime,
ca.template_id AS templateId,
COUNT(DISTINCT cdr.coupon_id) AS totalGrantCount, COUNT(DISTINCT cdr.coupon_id) AS totalGrantCount,
COUNT(DISTINCT cvr.coupon_id) AS usedCount, COUNT(DISTINCT cvr.coupon_id) AS usedCount,
CASE CASE
...@@ -182,7 +183,7 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity, ...@@ -182,7 +183,7 @@ public interface CouponActivityRepository extends BaseRepository<CouponActivity,
ca.id, ca.activity_id, ca.activity_name, ca.valid_start_time, ca.id, ca.activity_id, ca.activity_name, ca.valid_start_time,
ca.valid_end_time, ca.activity_type, ca.target_type, ca.valid_end_time, ca.activity_type, ca.target_type,
ca.distribution_quantity, ca.status, ca.create_time, ca.distribution_quantity, ca.status, ca.create_time,
ca.send_notification, ca.remark, ca.update_time ca.send_notification, ca.remark, ca.update_time, ca.template_id
ORDER BY ORDER BY
CASE WHEN :sortField = 'writeOffRate' AND :sortOrder = 'ASC' THEN CASE WHEN :sortField = 'writeOffRate' AND :sortOrder = 'ASC' THEN
ROUND(COUNT(DISTINCT cvr.coupon_id) / COUNT(DISTINCT cdr.coupon_id) * 100, 2) END ASC, ROUND(COUNT(DISTINCT cvr.coupon_id) / COUNT(DISTINCT cdr.coupon_id) * 100, 2) END ASC,
......
...@@ -4,7 +4,7 @@ import java.math.BigDecimal; ...@@ -4,7 +4,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
* 优惠券活动统计DTO(小驼峰·纯数字·新增字段) * 优惠券活动统计DTO(小驼峰·纯数字·完整版)
*/ */
public interface CouponActivityStatDTO { public interface CouponActivityStatDTO {
Long getId(); Long getId();
...@@ -20,6 +20,8 @@ public interface CouponActivityStatDTO { ...@@ -20,6 +20,8 @@ public interface CouponActivityStatDTO {
Integer getSendNotification(); Integer getSendNotification();
String getRemark(); String getRemark();
LocalDateTime getUpdateTime(); LocalDateTime getUpdateTime();
Long getTemplateId(); // 补充模板ID
// 统计字段
Long getTotalGrantCount(); Long getTotalGrantCount();
Long getUsedCount(); Long getUsedCount();
BigDecimal getWriteOffRate(); BigDecimal getWriteOffRate();
......
...@@ -348,6 +348,7 @@ public class CouponActivityService { ...@@ -348,6 +348,7 @@ public class CouponActivityService {
vo.setUpdateTime(dto.getUpdateTime()); vo.setUpdateTime(dto.getUpdateTime());
vo.setCreateTime(dto.getCreateTime()); vo.setCreateTime(dto.getCreateTime());
vo.setTotalGrantCount(dto.getTotalGrantCount()); vo.setTotalGrantCount(dto.getTotalGrantCount());
vo.setTemplateId(dto.getTemplateId());
vo.setUsedCount(dto.getUsedCount()); vo.setUsedCount(dto.getUsedCount());
vo.setWriteOffRate(dto.getWriteOffRate()); vo.setWriteOffRate(dto.getWriteOffRate());
return vo; return vo;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!