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);