Commit f5e01df9 authored by 38823's avatar 38823

租金催收查询优化

parent 6f8de30b
......@@ -11,14 +11,18 @@
<bm:query-sql><![CDATA[
SELECT
t1.*,
(Select Min(cc1.TIMES)
((Select Min(cc1.TIMES)
From con_contract_cashflow cc1
Where cc1.contract_id = t1.contract_id
And cc1.due_date <= Sysdate
And cc1.cf_item In (250)
And cc1.write_off_flag <> 'FULL'
and cc1.cf_status='RELEASE'
And cc1.due_date = t1.min_overdue_date) min_overdue_times
And cc1.due_date = t1.min_overdue_date) -
(select Min(cc1.times)
from con_contract_cashflow cc1
where cc1.contract_id = t1.contract_id
And cc1.cf_item In (250))+1) min_overdue_times
FROM (SELECT
cc.contract_id,
cc.document_type,
......@@ -147,6 +151,10 @@
) total_due_amount,
cc.contract_status,
cc.BUSINESS_TYPE,
(select v.code_value_name
From sys_code_values_v v
Where v.code = 'REPURCHASE_TYPES'
And cc.repurchase_types = v.code_value ) repurchase_types_n,
cc.repurchase_types
,(select to_char(max(t.creation_date), 'yyyy-mm-dd')
from cux_rent_dun_msg t
......@@ -320,6 +328,10 @@
) total_due_amount,
cc.contract_status,
cc.BUSINESS_TYPE,
(select v.code_value_name
From sys_code_values_v v
Where v.code = 'REPURCHASE_TYPES'
And cc.repurchase_types = v.code_value ) repurchase_types_n,
cc.repurchase_types
,(select to_char(max(t.creation_date), 'yyyy-mm-dd')
from cux_rent_dun_msg t
......
......@@ -794,6 +794,7 @@
<a:column name="bp_id_tenant_desc" lock="true" prompt="承租人名称" showTitle="true"
width="100"
align="center"/>
<a:column name="repurchase_types_n" align="center" prompt="回购类型" width="100"/>
<a:column name="min_overdue_date" align="center" prompt="预定支付日" width="100"
renderer="render_formatDate"/>
<a:column name="min_overdue_times" align="center" prompt="预定支付期数" width="100"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment