Commit 0ad5886d by 傅伟强-富德

Update 部门对于服务人员设置

1 parent 4508363c
Showing with 84 additions and 3 deletions
参数:
参数:
......@@ -141,9 +141,91 @@ N:表示不能进行服务,Y表示可以服务
2.3:判断人员类型是否可以服务这个部门
2.3.1:查询岗位:select a.position from staff_info a where a.emp_no = p_emp_no;
如果有在途的申请岗位,则以申请为准
select rsch.post_code
from renewal_staff_change_history rsch
where rsch.emp_no = p_emp_no
and rsch.pk_serial =
(select max(rs.pk_serial)
from renewal_staff_change_history rs
where rs.emp_no = p_emp_no
and rs.change_status = '2'
and rs.change_type = '04' --04 岗位异动
and rs.start_date > sysdate);
2.3.2:查询银代兼收权限 02银代 --------可能不需要校验
select a.market_flag, a.bank_flag, a.agent_flag
from renewal_staff_info_other a
where a.emp_no = p_emp_no;
如果有在途申请的权限,则以申请的为准
select rsch.market_flag, rsch.bank_flag, rsch.agent_flag
from renewal_staff_change_history rsch
where rsch.emp_no = p_emp_no
and rsch.pk_serial =
(select max(rs.pk_serial)
from renewal_staff_change_history rs
where rs.emp_no = p_emp_no
and rs.change_status = '2'
and (p_priv_flag = '01' and rs.change_type in ('16','04','05') or
p_priv_flag = '02' and rs.change_type in ('11','04','05') or
p_priv_flag = '03' and rs.change_type in ('13','04','05'))
and rs.start_date > sysdate);
p_priv_flag 权限类型,01个险,02银代,03经代
取银代
if p_priv_flag = '01' then
v_other_priv := v_market_flag;
elsif p_priv_flag = '02' then
v_other_priv := v_bank_flag;
elsif p_priv_flag = '03' then
v_other_priv := v_agent_flag;
end if;
2.3.3:--在职督导,银代督导只能督导,不做服务
if v_position in ('13','15') then
return('N');
end if;
2.3.4:个险只能服务个险部门
select di.dept_type,di.branch_code
into v_dept_type,v_dept_branch
from department_info di
where di.dept_no = p_dept_no;
if v_position in ('12','13','14') and v_dept_type not in ('01','06') then
return('N');
end if;
2.3.5:人员是否和部门在一个三级机构下 ----这个校验上个流程有,只需要调用就可以
2.4:判断这个部门是否已经存在服务人员,如果有,作废原记录
select count(*)
into v_count
from rn_dept_servicer a
where a.dept_no = p_dept_no
and a.is_valid = 'Y';
废除:
update rn_dept_servicer rds
set rds.is_valid = 'N'
where rds.dept_no = p_dept_no
and rds.is_valid = 'Y';
2.5:符合条件则 写入部门对于服务人员表表记录
2.4:判断这个部门是否已经存在督导,如果有,作废原记录
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!