Browse Source

Over View Week 쿼리 수정

DESKTOP-HMLPH8S\kim 2 years ago
parent
commit
1d6c74882e

+ 7 - 5
src/main/resources/sqlmap/mappers/cw/cw0902/CW09020001UMapper.xml

@@ -63,19 +63,19 @@
 			  FROM (
 				 		SELECT A1.CMPN_CD
 						     , A1.DEPT_CD
-						     , CASE WHEN A1.DEPT_LEVEL != 1 THEN (SELECT C.DEPT_NM FROM ZEHR_COM_DEPT C WHERE C.CMPN_CD = A1.CMPN_CD AND C.DEPT_CD = A1.P_DEPT_CD) 
-						            WHEN A1.DEPT_LEVEL = 1 THEN A1.DEPT_NM END AS DEPT_MAIN_NM
+						     , A1.CD_CCGRP
+							 , A1.NM_CCGRP
 						     , A1.DEPT_NM
 						     , A1.DEPT_LEVEL
-						     , A1.P_DEPT_CD
 						     , A1.WORK_BASEDATE_FROM
 						     , A1.COUNT_1 
 						  FROM (
 						  			SELECT DISTINCT A.CMPN_CD
+						  				 , A.CD_CCGRP
+										 , A.NM_CCGRP
 									     , A.DEPT_CD
 									     , A.DEPT_NM
 									     , A.DEPT_LEVEL
-									     , A.P_DEPT_CD
 									     , B.WORK_BASEDATE_FROM
 									     , CASE WHEN COUNT(B.WORK_BASEDATE_FROM) > 0 THEN '1' 
 										        WHEN COUNT(B.WORK_BASEDATE_FROM) = 0 OR COUNT(B.WORK_BASEDATE_FROM) = NULL THEN '' END AS COUNT_1  
@@ -83,7 +83,7 @@
 									  LEFT JOIN ZEHR_WEEK_WORK B ON A.CMPN_CD = B.CMPN_CD AND A.DEPT_CD = B.DEPT_CD
 									 WHERE A.CMPN_CD = #{cmpnCd}
 									   AND A.USE_YN = 'Y'
-									 GROUP BY A.CMPN_CD, A.DEPT_CD, A.DEPT_NM, A.DEPT_LEVEL, A.P_DEPT_CD, B.WORK_BASEDATE_FROM
+									 GROUP BY A.CMPN_CD, A.DEPT_CD, A.DEPT_NM, A.DEPT_LEVEL, A.CD_CCGRP, A.NM_CCGRP, B.WORK_BASEDATE_FROM
 			  					) A1
 		 			)
 		   PIVOT ( AVG(COUNT_1)                                                          
@@ -92,6 +92,8 @@
 		           		${name}
 		           )                                   
 			)
+		WHERE LENGTH(DEPT_CD) NOT IN ('2')	<!-- 본부 안나오게... -->
+		ORDER BY CD_CCGRP
 	 </select><!-- AND A.DEPT_LEVEL NOT IN ('1') --><!-- AND SUBSTR(TO_CHAR(B.WORK_BASEDATE_FROM, 'YYYYMMDD'), 0, 6) = #{workMonth1} -->
 	 
 	 <select id="selectHeaderUpList" parameterType="map" resultType="easyHashMap">

+ 1 - 1
src/main/webapp/ux/cw/cw0902/CW09020001U.xml

@@ -181,7 +181,7 @@
 		       	;
 
 				gridBody = '<w2:row id="row5" style="">'
-								+'<w2:column blockSelect="false" id="deptMainNm" inputType="text" width="430" readOnly="true" textAlign="left">'
+								+'<w2:column blockSelect="false" id="nmCcgrp" inputType="text" width="430" readOnly="true" textAlign="left">'
 								+'</w2:column>'
 								+'<w2:column blockSelect="false" id="deptNm" inputType="text" textAlign="left" width="458" readOnly="true">'
 								+'</w2:column>'