itn 2023-10-20
문자 재전송 목록 성능개선
@45807ed23afd6021b700a2847865686f89d12565
src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
--- src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
+++ src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
@@ -6034,7 +6034,7 @@
 			mjonMsgSentVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
 			
 	    	//전체 발송 리스트 불러오기
-	    	mjMsgSentList = mjonMsgSentService.selectAllMsgSentList(mjonMsgSentVO);
+	    	mjMsgSentList = mjonMsgSentService.selectAllMsgSentSimpleList(mjonMsgSentVO);
 	    	
 	    	paginationInfo.setTotalRecordCount( mjMsgSentList.size()> 0 ? (Integer.parseInt((mjMsgSentList.get(0)).getTotMsgCnt())) : 0);
     	}
src/main/java/itn/let/mjo/msgsent/service/MjonMsgSentService.java
--- src/main/java/itn/let/mjo/msgsent/service/MjonMsgSentService.java
+++ src/main/java/itn/let/mjo/msgsent/service/MjonMsgSentService.java
@@ -16,6 +16,9 @@
 	//발송 관리 전체 발송 리스트 불러오기
 	public List<MjonMsgSentVO> selectAllMsgSentList(MjonMsgSentVO mjonMsgSentVO) throws Exception;
 	
+	//발송 관리 전체 발송 리스트 불러오기 => 주소록 조인 제거버전
+	public List<MjonMsgSentVO> selectAllMsgSentSimpleList(MjonMsgSentVO mjonMsgSentVO) throws Exception;
+	
 	//발송 관리 발송 성공,실패 건수 리스트 불러오기
 	public List<MjonMsgSentVO> selectAllMsgSentSucFailList(List<MjonMsgSentVO> resultAllResList, MjonMsgSentVO mjonMsgSentVO) throws Exception;
 	
src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentDAO.java
--- src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentDAO.java
+++ src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentDAO.java
@@ -49,12 +49,20 @@
 		return result;
 	}
 	
+	//발송 관리 전체 발송 리스트 불러오기
 	@SuppressWarnings("unchecked")
 	public List<MjonMsgSentVO> selectAllMsgSentList(MjonMsgSentVO mjonMsgSentVO) throws Exception{
 		
 		return (List<MjonMsgSentVO>) list("MjonMsgSentDAO.selectAllMsgSentList",mjonMsgSentVO);
 	}
 	
+	//발송 관리 전체 발송 리스트 불러오기 => 주소록 조인 제거버전
+	@SuppressWarnings("unchecked")
+	public List<MjonMsgSentVO> selectAllMsgSentSimpleList(MjonMsgSentVO mjonMsgSentVO) throws Exception{
+		
+		return (List<MjonMsgSentVO>) list("MjonMsgSentDAO.selectAllMsgSentSimpleList",mjonMsgSentVO);
+	}
+	
 	@SuppressWarnings("unchecked")
 	public List<MjonMsgSentVO> selectAllPrivateMsgSentList(MjonMsgSentVO mjonMsgSentVO) throws Exception{
 		
src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentServiceImpl.java
--- src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentServiceImpl.java
+++ src/main/java/itn/let/mjo/msgsent/service/impl/MjonMsgSentServiceImpl.java
@@ -84,6 +84,15 @@
 		return resultList;
 	}
 	
+	//발송 관리 전체 발송 리스트 불러오기 => 주소록 조인 제거버전
+	public List<MjonMsgSentVO> selectAllMsgSentSimpleList(MjonMsgSentVO mjonMsgSentVO) throws Exception{
+		List<MjonMsgSentVO> resultList = new ArrayList<MjonMsgSentVO>();
+		
+		resultList = mjonMsgSentDAO.selectAllMsgSentSimpleList(mjonMsgSentVO);
+
+		return resultList;
+	}
+	
 	//발송 관리 발송 성공,실패 건수 리스트 불러오기
 	public List<MjonMsgSentVO> selectAllMsgSentSucFailList(List<MjonMsgSentVO> resultAllResList, MjonMsgSentVO mjonMsgSentVO) throws Exception{
 		
src/main/resources/egovframework/sqlmap/let/msg/MjonMsgSent_SQL_mysql.xml
--- src/main/resources/egovframework/sqlmap/let/msg/MjonMsgSent_SQL_mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/msg/MjonMsgSent_SQL_mysql.xml
@@ -319,14 +319,6 @@
 				<![CDATA[ 
 					AND B.REQ_DATE <= DATE_ADD(NOW(), INTERVAL 60 MINUTE)
 				]]>
-				<isNotEmpty property="msgSentType">
-					<isEqual property="msgSentType" compareValue="01" >
-						AND B.MSG_KIND != 'C'
-					</isEqual>
-					<isEqual property="msgSentType" compareValue="02" >
-						AND B.MSG_KIND = 'C'
-					</isEqual>
-				</isNotEmpty>				
 			)M
 			LEFT JOIN
 			(
@@ -340,6 +332,185 @@
 				GROUP BY ADDR_PHONE_NO
 			)MA
 			ON M.CALL_TO = MA.ADDR_PHONE_NO
