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} " +