From c1bb86b341f997c689a6f7b0a3532ee36172a330 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 30 Oct 2023 17:56:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hai/dao/HighDiscountAgentBatchMapperExt.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java index 0391fad2..95740c2e 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountAgentBatchMapperExt.java @@ -25,7 +25,10 @@ public interface HighDiscountAgentBatchMapperExt { " a.create_time createTime," + " a.mail_time mailTime," + " a.batch_num batchNum," + - " (select count(1) from high_discount_agent_code where discount_agent_batch_id = a.id and `status` in (2,3)) useNum" + + " (select count(1) from high_discount_agent_code where discount_agent_batch_id = a.id and `status` in (2,3,4)) receiveNum, " + + " (select count(1) from high_discount_agent_code where discount_agent_batch_id = a.id and `status` in (3)) useNum," + + " (select count(1) from high_coupon_code_other where discount_agent_code_id in " + + " (select id from high_discount_agent_code where discount_agent_batch_id = a.id)) sendNum " + " from high_discount_agent_batch a where 1 = 1" + " and a.using_range = #{param.usingRange} " + " and a.discount_price = #{param.price} " + @@ -38,12 +41,16 @@ public interface HighDiscountAgentBatchMapperExt { " sum(a.batchNum) batchNum," + " sum(a.useNum) useNum," + " sum((a.useNum * a.discountPrice)) usePrice," + - " ROUND(sum(a.useNum) / sum(a.batchNum) * 100, 2) useRate" + + " ROUND(sum(a.useNum) / sum(a.batchNum) * 100, 2) useRate," + + " sum(a.sendNum) sendNum," + + " sum((a.sendNum * a.discountPrice)) sendPrice" + " from (select " + " a.discount_price discountPrice," + " a.using_range discountUsingRange," + " a.batch_num batchNum," + - " (select count(1) from high_discount_agent_code where discount_agent_batch_id = a.id and `status` in (2,3)) useNum" + + " (select count(1) from high_discount_agent_code where discount_agent_batch_id = a.id and `status` in (3)) useNum," + + " (select count(1) from high_coupon_code_other where discount_agent_code_id in " + + " (select id from high_discount_agent_code where discount_agent_batch_id = a.id)) sendNum " + " from high_discount_agent_batch a where 1 = 1" + " and a.using_range = #{param.usingRange} " + " and a.discount_price = #{param.price} " +