@@ -647,20 +647,30 @@
<choose>
<when test="1==filterHasPay">
round((bill.rentReceivePay-bill.rentPay)/100,2) rentReceivePay,
round((bill.propertyReceivePay-bill.propertyPay)/100,2) propertyReceivePay,
round((bill.depositReceivePay-bill.depositPay)/100,2) depositReceivePay,
round((bill.otherReceivePay-bill.otherPay)/100,2) otherReceivePay,
round((bill.rentReceivePay+bill.propertyReceivePay+bill.depositReceivePay+bill.otherReceivePay
+bill.rentLatePay+bill.propertyLatePay+bill.depositLatePay+bill.otherLatePay
round((bill.rentReceivePay+bill.rentLatePay+bill.rentServiceChargePay-bill.rentPay)/100,2)
rentReceivePay,
round((bill.propertyReceivePay+bill.propertyLatePay+bill.propertyServiceChargePay-bill.propertyPay)/100,2)
propertyReceivePay,
round((bill.depositReceivePay+bill.depositLatePay+bill.depositServiceChargePay-bill.depositPay)/100,2)
depositReceivePay,
round((bill.otherReceivePay+bill.otherLatePay+bill.otherServiceChargePay-bill.otherPay)/100,2)
otherReceivePay,
round((bill.rentReceivePay+bill.rentLatePay+bill.rentServiceChargePay+bill.propertyReceivePay+bill.depositReceivePay+bill.otherReceivePay
+bill.rentLatePay+bill.propertyLatePay+bill.depositLatePay+bill.otherLatePay+bill.rentSeviceChargePay+bill.propertySeviceChargePay
+bill.depositSeviceChargePay+bill.otherSeviceChargePay
-bill.rentPay-bill.propertyPay-bill.depositPay-bill.otherPay)/100,2) totalReceivePay
</when>
<otherwise>
round(bill.rentReceivePay/100,2) rentReceivePay,
round(bill.propertyReceivePay/100,2) propertyReceivePay,
round(bill.depositReceivePay/100,2) depositReceivePay,
round(bill.otherReceivePay/100,2) otherReceivePay,
round((bill.rentReceivePay+bill.propertyReceivePay+bill.depositReceivePay+bill.otherReceivePay+bill.rentLatePay+bill.propertyLatePay+bill.depositLatePay+bill.otherLatePay )/100,2) totalReceivePay
round((bill.rentReceivePay+bill.rentLatePay+bill.rentServiceChargePay)/100,2) rentReceivePay,
round((bill.propertyReceivePay+bill.propertyLatePay+bill.propertyServiceChargePay)/100,2)
propertyReceivePay,
round((bill.depositReceivePay+bill.depositLatePay+bill.depositServiceChargePay)/100,2)
depositReceivePay,
round((bill.otherReceivePay+bill.otherLatePay+bill.otherServiceChargePay)/100,2) otherReceivePay,
round((bill.rentReceivePay+bill.propertyReceivePay+bill.depositReceivePay
+bill.otherReceivePay+bill.rentLatePay+bill.propertyLatePay+bill.depositLatePay
+bill.otherLatePay+bill.rentSeviceChargePay+bill.propertySeviceChargePay+bill.depositSeviceChargePay+bill.otherSeviceChargePay)/100,2)
totalReceivePay
</otherwise>
</choose>
@@ -685,35 +695,46 @@
max(case oweList.bill_type when '租金' then oweList.latePayPrice else 0 end) rentLatePay,
max(case oweList.bill_type when '物业费' then oweList.latePayPrice else 0 end) propertyLatePay,
max(case oweList.bill_type when '欠缴押金' then oweList.latePayPrice else 0 end) depositLatePay,
max(case oweList.bill_type when '其他费用' then oweList.latePayPrice else 0 end) otherLatePay
max(case oweList.bill_type when '其他费用' then oweList.latePayPrice else 0 end) otherLatePay,
max(case oweList.bill_type when '租金' then oweList.serviceChargePay else 0 end) rentServiceChargePay,
max(case oweList.bill_type when '物业费' then oweList.serviceChargePay else 0 end) propertyServiceChargePay,
max(case oweList.bill_type when '欠缴押金' then oweList.serviceChargePay else 0 end) depositServiceChargePay,
max(case oweList.bill_type when '其他费用' then oweList.serviceChargePay else 0 end) otherServiceChargePay
from(
select bill.tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe,bill.receive_date,bill.expired_day,sum(bill.receive_pay) receive_pay,sum(bill.pay) pay,sum(bill.late_pay_price) latePayPrice from (
select bill.tenant_id,bill.merchant_id,bill.bill_type,sum(owe)
owe,bill.receive_date,bill.expired_day,sum(bill.receive_pay) receive_pay,sum(bill.pay)
pay,sum(bill.late_pay_price) latePayPrice,sum(bill.service_charge_pay) serviceChargePay from (
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,late_pay_price from wx_bill_rent where tenant_id = #{tenantId} and is_preview = 0
bill_type,need_pay,receive_pay,pay,(receive_pay+) owe,DATE_FORMAT(receive_date,'%Y-%m-%d')
receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,late_pay_price,service_charge_pay from wx_bill_rent where tenant_id = #{tenantId} and
is_preview = 0
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,late_pay_price from wx_bill_property where tenant_id = #{tenantId} and is_preview = 0
endtime,rent_shop_type,late_pay_price,service_charge_pay from wx_bill_property where tenant_id = #{tenantId} and
is_preview = 0
<include refid="getOweBillAsPageConditions"/>
union all
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type,0 late_pay_price from(
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit where tenant_id = #{tenantId}
endtime,rent_shop_type,service_charge_pay from wx_bill_rent_deposit where tenant_id = #{tenantId}
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit where tenant_id = #{tenantId}
endtime,rent_shop_type,service_charge_pay from wx_bill_property_deposit where tenant_id = #{tenantId}
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,
pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type,service_charge_pay
from wx_bill_other_deposit where tenant_id = #{tenantId}
<include refid="getOweBillAsPageConditions"/>
) res
@@ -721,12 +742,14 @@
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type,0 late_pay_price from(
select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,
expired_day,status,'' starttime,'' endtime,rent_shop_type,service_charge_pay
from wx_bill_daily where tenant_id = #{tenantId} and type in(1,2,3)
<include refid="getOweBillAsPageConditions"/>
union all
select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,
expired_day,status,'' starttime,'' endtime,rent_shop_type,service_charge_pay
from wx_bill_other where tenant_id = #{tenantId}
<include refid="getOweBillAsPageConditions"/>
) res
@@ -752,19 +775,33 @@
xb.title business,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.rent_shop_type,
ifnull(round(
(select sum(bill.receive_pay)+sum(bill.late_pay_price)+bill.receivePay from (
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,late_pay_price from wx_bill_rent where is_preview = 0 and status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,late_pay_price from
wx_bill_rent where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_rent_deposit where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,0 late_pay_price from
wx_bill_rent_deposit where status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,late_pay_price from wx_bill_property where is_preview = 0 and status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,late_pay_price from
wx_bill_property where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_property_deposit where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,0 late_pay_price from
wx_bill_property_deposit where status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_daily where type in(1,2,3) and status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,0 late_pay_price from
wx_bill_daily where type in(1,2,3) and status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_other where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,0 late_pay_price from
wx_bill_other where status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_other_deposit where status not in(3,6)
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,0 late_pay_price from
wx_bill_other_deposit where status not in(3,6)
) bill where bill.merchant_id = m.id
)/100,2),0) receivePay,
@@ -790,31 +827,32 @@
(ifnull(round(
(select sum(bill.receive_pay)+sum(bill.late_pay_price)+bill.receivePay from (
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,late_pay_price from wx_bill_rent
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId})) receivePay,late_pay_price from
wx_bill_rent
where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=456 )) receivePay,0 late_pay_price from
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId} )) receivePay,0 late_pay_price from
wx_bill_rent_deposit where status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=456 )) receivePay,late_pay_price from
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId} )) receivePay,late_pay_price from
wx_bill_property where is_preview = 0 and status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=456 )) receivePay,0 late_pay_price from
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId} )) receivePay,0 late_pay_price from
wx_bill_property_deposit where status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=456 )) receivePay,0 late_pay_price from
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId} )) receivePay,0 late_pay_price from
wx_bill_daily where type in(1,2,3) and status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=456 )) receivePay,0 late_pay_price from
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId} )) receivePay,0 late_pay_price from
wx_bill_other where status not in(3,6)
union all
select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select
service_charge_rate from wx_pay_account_bill where tenant_id=456 )) receivePay,0 late_pay_price from
service_charge_rate from wx_pay_account_bill where tenant_id=#{tenantId} )) receivePay,0 late_pay_price from
wx_bill_other_deposit where status not in(3,6)
) bill where bill.merchant_id = m.id
)/100,2),0)-