优化充值、退款统计

This commit is contained in:
yuyang 2022-10-09 16:07:15 +08:00
parent 2eec496458
commit 278b5ba31e
2 changed files with 11 additions and 11 deletions

View File

@ -214,11 +214,11 @@
<select id="sumMoney" resultType="map"> <select id="sumMoney" resultType="map">
select select
sum(xro.amount) amount, ifnull(sum(xro.amount),0) amount,
(select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and status=1) one, ifnull((select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and status=1),0) one,
(select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and status=1) two, ifnull((select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and status=1),0) two,
(select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and status=1) three, ifnull((select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and status=1),0) three,
(select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and status=1) four ifnull((select sum(amount) from xhpc_recharge_order where create_time &gt;= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and status=1),0) four
from xhpc_recharge_order xro from xhpc_recharge_order xro
where xro.del_flag = 0 where xro.del_flag = 0
ORDER BY xro.create_time DESC ORDER BY xro.create_time DESC

View File

@ -246,11 +246,11 @@
<select id="sumMoney" resultType="map"> <select id="sumMoney" resultType="map">
select select
sum(xro.amount) amount, ifnull(sum(xro.amount),0) amount,
(select sum(amount) from xhpc_refund_order where create_time &gt;= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) one, ifnull((select sum(amount) from xhpc_refund_order where create_time &gt;= #{time1} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) one,
(select sum(amount) from xhpc_refund_order where create_time &gt;= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) two, ifnull((select sum(amount) from xhpc_refund_order where create_time &gt;= #{time2} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) two,
(select sum(amount) from xhpc_refund_order where create_time &gt;= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) three, ifnull((select sum(amount) from xhpc_refund_order where create_time &gt;= #{time3} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) three,
(select sum(amount) from xhpc_refund_order where create_time &gt;= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1) four ifnull((select sum(amount) from xhpc_refund_order where create_time &gt;= #{time4} and tenant_id =#{tenantId} and del_flag = 0 and examine_status=1 and status =1),0) four
from xhpc_refund_order xro from xhpc_refund_order xro
where xro.del_flag = 0 and xro.examine_status=1 and xro.status =1 where xro.del_flag = 0 and xro.examine_status=1 and xro.status =1
ORDER BY xro.create_time DESC ORDER BY xro.create_time DESC