하위조직 가지고 오기

Posted by MD워시퍼
2010. 1. 18. 17:20 Study
728x90
AND NVL(EMP.ORG_CD_SET,EMP.ORG_CD) IN ( SELECT ORG_CD
                     FROM ORM_ORG_C
                    WHERE F_ORM_ORG_LINE(ORG_CD, '2', TRUNC(SYSDATE)) LIKE F_ORM_ORG_LINE(NVL(?, '100000') , '2', TRUNC(SYSDATE))||'%'
                      AND TRUNC(SYSDATE) BETWEEN STA_YMD AND END_YMD
                    )

2010년 1월 14일 피평가자별 조회화면(팝업)

Posted by MD워시퍼
2010. 1. 14. 20:17 Study
728x90
SELECT BASE.COMPANY_CD
     , RESULT.EMP_NO
     , F_COM_EMP_NM2(BASE.COMPANY_CD,RESULT.EMP_NO) AS EMP_NM
     , RESULT.EVAL_GROUP
     , KPI_POINT1
     , DECODE(?,1,NULL,KPI_POINT2) AS KPI_POINT2
     , COMPE_POINT1
     , DECODE(?,1,NULL,COMPE_POINT2) AS COMPE_POINT2
     , AVG(DECODE(?,1,KPI_POINT1,2,KPI_POINT2)) OVER (PARTITION BY RESULT.EVAL_GROUP) AS AVG_KPI_POINT
     , AVG(DECODE(?,1,COMPE_POINT1,2,COMPE_POINT2)) OVER (PARTITION BY RESULT.EVAL_GROUP) AS AVG_COMPE_POINT
  FROM EEM_EVAL_RESULT RESULT
     , EEM_SET_EMP EMP
     , PM_BASE BASE
 WHERE RESULT.EMP_NO = EMP.EMP_NO
   AND RESULT.EVAL_ID = EMP.EVAL_ID
   AND RESULT.EVAL_CLASS = EMP.EVAL_CLASS
   AND EMP.EVAL_ID = BASE.EVAL_ID
   AND RESULT.EVAL_ID = ?
   AND RESULT.EVAL_CLASS = ?
   AND ? = decode(?,'1',EMP.ONE_EMP_NO,'2',EMP.TWO_EMP_NO)
   ORDER BY RESULT.EVAL_GROUP