Pārlūkot izejas kodu

1修改水费污水费(水量*单价)

Xiaojh 4 gadi atpakaļ
vecāks
revīzija
f9daabe217

+ 8 - 4
smart-city-platform/src/main/resources/mapper/pay/PayReportMapper.xml

@@ -205,8 +205,8 @@
             ifnull(count(distinct a.payseriesno),0) "frequency",
             ifnull(round(sum(a.transamount),3),'0.000') as "receivedamount",
             ifnull(FLOOR(sum(a.transamount)/p.totalprice_l1),0) as "amount",
-            '0.000' as "sfee",
-            '0.000' as "wsfee",
+            round(ifnull((FLOOR(sum(a.transamount)/p.totalprice_l1))*(max(case when e.feetype = 1 then e.price end )),0 ),3)as "sfee",
+            round(ifnull((FLOOR(sum(a.transamount)/p.totalprice_l1))*(max(case when e.feetype = 4 then e.price end )),0 ),3) as "wsfee",
             '0.000' as "ysfee",
             '0.000' as "fjfee"
         FROM
@@ -215,6 +215,8 @@
         left join pay_base_customerandmeterrela c on c.account_id = a.account_id
         left join pay_base_waterproperty p on p.id = c.waterproperty_id
         left join pay_base_watercategory w on w.id = p.category_id
+        left join pay_base_priceofwaterproperty b on p.id = b.waterproperty_id
+        left join pay_base_waterprice e on b.waterprice_id = e.id and e.ladderlevel = 1
         left join sc_organization o on o.id = c.office_id
         left join sc_user u on u.id = a.create_by
         <where>
@@ -254,14 +256,16 @@
             ifnull(count(distinct a.payseriesno),0) "frequency",
             ifnull(round(sum(a.receivedamount),3),'0.000') as "receivedamount",
             ifnull(FLOOR(sum(a.receivedamount)/p.totalprice_l1),0) as "amount",
-            ifnull(round(sum(case when a.feetype = 1 then a.receivedamount end),3),'0.000') as "sfee",
-            ifnull(round(sum(case when a.feetype = 4 then a.receivedamount end),3),'0.000') as "wsfee",
+            round(ifnull((FLOOR(sum(a.receivedamount)/p.totalprice_l1))*(max(case when e.feetype = 1 then e.price end )),0 ),3)as "sfee",
+            round(ifnull((FLOOR(sum(a.receivedamount)/p.totalprice_l1))*(max(case when e.feetype = 4 then e.price end )),0 ),3) as "wsfee",
             '0.000' as "ysfee",
             '0.000' as "fjfee"
         from pay_pay_received a
         left join pay_base_customerandmeterrela c on c.account_id = a.account_id
         left join pay_base_waterproperty p on p.id = c.waterproperty_id
         left join pay_base_watercategory w on w.id = p.category_id
+        left join pay_base_priceofwaterproperty b on p.id = b.waterproperty_id
+        left join pay_base_waterprice e on b.waterprice_id = e.id and e.ladderlevel = 1
         left join sc_organization o on o.id = c.office_id
         left join sc_user u on u.id = a.create_by
         <where>