Commit f8d11273 by 傅伟强-富德

Update sql

1 parent 7a226527
Showing with 32 additions and 9 deletions
......@@ -24,16 +24,39 @@ update GRAS_DEPT_SERVICER
select * from(
select rownum as rowno,gbe.bank_code,di.dept_name, si.emp_no,si.emp_name,bi.branch_code,bi.branch_name,gbe.PK_SERIAL
from GRAS_BANK_EMP
gbe, staff_info si,
department_info di,
branch_info bi
where gbe.emp_no=si.emp_no and si.dept_no=di.dept_no and di.branch_code=bi.branch_code and gbe.END_DATE is null and bi.branch_code=? and rownum <= ?*? ) table_alias where table_alias.rowno>(?-1)*?
select count(1) from branch_info bi where bi.branch_level='03' and bi.branch_code='864110' and bi.parent_branch='8641'
SELECT ppi.policy_no
FROM policy_prem_info ppi,
policy p,
rn_policy_service_info rpsi,
branch_code_relation bcr,
policy_product e
WHERE ppi.prem_status = '1'
AND ppi.policy_no = p.policy_no
AND p.channel_type IN ('01', '02', '04', '05', '07')
AND ppi.prem_source = '1'
AND ppi.prem_due_date >= c_start_date
AND ppi.prem_due_date < c_end_date
AND ppi.policy_no = rpsi.policy_no
AND rpsi.orphan_mark = '1'
AND ppi.policy_no = p.policy_no
--and p.branch_code = bcr.relative_branch_code
--DMP-9274 保单分配记忆和标记功能 20150803
--调整为:只考虑正常分单(01、null)和跨机构分单(03)
AND (rpsi.assign_rule IN ('01', '02') OR rpsi.assign_rule IS NULL)
AND (CASE
WHEN rpsi.assign_rule = '01' OR rpsi.assign_rule IS NULL THEN
p.branch_code
WHEN rpsi.assign_rule = '02' THEN
rpsi.assign_branch_code
END) = bcr.relative_branch_code
AND bcr.branch_code = p_assign_branch_code
--排除归属于二级机构的保单
AND bcr.relative_grade < 1
--AND (select bi.branch_level from branch_info bi where bi.branch_code = bcr.relative_branch_code) <> '02'
AND p.policy_no = e.policy_no
AND e.prod_seq = 1
AND e.product_code not in('CBAN_TN1','CBAN_UN1','CBAN_VN1');
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!