Commit 959ca7c0 authored by chenzhuo's avatar chenzhuo

合同查询

parent d502661e
......@@ -73,7 +73,7 @@
(select to_char(sum(cc.due_amount), 'FM9,999,999,999,990.00')
from con_contract_cashflow cc
where cc.contract_id = t1.contract_id
and ((cc.cf_item = 1 and cc.cf_type in (1,200,250)) or (cc.cf_item = 11 and cc.cf_type =11)
and ((cc.cf_type = 1 and cc.cf_item in (1,200,250)) or (cc.cf_item = 11 and cc.cf_type =11)
or (cc.cf_item = 8 and cc.cf_type = 8) or (cc.cf_item = 9 and cc.cf_type = 9))
and cc.cf_direction = 'INFLOW'
and cc.cf_status = 'RELEASE') due_amount_all --应还总额
......@@ -101,13 +101,31 @@
(select 1
from hls_bp_master_signer hs
where hs.hls_bp_signer_id = t1.signer
and hs.id_card = ${@id_no})) or
and hs.id_card = ${@id_no})
and exists (select 1 from hls_bp_master hbm
where hbm.bp_id = t1.bp_id_tenant
and hbm.social_code = ${@organization_id})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs,con_contract_change_req cr
where hs.hls_bp_signer_id = cr.signer
and cr.change_req_id = t1.contract_id
and hs.id_card = ${@id_no})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)
) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb
from con_contract_bp cb,hls_bp_master hbm
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
and cb.bp_id = hbm.bp_id
and hbm.social_code = ${@organization_id}
and cb.id_card_no_leg = ${@id_no})) or
(${@account_type} = 'LP' and exists
(select 1
......
......@@ -11,63 +11,48 @@
and t1.ec_sign_type in ('INITIATE', 'SIGNING')
and t1.sign_type = 'ELE_SIGN'
and ((${@account_type} = 'PE' and exists
(select 1
from con_contract_bp ccb, hls_bp_master hb
where ccb.bp_id = hb.bp_id
and ccb.contract_id = t1.contract_id
and ccb.bp_category in ('TENANT', 'GUARANTOR')
and (ccb.id_card_no = ${@id_no} or
ccb.id_no_sp = ${@id_no}))) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs
where hs.hls_bp_signer_id = t1.signer
and hs.id_card = ${@id_no})) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
and cb.id_card_no_leg = ${@id_no})) or
(${@account_type} = 'LP' and exists
(select 1
from con_contract_bp cb, hls_bp_master hb
where cb.bp_id = hb.bp_id
and cb.contract_id = t1.contract_id
and hb.social_code = ${@id_no})))) +
(select count(1)
from con_contract t1, con_contract_change_req cr
where t1.contract_id = cr.contract_id
and cr.ec_sign_type in ('INITIATE', 'SIGNING')
and cr.sign_type = 'ELE_SIGN'
and t1.data_class in ('NORMAL','CHANGE_REQ')
and ((${@account_type} = 'PE' and exists
(select 1
from con_contract_bp ccb, hls_bp_master hb
where ccb.bp_id = hb.bp_id
and ccb.contract_id = t1.contract_id
and ccb.bp_category in ('TENANT', 'GUARANTOR')
and (ccb.id_card_no = ${@id_no} or
ccb.id_no_sp = ${@id_no}))) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs
where hs.hls_bp_signer_id = t1.signer
and hs.id_card = ${@id_no})) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
and cb.id_card_no_leg = ${@id_no})) or
(${@account_type} = 'LP' and exists
(select 1
from con_contract_bp cb, hls_bp_master hb
where cb.bp_id = hb.bp_id
and cb.contract_id = t1.contract_id
and hb.social_code = ${@id_no})))) con_num
(select 1
from con_contract_bp ccb, hls_bp_master hb
where ccb.bp_id = hb.bp_id
and ccb.contract_id = t1.contract_id
and (ccb.bp_category in ('TENANT', 'GUARANTOR') and
(ccb.id_card_no = ${@id_no} or ccb.id_no_sp = ${@id_no})))) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs
where hs.hls_bp_signer_id = t1.signer
and hs.id_card = ${@id_no})
and exists (select 1 from hls_bp_master hbm
where hbm.bp_id = t1.bp_id_tenant
and hbm.social_code = ${@organization_id})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs,con_contract_change_req cr
where hs.hls_bp_signer_id = cr.signer
and cr.change_req_id = t1.contract_id
and hs.id_card = ${@id_no})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)
) or
(${@account_type} = 'AG' and exists
(select 1
from con_contract_bp cb,hls_bp_master hbm
where cb.contract_id = t1.contract_id
and cb.bp_category = 'GUARANTOR'
and cb.bp_class = 'ORG'
and cb.bp_id = hbm.bp_id
and hbm.social_code = ${@organization_id}
and cb.id_card_no_leg = ${@id_no})) or
(${@account_type} = 'LP' and exists
(select 1
from con_contract_bp cb, hls_bp_master hb
where cb.bp_id = hb.bp_id
and cb.contract_id = t1.contract_id
and hb.social_code = ${@id_no})))) con_num
from dual) v
]]></bm:query-sql>
</bm:operation>
......
......@@ -13,12 +13,14 @@
if(contractStatus == null || contractStatus == ""){
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId,
contract_status:contractStatus
});
}
......@@ -27,12 +29,14 @@
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId,
contract_number:inputData
});
}else{
contract_list_map = contract_list_bm.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId,
contract_number:inputData,
contract_status:contractStatus
});
......
......@@ -9,7 +9,8 @@
var statusFlag_query = $bm('wx.WX100.con_contract_status_query');
statusFlag_map = statusFlag_query.queryAsMap({
id_no:$ctx.parameter.idNo,
account_type:$ctx.parameter.accountType
account_type:$ctx.parameter.accountType,
organization_id:$ctx.parameter.organizationId
});
var statusFlag_details = statusFlag_map.getChildren();
statusFlag = statusFlag_details[0].statusFlag;
......
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