유치채널 현황

This commit is contained in:
kubo8
2022-12-23 16:39:20 +09:00
parent e8d1856677
commit 973732962b
3 changed files with 159 additions and 159 deletions

View File

@@ -97,17 +97,20 @@
<form autocomplete="off"> <form autocomplete="off">
<table class="table-r"> <table class="table-r">
<colgroup> <colgroup>
<col width="16%" /> <col width="12%" />
<col width="16%" /> <col width="11%" />
<col width="16%" /> <col width="11%" />
<col width="16%" /> <col width="11%" />
<col width="16%" /> <col width="11%" />
<col width="20%" /> <col width="11%" />
<col width="11%" />
<col width="11%" />
<col width="11%" />
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th rowspan="2">날짜</th> <th rowspan="2">날짜</th>
<th colspan="5">채널별 발송 건수</th> <th colspan="8">채널별 발송 건수</th>
</tr> </tr>
<tr class="total"> <tr class="total">
<th>전체</th> <th>전체</th>
@@ -115,6 +118,9 @@
<th>LMS</th> <th>LMS</th>
<th>MMS</th> <th>MMS</th>
<th>알림톡</th> <th>알림톡</th>
<th>대체발송SMS</th>
<th>대체발송LMS</th>
<th>대체발송MMS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -125,6 +131,9 @@
<td>{{ sndCntLTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td> <td>{{ sndCntLTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ sndCntMTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td> <td>{{ sndCntMTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ sndCntATotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td> <td>{{ sndCntATotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ fbSndCntSTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ fbSndCntLTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ fbSndCntMTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
</tr> </tr>
<tr v-for="(option, i) in list" v-bind:key="i"> <tr v-for="(option, i) in list" v-bind:key="i">
<td>{{ option.sumYm }}</td> <td>{{ option.sumYm }}</td>
@@ -133,6 +142,9 @@
<td>{{ option.sndCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td> <td>{{ option.sndCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.sndCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td> <td>{{ option.sndCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.sndCntA.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td> <td>{{ option.sndCntA.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.fbSndCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.fbSndCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.fbSndCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -200,6 +212,9 @@ export default {
sndCntLTotal: 0, sndCntLTotal: 0,
sndCntMTotal: 0, sndCntMTotal: 0,
sndCntATotal: 0, sndCntATotal: 0,
fbSndCntSTotal: 0,
fbSndCntLTotal: 0,
fbSndCntMTotal: 0,
list: [], list: [],
totalCnt: '', totalCnt: '',
props: {}, props: {},
@@ -244,21 +259,31 @@ export default {
var sndCntLTotal = 0; var sndCntLTotal = 0;
var sndCntMTotal = 0; var sndCntMTotal = 0;
var sndCntATotal = 0; var sndCntATotal = 0;
var fbSndCntSTotal = 0;
var fbSndCntLTotal = 0;
var fbSndCntMTotal = 0;
if (result != null && result.retCode == '0000') { if (result != null && result.retCode == '0000') {
//데이터값이 널이면 오류처리 //데이터값이 널이면 오류처리
console.log(result.data.list);
for (var i = 0; i < result.data.list.length; i++) { for (var i = 0; i < result.data.list.length; i++) {
sndCntTotal = sndCntTotal + Number(result.data.list[i].sndCnt); sndCntTotal = sndCntTotal + Number(result.data.list[i].sndCnt);
sndCntSTotal = sndCntSTotal + Number(result.data.list[i].sndCntS); sndCntSTotal = sndCntSTotal + Number(result.data.list[i].sndCntS);
sndCntLTotal = sndCntLTotal + Number(result.data.list[i].sndCntL); sndCntLTotal = sndCntLTotal + Number(result.data.list[i].sndCntL);
sndCntMTotal = sndCntMTotal + Number(result.data.list[i].sndCntM); sndCntMTotal = sndCntMTotal + Number(result.data.list[i].sndCntM);
sndCntATotal = sndCntATotal + Number(result.data.list[i].sndCntA); sndCntATotal = sndCntATotal + Number(result.data.list[i].sndCntA);
fbSndCntSTotal = fbSndCntSTotal + Number(result.data.list[i].fbSndCntS);
fbSndCntLTotal = fbSndCntLTotal + Number(result.data.list[i].fbSndCntL);
fbSndCntMTotal = fbSndCntMTotal + Number(result.data.list[i].fbSndCntM);
} }
this.sndCntTotal = sndCntTotal; this.sndCntTotal = sndCntTotal;
this.sndCntSTotal = sndCntSTotal; this.sndCntSTotal = sndCntSTotal;
this.sndCntLTotal = sndCntLTotal; this.sndCntLTotal = sndCntLTotal;
this.sndCntMTotal = sndCntMTotal; this.sndCntMTotal = sndCntMTotal;
this.sndCntATotal = sndCntATotal; this.sndCntATotal = sndCntATotal;
this.fbSndCntSTotal = fbSndCntSTotal;
this.fbSndCntLTotal = fbSndCntLTotal;
this.fbSndCntMTotal = fbSndCntMTotal;
this.list = result.data.list; this.list = result.data.list;
this.sndCntS = result.data.sndCntS; this.sndCntS = result.data.sndCntS;
this.sndCntL = result.data.sndCntL; this.sndCntL = result.data.sndCntL;

View File

@@ -32,4 +32,16 @@ public class ChannelDetail implements Serializable {
@ApiModelProperty(example = "10", name = "알림톡 성공건수", dataType = "String") @ApiModelProperty(example = "10", name = "알림톡 성공건수", dataType = "String")
private String succCntA; private String succCntA;
@ApiModelProperty(example = "대체발송SMS 발송건수", name = "대체발송SMS 발송건수", dataType = "String")
private String fbSndCntS;
@ApiModelProperty(example = "대체발송SMS 성공건수", name = "대체발송SMS 성공건수", dataType = "String")
private String fbSuccCntS;
@ApiModelProperty(example = "대체발송LMS 발송건수", name = "대체발송LMS 발송건수", dataType = "String")
private String fbSndCntL;
@ApiModelProperty(example = "대체발송LMS 성공건수", name = "대체발송LMS 성공건수", dataType = "String")
private String fbSuccCntL;
@ApiModelProperty(example = "대체발송MMS 발송건수", name = "대체발송MMS 발송건수", dataType = "String")
private String fbSndCntM;
@ApiModelProperty(example = "대체발송MMS 성공건수", name = "대체발송MMS 성공건수", dataType = "String")
private String fbSuccCntM;
} }

View File

@@ -42,12 +42,12 @@
CUST_TY_NM CUST_TY_NM
, ( , (
SELECT SELECT
sum(IFNULL(ecm.SND_CNT,0) + IFNULL(ecm.FBACK_CNT,0)) sum(IFNULL(ecm.SND_CNT,0)) AS SND_CNT
FROM FROM
hubez_common.EZ_CUST_MSTAT ecm hubez_common.EZ_CUST_MSTAT ecm
WHERE WHERE
ecm.USER_SEQ = A.USER_SEQ ecm.USER_SEQ = A.USER_SEQ
AND ecm.SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH) AND ecm.SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -24 MONTH) AND NOW()
) AS SND_CNT ) AS SND_CNT
FROM FROM
( (
@@ -96,12 +96,12 @@
CUST_TY_NM CUST_TY_NM
, ( , (
SELECT SELECT
sum(IFNULL(ecm.SND_CNT,0) + IFNULL(ecm.FBACK_CNT,0)) sum(IFNULL(ecm.SND_CNT,0)) AS SND_CNT
FROM FROM
hubez_common.EZ_CUST_MSTAT ecm hubez_common.EZ_CUST_MSTAT ecm
WHERE WHERE
ecm.USER_SEQ = A.USER_SEQ ecm.USER_SEQ = A.USER_SEQ
AND ecm.SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH) AND ecm.SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -24 MONTH) AND NOW()
) AS SND_CNT ) AS SND_CNT
FROM FROM
( (
@@ -212,142 +212,105 @@
AND esu.USER_SEQ = #{userSeq} AND esu.USER_SEQ = #{userSeq}
</select> </select>
<select id="selectSndCountList" parameterType="kr.co.uplus.ez.api.attractMgt.dto.ChannelDetailReqDto" <select id="selectSndCountList" parameterType="kr.co.uplus.ez.api.attractMgt.dto.ChannelDetailReqDto" resultType="kr.co.uplus.ez.api.attractMgt.dto.ChannelDetail">
resultType="kr.co.uplus.ez.api.attractMgt.dto.ChannelDetail">
/* attractMgt-mapper.xml(selectSndCountList) */ /* attractMgt-mapper.xml(selectSndCountList) */
SELECT DATE_FORMAT(ecm.SUM_YM, '%Y-%m') AS sumYm SELECT
, ecm.SND_CNT SUM_YM AS sumYm, A.sndCnt, A.succCnt, A.sndCntS, A.succCntS, A.sndCntL, A.succCntL,
, ecm.SUCC_CNT A.sndCntM, A.succCntM, A.sndCntR AS sndCntA, A.succCntR AS succCntA, A.fbSndCntS, A.fbSuccCntS, A.fbSndCntL,
, S.SND_CNT AS SND_CNT_S A.fbSuccCntL, A.fbSndCntM, A.fbSuccCntM
, S.SUCC_CNT AS SUCC_CNT_S FROM
, L.SND_CNT AS SND_CNT_L
, L.SUCC_CNT AS SUCC_CNT_L
, M.SND_CNT AS SND_CNT_M
, M.SUCC_CNT AS SUCC_CNT_M
, A.SND_CNT AS SND_CNT_A
, A.SUCC_CNT AS SUCC_CNT_A
FROM (
SELECT SUM_YM
, USER_SEQ
, SUM(IFNULL(SND_CNT, 0) + IFNULL(FBACK_CNT, 0)) AS SND_CNT
, SUM(IFNULL(SUCC_CNT, 0) + IFNULL(FBACK_SUCC_CNT, 0)) AS SUCC_CNT
FROM hubez_common.EZ_CUST_MSTAT
WHERE 1 = 1
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH)
AND USER_SEQ = #{userSeq}
GROUP BY SUM_YM, USER_SEQ
) ecm,
( (
SELECT S1.SUM_YM SELECT
, S1.USER_SEQ DATE_FORMAT(S1.SUM_YM, '%Y-%m') AS SUM_YM,
, SUM(IFNULL(S1.SND_CNT, 0) + IFNULL(S2.FBACK_CNT, 0)) AS SND_CNT (SUM(S1.sndCntS) + SUM(S1.sndCntL) + SUM(S1.sndCntM) + SUM(S1.sndCntR)) AS sndCnt,
, SUM(IFNULL(S1.SUCC_CNT, 0) + IFNULL(S2.FBACK_SUCC_CNT, 0)) AS SUCC_CNT (SUM(S1.succCntS) + SUM(S1.succCntL) +SUM(S1.succCntM) +SUM(S1.succCntR) + SUM(fbSuccCntS) + SUM(fbSuccCntL)+ SUM(fbSuccCntM)) AS succCnt,
FROM (SELECT SUM_YM SUM(S1.sndCntS) AS sndCntS, SUM(S1.succCntS) AS succCntS, SUM(S1.sndCntL) AS sndCntL, SUM(S1.succCntL) AS succCntL, SUM(S1.sndCntM) AS sndCntM,
, USER_SEQ SUM(S1.succCntM) AS succCntM, SUM(S1.sndCntR) AS sndCntR, SUM(S1.succCntR) AS succCntR, SUM(S1.fbSndCntS) AS fbSndCntS, SUM(S1.fbSuccCntS) AS fbSuccCntS,
, SUM(SND_CNT) AS SND_CNT SUM(S1.fbSndCntL) AS fbSndCntL, SUM(S1.fbSuccCntL) AS fbSuccCntL, SUM(S1.fbSndCntM) AS fbSndCntM, SUM(S1.fbSuccCntM) AS fbSuccCntM
, SUM(SUCC_CNT) AS SUCC_CNT FROM
FROM hubez_common.EZ_CUST_MSTAT
WHERE 1 = 1
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH)
AND SND_CH_CD = 'SMS'
AND USER_SEQ = #{userSeq}
GROUP BY SUM_YM, USER_SEQ) S1
LEFT OUTER JOIN
(SELECT SUM_YM
, USER_SEQ
, SUM(FBACK_CNT) AS FBACK_CNT
, SUM(FBACK_SUCC_CNT) AS FBACK_SUCC_CNT
FROM hubez_common.EZ_CUST_MSTAT
WHERE 1 = 1
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH)
AND SND_CH_CD = 'ALIMTALK'
AND RPLCSND_CH_CD = 'SMS'
AND USER_SEQ = #{userSeq}
GROUP BY SUM_YM, USER_SEQ) S2
ON S1.SUM_YM = S2.SUM_YM
AND S1.USER_SEQ = S2.USER_SEQ
GROUP BY S1.SUM_YM, S1.USER_SEQ) S,
( (
SELECT S1.SUM_YM SELECT
, S1.USER_SEQ SUM_YM,
, SUM(IFNULL(S1.SND_CNT, 0) + IFNULL(S2.FBACK_CNT, 0)) AS SND_CNT CASE WHEN SND_CH_CD = 'SMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntS,
, SUM(IFNULL(S1.SUCC_CNT, 0) + IFNULL(S2.FBACK_SUCC_CNT, 0)) AS SUCC_CNT CASE WHEN SND_CH_CD = 'SMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntS,
FROM (SELECT SUM_YM CASE WHEN SND_CH_CD = 'LMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntL,
, USER_SEQ CASE WHEN SND_CH_CD = 'LMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntL,
, SUM(SND_CNT) AS SND_CNT CASE WHEN SND_CH_CD = 'MMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntM,
, SUM(SUCC_CNT) AS SUCC_CNT CASE WHEN SND_CH_CD = 'MMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntM,
FROM hubez_common.EZ_CUST_MSTAT CASE WHEN SND_CH_CD = 'ALIMTALK' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntR,
WHERE 1 = 1 CASE WHEN SND_CH_CD = 'ALIMTALK' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntR,
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH) CASE WHEN RPLCSND_CH_CD = 'SMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntS,
AND SND_CH_CD = 'LMS' CASE WHEN RPLCSND_CH_CD = 'SMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntS,
AND USER_SEQ = #{userSeq} CASE WHEN RPLCSND_CH_CD = 'LMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntL,
GROUP BY SUM_YM, USER_SEQ) S1 CASE WHEN RPLCSND_CH_CD = 'LMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntL,
LEFT OUTER JOIN CASE WHEN RPLCSND_CH_CD = 'MMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntM,
(SELECT SUM_YM CASE WHEN RPLCSND_CH_CD = 'MMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntM
, USER_SEQ FROM
, SUM(FBACK_CNT) AS FBACK_CNT hubez_common.EZ_CUST_MSTAT ewm INNER JOIN
, SUM(FBACK_SUCC_CNT) AS FBACK_SUCC_CNT hubez_common.EZ_SVC_USER esu ON ewm.USER_SEQ = esu.USER_SEQ
FROM hubez_common.EZ_CUST_MSTAT WHERE
WHERE 1 = 1 SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -24 MONTH) AND NOW()
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH) AND ewm.USER_SEQ = #{userSeq}
AND SND_CH_CD = 'ALIMTALK' UNION ALL
AND RPLCSND_CH_CD = 'LMS' SELECT
AND USER_SEQ = #{userSeq} SUM_YM,
GROUP BY SUM_YM, USER_SEQ) S2 CASE WHEN SND_CH_CD = 'SMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntS,
ON S1.SUM_YM = S2.SUM_YM CASE WHEN SND_CH_CD = 'SMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntS,
AND S1.USER_SEQ = S2.USER_SEQ CASE WHEN SND_CH_CD = 'LMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntL,
GROUP BY S1.SUM_YM, S1.USER_SEQ) AS L, CASE WHEN SND_CH_CD = 'LMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntL,
CASE WHEN SND_CH_CD = 'MMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntM,
CASE WHEN SND_CH_CD = 'MMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntM,
CASE WHEN SND_CH_CD = 'ALIMTALK' THEN SUM(SND_CNT) ELSE 0 END AS sndCntR,
CASE WHEN SND_CH_CD = 'ALIMTALK' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntR,
CASE WHEN SND_CH_CD = 'SMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntS,
CASE WHEN SND_CH_CD = 'SMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntS,
CASE WHEN SND_CH_CD = 'LMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntL,
CASE WHEN SND_CH_CD = 'LMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntL,
CASE WHEN SND_CH_CD = 'MMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntM,
CASE WHEN SND_CH_CD = 'MMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntM
FROM
( (
SELECT S1.SUM_YM SELECT
, S1.USER_SEQ DATE_FORMAT(ewm.YMD, '%Y-%m-01') AS SUM_YM,
, SUM(IFNULL(S1.SND_CNT, 0) + IFNULL(S2.FBACK_CNT, 0)) AS SND_CNT REPLACE (ewm.CH_STR ,'KKO_NOTI', 'ALIMTALK') AS SND_CH_CD,
, SUM(IFNULL(S1.SUCC_CNT, 0) + IFNULL(S2.FBACK_SUCC_CNT, 0)) AS SUCC_CNT SUM(IFNULL(ewm.SEND_CNT, 0)) AS SND_CNT,
FROM (SELECT SUM_YM SUM(IFNULL(ewm.SUCC_CNT, 0)) AS SUCC_CNT,
, USER_SEQ 0 AS FBACK_CNT,
, SUM(SND_CNT) AS SND_CNT 0 AS FBACK_SUCC_CNT
, SUM(SUCC_CNT) AS SUCC_CNT FROM
FROM hubez_common.EZ_CUST_MSTAT hubez_common.EZ_WEB_MSG ewm INNER JOIN
hubez_common.EZ_SVC_USER esu ON ewm.USER_SEQ = esu.USER_SEQ
WHERE
ewm.YMD BETWEEN DATE_FORMAT( NOW(), '%Y-%m-01') AND DATE_FORMAT( NOW(), '%Y-%m-%d')
AND esu.PRNTS_USER_SEQ = #{userSeq}
GROUP BY ewm.YMD, ewm.CH_STR
UNION ALL
SELECT
DATE_FORMAT(ewm.YMD, '%Y-%m-01') AS SUM_YM,
FB_CH_STR AS SND_CH_CD,
0 AS SND_CNT,
0 AS SUCC_CNT,
SUM(IFNULL(ewm.FB_SUCC_CNT + ewm.FB_FAIL_CNT, 0)) AS FBACK_CNT,
SUM(IFNULL(ewm.FB_SUCC_CNT, 0)) AS FBACK_SUCC_CNT
FROM
hubez_common.EZ_WEB_MSG ewm INNER JOIN
hubez_common.EZ_SVC_USER esu ON ewm.USER_SEQ = esu.USER_SEQ
WHERE
ewm.YMD BETWEEN DATE_FORMAT( NOW(), '%Y-%m-01') AND DATE_FORMAT( NOW(), '%Y-%m-%d')
AND esu.PRNTS_USER_SEQ = #{userSeq}
AND (FB_SUCC_CNT > 0 OR FB_FAIL_CNT > 0)
GROUP BY ewm.YMD, ewm.FB_CH_STR
) T1
WHERE
1 = 1
GROUP BY SUM_YM, SND_CH_CD
) S1
WHERE
1 = 1
GROUP BY S1.SUM_YM
) A
WHERE 1 = 1 WHERE 1 = 1
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH) ORDER BY A.SUM_YM DESC
AND SND_CH_CD = 'MMS'
AND USER_SEQ = #{userSeq}
GROUP BY SUM_YM, USER_SEQ) S1
LEFT OUTER JOIN
(SELECT SUM_YM
, USER_SEQ
, SUM(FBACK_CNT) AS FBACK_CNT
, SUM(FBACK_SUCC_CNT) AS FBACK_SUCC_CNT
FROM hubez_common.EZ_CUST_MSTAT
WHERE 1 = 1
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH)
AND SND_CH_CD = 'ALIMTALK'
AND RPLCSND_CH_CD = 'MMS'
AND USER_SEQ = #{userSeq}
GROUP BY SUM_YM, USER_SEQ) S2
ON S1.SUM_YM = S2.SUM_YM
AND S1.USER_SEQ = S2.USER_SEQ
GROUP BY S1.SUM_YM, S1.USER_SEQ) AS M,
(
SELECT SUM_YM
, USER_SEQ
, SUM(SND_CNT) AS SND_CNT
, SUM(SUCC_CNT) AS SUCC_CNT
FROM hubez_common.EZ_CUST_MSTAT
WHERE 1 = 1
AND SUM_YM BETWEEN DATE_ADD(NOW(), INTERVAL -37 MONTH) AND DATE_ADD(NOW(), INTERVAL -1 MONTH)
AND SND_CH_CD = 'ALIMTALK'
AND USER_SEQ = #{userSeq}
GROUP BY SUM_YM, USER_SEQ) AS A
WHERE 1 = 1
AND ecm.SUM_YM = S.SUM_YM
AND ecm.SUM_YM = L.SUM_YM
AND ecm.SUM_YM = M.SUM_YM
AND ecm.SUM_YM = A.SUM_YM
AND ecm.USER_SEQ = S.USER_SEQ
AND ecm.USER_SEQ = L.USER_SEQ
AND ecm.USER_SEQ = M.USER_SEQ
AND ecm.USER_SEQ = A.USER_SEQ
ORDER BY ecm.SUM_YM DESC
</select> </select>
<select id="sendNumberListExcel" parameterType="kr.co.uplus.ez.api.attractMgt.dto.ChannelDetailReqDto" <select id="sendNumberListExcel" parameterType="kr.co.uplus.ez.api.attractMgt.dto.ChannelDetailReqDto"