|
@@ -141,10 +141,9 @@
|
|
|
<select id="getPayfeeDetaileBill" resultType="com.bz.smart_city.dto.pay.payfee.PayfeeDetaileBill">
|
|
|
select
|
|
|
IFNULL(sum(r.debt),0) debt ,
|
|
|
- case when (IFNULL(sum(r.debt),0)-IFNULL(max(remaining ),0)) <=0 then 0
|
|
|
- else (IFNULL(sum(r.debt),0)-IFNULL(max(remaining ),0) )end as "receivableFee",
|
|
|
- case when (IFNULL(max(remaining),0)-IFNULL(sum(r.debt),0)) <=0 then 0
|
|
|
- else (IFNULL(max(remaining),0)-IFNULL(sum(r.debt),0)) end as "waterFee"
|
|
|
+ (case when (IFNULL(sum(r.debt),0)-IFNULL(max(remaining ),0)) <=0 then 0
|
|
|
+ else (IFNULL(sum(r.debt),0)-IFNULL(max(remaining ),0) )end) as "receivableFee",
|
|
|
+ IFNULL(max(remaining),0)-IFNULL(sum(r.debt),0) as "waterFee"
|
|
|
from pay_pay_rechargeaccount a
|
|
|
left join pay_pay_receivable r on a.account_id=r.account_id
|
|
|
where a.account_id = #{accountId}
|
|
@@ -152,7 +151,7 @@
|
|
|
|
|
|
<select id="getPayfeeDetailed" resultType="com.bz.smart_city.dto.pay.payfee.PayfeeDetailed">
|
|
|
select
|
|
|
- r.account_id as "acountID",
|
|
|
+ r.account_id as "accountId",
|
|
|
IFNULL(sum(case when r.feetype=1 then r.debt else 0 end),0) waterFee1,
|
|
|
IFNULL(sum(case when r.feetype=2 then r.debt else 0 end),0) waterFee2,
|
|
|
IFNULL(sum(case when r.feetype=3 then r.debt else 0 end),0) waterFee3,
|