Commit e3cb08b4 authored by chenzhuo's avatar chenzhuo

查询接口调整

parent 29eeb8d4
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
end) as cf_status_n --支付状态 end) as cf_status_n --支付状态
from con_contract_cashflow cc from con_contract_cashflow cc
where cc.contract_id = ${@contract_id} where cc.contract_id = ${@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' and cc.cf_status = 'RELEASE'
order by cc.times order by cc.cf_item,cc.times
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
...@@ -3,17 +3,72 @@ ...@@ -3,17 +3,72 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
select decode(v.con_num,0,'N','Y') statusFlag from ( select decode(v.con_num, 0, 'N', 'Y') statusFlag
select count(1) con_num from con_contract cc from
where cc.data_class in ('NORMAL','CHANGE_REQ') (select (select count(1)
and cc.sign_type = 'ELE_SIGN' from con_contract t1
and cc.sign_contract_status = 'SIGNING' where t1.data_class in ('NORMAL','CHANGE_REQ')
and cc.ec_sign_type in ('INITIATE', 'SIGNING') and t1.ec_sign_type in ('INITIATE', 'SIGNING')
and cc.contract_id in ( and t1.sign_type = 'ELE_SIGN'
select distinct t.contract_id from CON_CONTRACT_ELE_SIGNER t and ((${@account_type} = 'PE' and exists
where t.bp_name = ${@bp_name} (select 1
and t.id_no = ${@id_no} from con_contract_bp ccb, hls_bp_master hb
and t.id_type = 'IdCard')) v 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
from dual) v
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
try { try {
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({
bp_name:$ctx.parameter.name, id_no:$ctx.parameter.idNo,
id_no:$ctx.parameter.idNo account_type:$ctx.parameter.accountType
}); });
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