博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

查询产品线相关人员

Posted on 2012-03-07 16:43  奥客  阅读(108)  评论(0编辑  收藏  举报

SELECT FU.USER_NAME,
       PAPF.FULL_NAME,
       PPD.SEGMENT1,
       PPD.SEGMENT2,
       SSSS.SEGMENT1,
       SSSS.SEGMENT2,
       SSSS.START_DATE_ACTIVE,
       SSSS.END_DATE_ACTIVE,
       FU.EMPLOYEE_ID,
       SSSS.USER_ID
        
       FROM
        
         secom.oa_SECOM_SRP_SBC_SECURITY   SSSS,
       secom.oa_FND_USER                 FU,
       secom.oa_PER_ALL_PEOPLE_F         PAPF,
       secom.oa_per_position_definitions ppd,
       secom.oa_per_all_assignments_f    PAA,
               secom.oa_PER_ALL_POSITIONS  P
       where SSSS.USER_ID = FU.USER_ID AND PAPF.PERSON_ID(+) = FU.EMPLOYEE_ID AND
       PAPF.PERSON_ID = PAA.PERSON_ID(+) AND
       PAA.POSITION_ID = P.POSITION_ID AND
       P.POSITION_DEFINITION_ID =PPD.POSITION_DEFINITION_ID AND
       --PAA.POSITION_ID = PPD.POSITION_DEFINITION_ID(+) AND
       SYSDATE BETWEEN PAPF.EFFECTIVE_START_DATE(+) AND
       PAPF.EFFECTIVE_END_DATE(+) AND PAA.ASSIGNMENT_TYPE(+) = 'E' AND
       SYSDATE BETWEEN PAA.EFFECTIVE_START_DATE(+) AND
       PAA.EFFECTIVE_END_DATE(+) AND ( PPD.SEGMENT2 IN ('应用工程师','市场经理','技术总监','总监' ))
       and (ssss.END_DATE_ACTIVE IS NULL OR ssss.END_DATE_ACTIVE>SYSDATE)
         and  ssss.segment1 like 'EMC%'
        
       AND ((ssss.segment1='"+Args[0]+"' AND ssss.SEGMENT2='"+Args[1]+"') or  
       (ssss.segment1='"+Args[0]+"' AND ssss.segment2 is null))