|
@@ -66,12 +66,11 @@
|
|
|
) D ON D.CMPN_CD = A.CMPN_CD AND D.CCGRP_CD = A.CCGRP_CD 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
|
|
|
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
|
|
|
+ SELECT DISTINCT CMPN_CD, SITE_CD
|
|
|
+ FROM CON_PJT_USERAUTH
|
|
|
+ WHERE CMPN_CD = #{cmpnCd}
|
|
|
+ AND USER_ID 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.SITE_CD = A.CC_CD
|
|
|
WHERE A.CMPN_CD = #{cmpnCd}
|
|
|
AND A.STD_YM = #{stdYm}
|
|
|
AND NVL(D.DORE,0) + NVL(D.MIDORE,0) <![CDATA[>=]]> #{unit2}
|
|
@@ -112,12 +111,11 @@
|
|
|
) B ON B.CMPN_CD = A.CMPN_CD AND B.STD_YM = A.STD_YM AND B.CC_CD = A.CC_CD
|
|
|
LEFT JOIN CON_PJT_RESN C ON C.CMPN_CD = A.CMPN_CD AND C.STD_YM = A.STD_YM AND C.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
|
|
|
+ SELECT DISTINCT CMPN_CD, SITE_CD
|
|
|
+ FROM CON_PJT_USERAUTH
|
|
|
+ WHERE CMPN_CD = #{cmpnCd}
|
|
|
+ AND USER_ID 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.SITE_CD = A.CC_CD
|
|
|
WHERE A.CMPN_CD = #{cmpnCd}
|
|
|
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')
|
|
@@ -147,12 +145,11 @@
|
|
|
) B ON B.CMPN_CD = A.CMPN_CD AND B.STD_YM = A.STD_YM AND B.CC_CD = A.CC_CD
|
|
|
LEFT JOIN CON_PJT_RESN C ON C.CMPN_CD = A.CMPN_CD AND C.STD_YM = A.STD_YM AND C.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
|
|
|
+ SELECT DISTINCT CMPN_CD, SITE_CD
|
|
|
+ FROM CON_PJT_USERAUTH
|
|
|
+ WHERE CMPN_CD = #{cmpnCd}
|
|
|
+ AND USER_ID 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.SITE_CD = A.CC_CD
|
|
|
WHERE A.CMPN_CD = #{cmpnCd}
|
|
|
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')
|