From 4e2d114f9549f518275be36e8832b719df7a4e4c Mon Sep 17 00:00:00 2001 From: Tankaikai Date: Wed, 5 Mar 2025 14:49:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=82=E8=B4=A6=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/CreditBuyerMapper.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cash-service/order-service/src/main/resources/mapper/CreditBuyerMapper.xml b/cash-service/order-service/src/main/resources/mapper/CreditBuyerMapper.xml index a72976f5d..1cb5e292c 100644 --- a/cash-service/order-service/src/main/resources/mapper/CreditBuyerMapper.xml +++ b/cash-service/order-service/src/main/resources/mapper/CreditBuyerMapper.xml @@ -5,12 +5,13 @@ (SELECT - credit_buyer_id AS credit_buyer_id, - status AS status, + tb.credit_buyer_id AS credit_buyer_id, + tb.status AS status, count( 0 ) AS count FROM - GROUP BY credit_buyer_id,status) + tb + GROUP BY tb.credit_buyer_id,tb.status) @@ -35,11 +36,12 @@ x3.owed_amount, x3.accumulate_amount from tb_credit_buyer x1 - left join tb_shop_info t2 on x1.shop_id = x2.id - left join (select credit_buyer_id,ifnull(sum(unpaid_amount),0) as owed_amount,ifnull(sum(pay_amount),0) as + left join tb_shop_info x2 on x1.shop_id = x2.id + left join (select t.credit_buyer_id,ifnull(sum(t.unpaid_amount),0) as owed_amount,ifnull(sum(t.pay_amount),0) as accumulate_amount from - group by credit_buyer_id) x3 on x1.id = x3.credit_buyer_id + t + group by t.credit_buyer_id) x3 on x1.id = x3.credit_buyer_id and x1.is_del = 0 and x1.shop_id = #{shopId}