|
@@ -205,8 +205,8 @@
|
|
ifnull(count(distinct a.payseriesno),0) "frequency",
|
|
ifnull(count(distinct a.payseriesno),0) "frequency",
|
|
ifnull(round(sum(a.transamount),3),'0.000') as "receivedamount",
|
|
ifnull(round(sum(a.transamount),3),'0.000') as "receivedamount",
|
|
ifnull(FLOOR(sum(a.transamount)/p.totalprice_l1),0) as "amount",
|
|
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 "ysfee",
|
|
'0.000' as "fjfee"
|
|
'0.000' as "fjfee"
|
|
FROM
|
|
FROM
|
|
@@ -215,6 +215,8 @@
|
|
left join pay_base_customerandmeterrela c on c.account_id = a.account_id
|
|
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_waterproperty p on p.id = c.waterproperty_id
|
|
left join pay_base_watercategory w on w.id = p.category_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_organization o on o.id = c.office_id
|
|
left join sc_user u on u.id = a.create_by
|
|
left join sc_user u on u.id = a.create_by
|
|
<where>
|
|
<where>
|
|
@@ -254,14 +256,16 @@
|
|
ifnull(count(distinct a.payseriesno),0) "frequency",
|
|
ifnull(count(distinct a.payseriesno),0) "frequency",
|
|
ifnull(round(sum(a.receivedamount),3),'0.000') as "receivedamount",
|
|
ifnull(round(sum(a.receivedamount),3),'0.000') as "receivedamount",
|
|
ifnull(FLOOR(sum(a.receivedamount)/p.totalprice_l1),0) as "amount",
|
|
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 "ysfee",
|
|
'0.000' as "fjfee"
|
|
'0.000' as "fjfee"
|
|
from pay_pay_received a
|
|
from pay_pay_received a
|
|
left join pay_base_customerandmeterrela c on c.account_id = a.account_id
|
|
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_waterproperty p on p.id = c.waterproperty_id
|
|
left join pay_base_watercategory w on w.id = p.category_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_organization o on o.id = c.office_id
|
|
left join sc_user u on u.id = a.create_by
|
|
left join sc_user u on u.id = a.create_by
|
|
<where>
|
|
<where>
|