|
@@ -109,6 +109,13 @@
|
|
GROUP BY CMPN_CD, STD_YM, CC_CD, ADVENT
|
|
GROUP BY CMPN_CD, STD_YM, CC_CD, ADVENT
|
|
) D ON D.CMPN_CD = A.CMPN_CD AND D.STD_YM = A.STD_YM AND D.CC_CD = A.CC_CD
|
|
) D ON D.CMPN_CD = A.CMPN_CD AND D.STD_YM = A.STD_YM AND D.CC_CD = A.CC_CD
|
|
LEFT JOIN CON_PJT_RESN E ON E.CMPN_CD = A.CMPN_CD AND E.STD_YM = A.STD_YM AND E.CC_CD = A.CC_CD
|
|
LEFT JOIN CON_PJT_RESN E ON E.CMPN_CD = A.CMPN_CD AND E.STD_YM = A.STD_YM AND E.CC_CD = A.CC_CD
|
|
|
|
+ JOIN (
|
|
|
|
+ SELECT DISTINCT B.CMPN_CD, A.CD_SITE
|
|
|
|
+ FROM WC_S_SITEAUTH@ERPSQL A
|
|
|
|
+ JOIN SM_COM_CMPN B ON B.MAP_CMPN_CD = A.CD_COMPANY
|
|
|
|
+ WHERE B.CMPN_CD = #{cmpnCd}
|
|
|
|
+ AND A.ID_USER LIKE CASE WHEN #{empNo} IN (SELECT SPEC_CD FROM SM_COM_COMMCD_D A, SM_COM_COMMCD B WHERE A.COMM_CD_ID = B.COMM_CD_ID AND B.COMM_CD = 'CO003' AND A.USE_YN = 'Y') THEN '%' ELSE #{empNo} END
|
|
|
|
+ ) Z ON Z.CMPN_CD = A.CMPN_CD AND Z.CD_SITE = A.CC_CD
|
|
WHERE A.CMPN_CD = #{cmpnCd}
|
|
WHERE A.CMPN_CD = #{cmpnCd}
|
|
AND A.STD_YM = #{stdYm}
|
|
AND A.STD_YM = #{stdYm}
|
|
AND A.CC_CD NOT IN (SELECT SPEC_CD FROM SM_COM_COMMCD_D A, SM_COM_COMMCD B WHERE A.COMM_CD_ID = B.COMM_CD_ID AND B.COMM_CD = 'CO004' AND A.USE_YN = 'Y')
|
|
AND A.CC_CD NOT IN (SELECT SPEC_CD FROM SM_COM_COMMCD_D A, SM_COM_COMMCD B WHERE A.COMM_CD_ID = B.COMM_CD_ID AND B.COMM_CD = 'CO004' AND A.USE_YN = 'Y')
|