+		WHERE 1=1 
+			<isNotEmpty property="stateType">
+				<isEqual property="stateType" compareValue="all">
+					AND CUR_STATE IN ('0','1','2','3')
+				</isEqual>
+				<isEqual property="stateType" compareValue="ready">
+					AND CUR_STATE = '0'
+					AND RESERVE_C_YN = 'N'
+				</isEqual>
+				<isEqual property="stateType" compareValue="complete">
+					AND CUR_STATE IN ('2','3')
+					AND (RSLT_CODE IN ('0','100','101','110','4100','6600','1000','1001')  OR 	 RSLT_CODE2 IN ('0') )
+					AND	 RESERVE_C_YN = 'N'
+				</isEqual>
+				<isEqual property="stateType" compareValue="fail">
+					AND RESERVE_C_YN = 'N'
+					AND (RSLT_CODE NOT IN ('0','100','101','110','4100','6600','1000','1001')  OR 	 RSLT_CODE2 NOT IN ('0') )
+				</isEqual>
+			</isNotEmpty>
+			<isNotEmpty property="searchMsgType">
+				<isEqual property="searchMsgType" compareValue="S">
+					AND MSG_TYPE = '4'
+				</isEqual>
+				<isEqual property="searchMsgType" compareValue="L">
+					AND MSG_TYPE = '6'
+					AND FILE_CNT = '0'
+				</isEqual>
+				<isEqual property="searchMsgType" compareValue="M">
+				<![CDATA[  
+					AND MSG_TYPE = '6'
+					AND FILE_CNT > '0'
+				]]>
+				</isEqual>
+			</isNotEmpty>
+			<isEmpty property="searchMsgType">
+				<isEmpty property="tabType">
+					AND MSG_TYPE IN ('4','6')
+				</isEmpty>
+			</isEmpty>
+			<isNotEmpty property="tabType">
+				<isEqual property="tabType" compareValue="all">
+					AND MSG_TYPE IN ('4','6')
+				</isEqual>
+				<isEqual property="tabType" compareValue="S">
+					AND MSG_TYPE = '4'
+				</isEqual>
+				<isEqual property="tabType" compareValue="L">
+					AND MSG_TYPE = '6'
+					AND FILE_CNT = '0'
+				</isEqual>
+				<isEqual property="tabType" compareValue="M">
+				<![CDATA[  
+					AND MSG_TYPE = '6'
+					AND FILE_CNT > '0'
+				]]>
+				</isEqual>
+			</isNotEmpty>
+			<isNotEmpty property="searchKeyword">
+				<isEqual property="searchCondition" compareValue="1" >
+					AND SUBJECT LIKE CONCAT('%', #searchKeyword#, '%')
+				</isEqual>
+				<isEqual property="searchCondition" compareValue="2" >
+					AND CALL_FROM LIKE CONCAT('%', #searchKeyword#, '%')
+				</isEqual>
+				<isEqual property="searchCondition" compareValue="3" >
+					AND CALL_TO LIKE CONCAT('%', #searchKeyword#, '%')
+				</isEqual>
+			</isNotEmpty>
+			<isNotEmpty property="searchCondition_01">
+				AND sendKind = #searchCondition_01#
+			</isNotEmpty>
+			<isNotEmpty property="startDate">
+				<![CDATA[ 
+					AND DATE_FORMAT(REGDATE, '%Y-%m-%d') >= DATE_FORMAT(#startDate#, '%Y-%m-%d')
+				]]>
+			</isNotEmpty>
+			<isNotEmpty property="endDate">
+				<![CDATA[ 
+					AND 	DATE_FORMAT(REGDATE, '%Y-%m-%d')  <=  DATE_FORMAT(#endDate#, '%Y-%m-%d')  
+				]]>
+			</isNotEmpty>
+		GROUP BY MSG_GROUP_ID
+		ORDER BY 1=1
+		<isNotEmpty property="searchSortCnd">
+			<isEqual property="searchSortCnd" compareValue="curState">
+				, curState  $searchSortOrd$
+				, orderByrsltCode
+			</isEqual>
+			<isNotEqual  property="searchSortCnd" compareValue="curState">
+				,$searchSortCnd$
+			</isNotEqual>
+		</isNotEmpty>
+		<isNotEmpty property="searchSortOrd">
+			$searchSortOrd$
+		</isNotEmpty>
+		LIMIT  #recordCountPerPage# OFFSET #firstIndex#	
+	</select>
+	
+	<!-- 전체 발송결과 조회  (전송사별) => 주소록 조인 제거버전-->
+	<select id="MjonMsgSentDAO.selectAllMsgSentSimpleList" parameterClass="mjonMsgSentVO" resultClass="mjonMsgSentVO">
+		SELECT
+			COUNT(USER_ID) OVER()					 AS totMsgCnt
+			, USER_ID								 AS userId
+			, MSG_GROUP_ID							 AS msgGroupId
+			, MSG_GROUP_CNT							 AS msgGroupCnt
+			, SMS_TXT								 AS smsTxt
+			, SUBJECT								 AS subject
+			, DATE_FORMAT(REGDATE, '%Y-%m-%d %T')	 AS regdate
+			, DATE_FORMAT(REQ_DATE, '%Y-%m-%d %T')	 AS reqdate
+			, CALL_FROM								 AS callFrom
+			, CALL_TO								 AS callTo
+			, FN_GETHYPHEN(CALL_FROM)	AS callFromComma
+			, FN_GETHYPHEN(CALL_TO)		AS callToComma
+			, ''						 AS addrNm
+			, TOT_PRICE								 AS totPrice
+			, EACH_PRICE							 AS eachPrice
+			, CUR_STATE								 AS curState
+			, RSLT_CODE								 AS rsltCode
+			, RSLT_CODE2							 AS rsltCode2
+			, DEL_FLAG						 AS delFlag
+			, MSG_TYPE						 AS msgType
+			, FILE_CNT						 AS fileCnt
+			, AGENT_CODE					 AS agentCode
+			, RESERVE_C_YN					 AS reserveCYn
+			, CANCELDATE					 AS cancelDate
+			, ''							 AS msgId
+			, orderByCode					 AS orderByCode
+			, sendKind						 AS sendKind
+			, MSG_KIND						 AS msgKind
+		FROM
+			( SELECT
+				B.USER_ID
+				, B.MSG_GROUP_ID
+				, B.MSG_GROUP_CNT
+				, B.SMS_TXT
+				, B.SUBJECT
+				, B.REGDATE
+				, B.REQ_DATE
+				, B.CALL_FROM
+				, B.TOT_PRICE
+				, B.EACH_PRICE
+				, B.DEL_FLAG
+				, B.MSG_TYPE
+				, B.FILE_CNT
+				, B.AGENT_CODE
+				, B.RESERVE_C_YN
+				, B.CANCELDATE
+				, A.MSG_SEQ
+				, A.CALL_TO
+				, A.CUR_STATE
+				, A.RSLT_CODE
+				, A.RSLT_CODE2
+				, B.SEND_KIND as sendKind
+				, B.MSG_KIND
+				, CASE
+					WHEN B.MSG_TYPE = '6'
+						AND B.FILE_CNT > 0
+					THEN '3'
+					WHEN B.MSG_TYPE = '6'
+						AND B.FILE_CNT = 0
+					THEN '2'
+					ELSE '1'
+					END orderByCode
+				<include refid="MjonMsgSentDAO.selectJoinQuery"/>
+				AND B.USER_ID = #userId#
+				AND B.DEL_FLAG ='N'
+				AND B.RESERVE_C_YN = 'N'
+				<![CDATA[ 
+					AND B.REQ_DATE <= DATE_ADD(NOW(), INTERVAL 60 MINUTE)
+				]]>
+				<isNotEmpty property="msgSentType">
+					<isEqual property="msgSentType" compareValue="01" >
+						AND B.MSG_KIND != 'C'
+					</isEqual>
+					<isEqual property="msgSentType" compareValue="02" >
+						AND B.MSG_KIND = 'C'
+					</isEqual>
+				</isNotEmpty>				
+			)M
 		WHERE 1=1 
 			<isNotEmpty property="stateType">
 				<isEqual property="stateType" compareValue="all">
@@ -444,8 +615,8 @@
 			$searchSortOrd$
 		</isNotEmpty>
 		LIMIT  #recordCountPerPage# OFFSET #firstIndex#	
-	</select>
-	
+	</select>	
+		
 	<!-- 전체 발송결과 조회  (개인별)-->
 	<select id="MjonMsgSentDAO.selectAllPrivateMsgSentList" parameterClass="mjonMsgSentVO" resultClass="mjonMsgSentVO">
 		
@@ -636,8 +807,6 @@
 		</isNotEmpty>
 		LIMIT  #recordCountPerPage# OFFSET #firstIndex#	
 	</select>
-	
-	
 	
 	<!-- 건수별 상세 리스트 조회-->
 	<select id="MjonMsgSentDAO.selectAllMsgSentDetailList" parameterClass="mjonMsgSentVO" resultClass="mjonMsgSentVO">
src/main/webapp/WEB-INF/jsp/web/msgdata/MsgSentListAjax.jsp
--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgSentListAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgSentListAjax.jsp
@@ -141,7 +141,7 @@
 							<col style="width: 11%;">
 							<col style="width: *%;">
 							<col style="width: 15%;">
-							<col style="width: 9%;">
+							<col style="width: 8%;">
 							<col style="width: 12%;">
 						</colgroup>
 						<thead>
Add a comment
List