diff --git a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRechargeOrderMapper.xml b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRechargeOrderMapper.xml index dd2e51de..350efea3 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRechargeOrderMapper.xml +++ b/xhpc-modules/xhpc-payment/src/main/resources/mapper/XhpcRechargeOrderMapper.xml @@ -213,12 +213,12 @@ select - sum(xro.amount) amount, - (select sum(amount) from xhpc_refund_order where create_time >= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) one, - (select sum(amount) from xhpc_refund_order where create_time >= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) two, - (select sum(amount) from xhpc_refund_order where create_time >= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) three, - (select sum(amount) from xhpc_refund_order where create_time >= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) four + ifnull(sum(xro.amount),0) amount, + ifnull((select sum(amount) from xhpc_refund_order where create_time >= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) one, + ifnull((select sum(amount) from xhpc_refund_order where create_time >= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) two, + ifnull((select sum(amount) from xhpc_refund_order where create_time >= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) three, + ifnull((select sum(amount) from xhpc_refund_order where create_time >= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) four from xhpc_refund_order xro where xro.del_flag = 0 and xro.examine_status=1 and xro.status =1 ORDER BY xro.create_time DESC