From 46346f3ab8836c8d946ba3c6e97a03e7ffd8272b Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 6 Jan 2022 21:41:28 +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 --- .../main/java/com/hai/dao/HighCouponAgentRelMapperExt.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java index 600a2625..342cddf2 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java @@ -51,7 +51,9 @@ public interface HighCouponAgentRelMapperExt { @Select(" select count(1) from high_coupon_agent_code a where a.agent_id = #{agentId} and a.`status` in (${status}) and a.type = #{type} ") Integer getAgentCodeCount(@Param("agentId") Long agentId,@Param("status") String status,@Param("type") Integer type); - @Select(" select sum(b.sales_price) from high_coupon_agent_code a " + + @Select(" select " + + " case WHEN sum(b.sales_price) is null then 0 else sum(b.sales_price) end" + + " from high_coupon_agent_code a " + " LEFT JOIN high_coupon_agent_rel b on b.id = a.coupon_agent_id " + " where a.agent_id = #{agentId} and a.`status` in (${status}) and a.type = #{type} ") Integer getAgentCodePrice(@Param("agentId") Long agentId,@Param("status") String status,@Param("type") Integer type);