|
|
@@ -492,6 +492,22 @@ |
|
|
where m.status=1 |
|
|
where m.status=1 |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="getOweBillAsPageConditions"> |
|
|
|
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" null != month and ''!=month"> |
|
|
|
|
|
and date_format(receive_date,'%Y-%m')=#{month} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" null != starttime and ''!=starttime"> |
|
|
|
|
|
and receive_date >= #{starttime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" null != endtime and ''!=endtime"> |
|
|
|
|
|
and receive_date <= #{endtime} |
|
|
|
|
|
</if> |
|
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="getOweBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap"> |
|
|
<select id="getOweBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap"> |
|
|
select bill.tenant_id tenantId,bill.merchant_id merchantId,m.name merchantName,bill.bill_type billType, |
|
|
select bill.tenant_id tenantId,bill.merchant_id merchantId,m.name merchantName,bill.bill_type billType, |
|
|
m.link_phone managerPhone,m.`link_person` manager,m.email, |
|
|
m.link_phone managerPhone,m.`link_person` manager,m.email, |
|
|
@@ -544,44 +560,29 @@ |
|
|
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' |
|
|
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,'' |
|
|
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 where is_preview = 0 and tenant_id = #{tenantId} |
|
|
endtime,rent_shop_type from wx_bill_rent where is_preview = 0 and tenant_id = #{tenantId} |
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<include refid="getOweBillAsPageConditions"/> |
|
|
union |
|
|
union |
|
|
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' |
|
|
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' |
|
|
bill_type,need_pay,receive_pay,pay,(need_pay-pay),DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' |
|
|
bill_type,need_pay,receive_pay,pay,(need_pay-pay),DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' |
|
|
endtime,rent_shop_type from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId} |
|
|
endtime,rent_shop_type from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId} |
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<include refid="getOweBillAsPageConditions"/> |
|
|
union |
|
|
union |
|
|
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, |
|
|
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 from( |
|
|
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 from( |
|
|
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金' |
|
|
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,'' |
|
|
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 from wx_bill_rent_deposit where tenant_id = #{tenantId} |
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<include refid="getOweBillAsPageConditions"/> |
|
|
union |
|
|
union |
|
|
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金' |
|
|
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,'' |
|
|
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 from wx_bill_property_deposit where tenant_id = #{tenantId} |
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<include refid="getOweBillAsPageConditions"/> |
|
|
union |
|
|
union |
|
|
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as |
|
|
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 |
|
|
from wx_bill_other_deposit where tenant_id = #{tenantId} |
|
|
from wx_bill_other_deposit where tenant_id = #{tenantId} |
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<include refid="getOweBillAsPageConditions"/> |
|
|
) res |
|
|
) res |
|
|
union |
|
|
union |
|
|
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, |
|
|
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, |
|
|
@@ -589,18 +590,12 @@ |
|
|
select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as |
|
|
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 |
|
|
from wx_bill_daily where type in(1,2) and tenant_id = #{tenantId} |
|
|
from wx_bill_daily where type in(1,2) and tenant_id = #{tenantId} |
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<include refid="getOweBillAsPageConditions"/> |
|
|
union |
|
|
union |
|
|
select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as |
|
|
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 |
|
|
from wx_bill_other where tenant_id = #{tenantId} |
|
|
from wx_bill_other where tenant_id = #{tenantId} |
|
|
and status !=6 |
|
|
|
|
|
<if test="null != status "> |
|
|
|
|
|
and status = #{status} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<include refid="getOweBillAsPageConditions"/> |
|
|
) res |
|
|
) res |
|
|
|
|
|
|
|
|
) bill |
|
|
) bill |
|
|
@@ -612,17 +607,9 @@ |
|
|
) bill |
|
|
) bill |
|
|
left join wx_merchant m on bill.merchant_id=m.id |
|
|
left join wx_merchant m on bill.merchant_id=m.id |
|
|
where m.status=1 and m.tenant_id = #{tenantId} |
|
|
where m.status=1 and m.tenant_id = #{tenantId} |
|
|
<if test=" null != month and ''!=month"> |
|
|
|
|
|
and date_format(bill.receive_date,'%Y-%m')=#{month} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" null != starttime and ''!=starttime"> |
|
|
|
|
|
and bill.receive_date >= #{starttime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" null != endtime and ''!=endtime"> |
|
|
|
|
|
and bill.receive_date <= #{endtime} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" null != sortColumns"> order by ${sortColumns} </if> |
|
|
<if test=" null != sortColumns"> order by ${sortColumns} </if> |
|
|
<if test=" null == sortColumns"> order by totalOwe desc </if> |
|
|
<if test=" null == sortColumns"> order by totalOwe desc </if> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |