Commit 959ca7c0 authored by chenzhuo's avatar chenzhuo

合同查询

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