Browse Source

현장조회권한 수정

SBK 1 year ago
parent
commit
4c7fdc311f

+ 5 - 6
src/main/resources/sqlmap/mappers/co/co0102/CO01020001UMapper.xml

@@ -120,12 +120,11 @@
 								) 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
 					  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')

+ 5 - 6
src/main/resources/sqlmap/mappers/co/co0103/CO01030001UMapper.xml

@@ -119,12 +119,11 @@
 					 GROUP BY CMPN_CD, STD_YM, CC_CD
 	  			) G ON G.CMPN_CD = A.CMPN_CD AND G.STD_YM = A.STD_YM AND G.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') 

+ 15 - 18
src/main/resources/sqlmap/mappers/co/co0105/CO01050001UMapper.xml

@@ -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') 

+ 15 - 18
src/main/resources/sqlmap/mappers/co/co0108/CO01080001UMapper.xml

@@ -18,12 +18,11 @@
 		  FROM CON_PJT_MST A
 		  LEFT JOIN CON_PJT_RESN B ON B.CMPN_CD = A.CMPN_CD AND B.STD_YM = A.STD_YM AND B.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') 
@@ -49,12 +48,11 @@
 		  FROM CON_PJT_MST A
 		  LEFT JOIN CON_PJT_RESN B ON B.CMPN_CD = A.CMPN_CD AND B.STD_YM = A.STD_YM AND B.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') 
@@ -94,12 +92,11 @@
 		          LEFT JOIN WC_Z_ETEC_PJT_PROGRESS@ERPSQL C ON C.CD_COMPANY = B.MAP_CMPN_CD AND C.CD_SITE = A.CC_CD AND SUBSTR(C.YM_PROG,0,6) = A.STD_YM
 		          LEFT JOIN CON_PJT_RESN D ON A.CMPN_CD = D.CMPN_CD AND A.STD_YM = D.STD_YM AND A.CC_CD = D.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}
 		        <if test="ccgrpCd != 'all'">

+ 5 - 6
src/main/resources/sqlmap/mappers/co/co0109/CO01090001UMapper.xml

@@ -40,12 +40,11 @@
 					 GROUP BY A.CMPN_CD, A.STD_YM, A.CC_CD
 		  		) 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 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') 

+ 5 - 6
src/main/resources/sqlmap/mappers/co/copop/COPOPMapper.xml

@@ -10,12 +10,11 @@
 		     , A.CC_NM
 		  FROM CON_PJT_MST A
 		  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')