날짜별 월별 통계

This commit is contained in:
kubo8
2022-12-22 18:01:42 +09:00
parent a6e819aa95
commit 7ef153f334
5 changed files with 284 additions and 277 deletions

View File

@@ -51,17 +51,23 @@
<div class="table calculate"> <div class="table calculate">
<table> <table>
<colgroup> <colgroup>
<col width="7%" /> <col width="4%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="9.3%" /> <col width="6%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
<col width="6%" />
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
@@ -71,6 +77,9 @@
<th colspan="2">LMS</th> <th colspan="2">LMS</th>
<th colspan="2">MMS</th> <th colspan="2">MMS</th>
<th colspan="2">알림톡</th> <th colspan="2">알림톡</th>
<th colspan="2">대체발송SMS</th>
<th colspan="2">대체발송LMS</th>
<th colspan="2">대체발송MMS</th>
</tr> </tr>
<tr class="total"> <tr class="total">
<th>발송건수</th> <th>발송건수</th>
@@ -83,6 +92,12 @@
<th>성공건수/(%)</th> <th>성공건수/(%)</th>
<th>발송건수</th> <th>발송건수</th>
<th>성공건수/(%)</th> <th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -106,6 +121,18 @@
<td> <td>
{{ option.succCntR.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br />({{ option.succRtR }}%) {{ option.succCntR.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br />({{ option.succRtR }}%)
</td> </td>
<td>{{ option.fbSndCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>
{{ option.fbSuccCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br />({{ option.succFbRtS }}%)
</td>
<td>{{ option.fbSndCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>
{{ option.fbSuccCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br />({{ option.succFbRtL }}%)
</td>
<td>{{ option.fbSndCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>
{{ option.fbSuccCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br />({{ option.succFbRtM }}%)
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -336,6 +363,27 @@ export default {
excelData.sndCntR = this.list[i].sndCntR; excelData.sndCntR = this.list[i].sndCntR;
excelData.succCntR = succCntR; excelData.succCntR = succCntR;
// 대체발송 SMS 성공 건수
var fbSuccCntS = this.list[i].fbSuccCntS;
var succFbRtS = this.list[i].succFbRtS;
fbSuccCntS = fbSuccCntS + '(' + succFbRtS + '%)';
excelData.fbSndCntS = this.list[i].fbSndCntS;
excelData.fbSuccCntS = fbSuccCntS;
// 대체발송 LMS 성공 건수
var fbSuccCntL = this.list[i].fbSuccCntL;
var succFbRtL = this.list[i].succFbRtL;
fbSuccCntL = fbSuccCntL + '(' + succFbRtL + '%)';
excelData.fbSndCntL = this.list[i].fbSndCntL;
excelData.fbSuccCntL = fbSuccCntL;
// 대체발송 MMS 성공 건수
var fbSuccCntM = this.list[i].fbSuccCntM;
var succFbRtM = this.list[i].succFbRtM;
fbSuccCntM = fbSuccCntM + '(' + succFbRtM + '%)';
excelData.fbSndCntM = this.list[i].fbSndCntM;
excelData.fbSuccCntM = fbSuccCntM;
excelList.push(excelData); excelList.push(excelData);
} }

View File

@@ -35,6 +35,11 @@ public class StatsService {
public MonthListResDto monthList(MonthListReqDto monthListReqDto) { public MonthListResDto monthList(MonthListReqDto monthListReqDto) {
StatsMapper statsMapper = sqlSessionSlave.getMapper(StatsMapper.class); StatsMapper statsMapper = sqlSessionSlave.getMapper(StatsMapper.class);
//오늘 날짜 조회인지 확인
if(DateUtils.date2strYM().equals(monthListReqDto.getEndMon())) {
monthListReqDto.setNowDiv("Y");
}
List<MonthList> monthLists = statsMapper.selectMonStatList(monthListReqDto); List<MonthList> monthLists = statsMapper.selectMonStatList(monthListReqDto);
MonthListRes monthListRes = new MonthListRes(); MonthListRes monthListRes = new MonthListRes();

View File

@@ -41,4 +41,22 @@ public class MonthList implements Serializable {
private String succCntR; private String succCntR;
@ApiModelProperty(example = "알림톡 성공율", name = "알림톡 성공율", dataType = "String") @ApiModelProperty(example = "알림톡 성공율", name = "알림톡 성공율", dataType = "String")
private String succRtR; private String succRtR;
@ApiModelProperty(example = "대체발송SMS 발송건수", name = "대체발송SMS 발송건수", dataType = "String")
private String fbSndCntS;
@ApiModelProperty(example = "대체발송SMS 성공건수", name = "대체발송SMS 성공건수", dataType = "String")
private String fbSuccCntS;
@ApiModelProperty(example = "대체발송SMS 성공율", name = "대체발송SMS 성공율", dataType = "String")
private String succFbRtS;
@ApiModelProperty(example = "대체발송LMS 발송건수", name = "대체발송LMS 발송건수", dataType = "String")
private String fbSndCntL;
@ApiModelProperty(example = "대체발송LMS 성공건수", name = "대체발송LMS 성공건수", dataType = "String")
private String fbSuccCntL;
@ApiModelProperty(example = "대체발송LMS 성공율", name = "대체발송LMS 성공율", dataType = "String")
private String succFbRtL;
@ApiModelProperty(example = "대체발송MMS 발송건수", name = "대체발송MMS 발송건수", dataType = "String")
private String fbSndCntM;
@ApiModelProperty(example = "대체발송MMS 성공건수", name = "대체발송MMS 성공건수", dataType = "String")
private String fbSuccCntM;
@ApiModelProperty(example = "대체발송MMS 성공율", name = "대체발송MMS 성공율", dataType = "String")
private String succFbRtM;
} }

View File

@@ -23,4 +23,8 @@ public class MonthListReqDto implements Serializable {
@ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int") @ApiModelProperty(example = "현재 페이지", name = "현재 페이지", dataType = "int")
private int page; private int page;
@NotNull
@ApiModelProperty(example = "당일 조회 여부", name = "당일 조회 여부", dataType = "String")
private String nowDiv = "N";
} }

View File

@@ -5,272 +5,204 @@
<select id="selectMonStatList" parameterType="kr.co.uplus.ez.api.stats.dto.MonthListReqDto" resultType="kr.co.uplus.ez.api.stats.dto.MonthList"> <select id="selectMonStatList" parameterType="kr.co.uplus.ez.api.stats.dto.MonthListReqDto" resultType="kr.co.uplus.ez.api.stats.dto.MonthList">
/* stats-mapper.xml(selectMonStatList) */ /* stats-mapper.xml(selectMonStatList) */
SELECT
select '전체' AS sumYm SUM_YM AS sumYm,
, sum(T_SND_CNT) AS sndCnt A.sndCnt, A.succCnt, IFNULL(ROUND((A.succCnt/A.sndCnt)*100,2),0) AS succRt,
, sum(T_SUCC_CNT) AS succCnt A.sndCntS, A.succCntS, IFNULL(ROUND((A.succCntS/A.sndCntS)*100,2),0) AS succRtS,
, CASE A.sndCntL, A.succCntL, IFNULL(ROUND((A.succCntL/A.sndCntL)*100,2),0) AS succRtL,
WHEN IFNULL(SUM(T_SUCC_CNT), 0) = 0 THEN 0 A.sndCntM, A.succCntM, IFNULL(ROUND((A.succCntM/A.sndCntM)*100,2),0) AS succRtM,
WHEN IFNULL(SUM(T_SND_CNT), 0) = 0 THEN 0 A.sndCntR, A.succCntR, IFNULL(ROUND((A.succCntR/A.sndCntR)*100,2),0) AS succRtR,
ELSE TRUNCATE ((SUM(IFNULL(T_SUCC_CNT, 0)) / SUM(IFNULL(T_SND_CNT, 0)) * 100),2) A.fbSndCntS, A.fbSuccCntS, IFNULL(ROUND((A.fbSuccCntS/A.fbSndCntS)*100,2),0) AS succFbRtS,
END AS succRt A.fbSndCntL, A.fbSuccCntL, IFNULL(ROUND((A.fbSuccCntL/A.fbSndCntL)*100,2),0) AS succFbRtL,
, sum(S_SND_CNT) AS sndCntS A.fbSndCntM, A.fbSuccCntM, IFNULL(ROUND((A.fbSuccCntM/A.fbSndCntM)*100,2),0) AS succFbRtM
, sum(S_SUCC_CNT) AS succCntS FROM
, CASE (
WHEN IFNULL(SUM(S_SUCC_CNT), 0) = 0 THEN 0 SELECT
WHEN IFNULL(SUM(S_SND_CNT), 0) = 0 THEN 0 DATE_FORMAT(S1.SUM_YM, '%Y-%m') AS SUM_YM,
ELSE TRUNCATE ((SUM(IFNULL(S_SUCC_CNT, 0)) / SUM(IFNULL(S_SND_CNT, 0)) * 100),2) (SUM(S1.sndCntS) + SUM(S1.sndCntL) + SUM(S1.sndCntM) + SUM(S1.sndCntR)) AS sndCnt,
END AS succRtS (SUM(S1.succCntS) + SUM(S1.succCntL) +SUM(S1.succCntM) +SUM(S1.succCntR) + SUM(fbSuccCntS) + SUM(fbSuccCntL)+ SUM(fbSuccCntM)) AS succCnt,
, sum(L_SND_CNT) AS sndCntL 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,
, sum(L_SUCC_CNT) AS succCntL 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,
, CASE SUM(S1.fbSndCntL) AS fbSndCntL, SUM(S1.fbSuccCntL) AS fbSuccCntL, SUM(S1.fbSndCntM) AS fbSndCntM, SUM(S1.fbSuccCntM) AS fbSuccCntM
WHEN IFNULL(SUM(L_SUCC_CNT), 0) = 0 THEN 0 FROM
WHEN IFNULL(SUM(L_SND_CNT), 0) = 0 THEN 0 (
ELSE TRUNCATE ((SUM(IFNULL(L_SUCC_CNT, 0)) / SUM(IFNULL(L_SND_CNT, 0)) * 100),2) SELECT
END AS succRtL SUM_YM,
, sum(M_SND_CNT) AS sndCntM CASE WHEN SND_CH_CD = 'SMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntS,
, sum(M_SUCC_CNT) AS succCntM CASE WHEN SND_CH_CD = 'SMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntS,
, CASE CASE WHEN SND_CH_CD = 'LMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntL,
WHEN IFNULL(SUM(M_SUCC_CNT), 0) = 0 THEN 0 CASE WHEN SND_CH_CD = 'LMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntL,
WHEN IFNULL(SUM(M_SND_CNT), 0) = 0 THEN 0 CASE WHEN SND_CH_CD = 'MMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntM,
ELSE TRUNCATE ((SUM(IFNULL(M_SUCC_CNT, 0)) / SUM(IFNULL(M_SND_CNT, 0)) * 100),2) CASE WHEN SND_CH_CD = 'MMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntM,
END AS succRtM CASE WHEN SND_CH_CD = 'ALIMTALK' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntR,
, sum(A_SND_CNT) AS sndCntR CASE WHEN SND_CH_CD = 'ALIMTALK' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntR,
, sum(A_SUCC_CNT) AS succCntR CASE WHEN RPLCSND_CH_CD = 'SMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntS,
, CASE CASE WHEN RPLCSND_CH_CD = 'SMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntS,
WHEN IFNULL(SUM(A_SUCC_CNT), 0) = 0 THEN 0 CASE WHEN RPLCSND_CH_CD = 'LMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntL,
WHEN IFNULL(SUM(A_SND_CNT), 0) = 0 THEN 0 CASE WHEN RPLCSND_CH_CD = 'LMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntL,
ELSE TRUNCATE ((SUM(IFNULL(A_SUCC_CNT, 0)) / SUM(IFNULL(A_SND_CNT, 0)) * 100),2) CASE WHEN RPLCSND_CH_CD = 'MMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntM,
END AS succRtR CASE WHEN RPLCSND_CH_CD = 'MMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntM
from ( FROM
<include refid="totalTodayMonth"/> hubez_common.EZ_CUST_MSTAT
SELECT SUM(IFNULL(SND_CNT,0)) AS T_SND_CNT WHERE
,SUM(IFNULL(SUCC_CNT,0)) AS T_SUCC_CNT SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d')
,TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS T_SUCC_RT AND BIZRNO != '1234567890'
, 0 as S_SND_CNT <if test='nowDiv == "Y"'>
, 0 as S_SUCC_CNT UNION ALL
, 0 as S_SUCC_RT SELECT
, 0 as L_SND_CNT SUM_YM,
, 0 as L_SUCC_CNT CASE WHEN SND_CH_CD = 'SMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntS,
, 0 as L_SUCC_RT CASE WHEN SND_CH_CD = 'SMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntS,
, 0 as M_SND_CNT CASE WHEN SND_CH_CD = 'LMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntL,
, 0 as M_SUCC_CNT CASE WHEN SND_CH_CD = 'LMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntL,
, 0 as M_SUCC_RT CASE WHEN SND_CH_CD = 'MMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntM,
, 0 as A_SND_CNT CASE WHEN SND_CH_CD = 'MMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntM,
, 0 as A_SUCC_CNT CASE WHEN SND_CH_CD = 'ALIMTALK' THEN SUM(SND_CNT) ELSE 0 END AS sndCntR,
, 0 as A_SUCC_RT CASE WHEN SND_CH_CD = 'ALIMTALK' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntR,
FROM hubez_common.EZ_MON_STAT CASE WHEN SND_CH_CD = 'SMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntS,
WHERE 1=1 CASE WHEN SND_CH_CD = 'SMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntS,
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d') CASE WHEN SND_CH_CD = 'LMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntL,
union all CASE WHEN SND_CH_CD = 'LMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntL,
SELECT 0 as T_SND_CNT CASE WHEN SND_CH_CD = 'MMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntM,
, 0 as T_SUCC_CNT CASE WHEN SND_CH_CD = 'MMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntM
, 0 as T_SUCC_RT FROM
, SUM(IFNULL(SND_CNT,0)) AS S_SND_CNT (
, SUM(IFNULL(SUCC_CNT,0)) AS S_SUCC_CNT SELECT
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS S_SUCC_RT DATE_FORMAT(ewm.YMD, '%Y-%m-01') AS SUM_YM,
, 0 as L_SND_CNT REPLACE (ewm.CH_STR ,'KKO_NOTI', 'ALIMTALK') AS SND_CH_CD,
, 0 as L_SUCC_CNT SUM(IFNULL(ewm.SEND_CNT, 0)) AS SND_CNT,
, 0 as L_SUCC_RT SUM(IFNULL(ewm.SUCC_CNT, 0)) AS SUCC_CNT,
, 0 as M_SND_CNT 0 AS FBACK_CNT,
, 0 as M_SUCC_CNT 0 AS FBACK_SUCC_CNT
, 0 as M_SUCC_RT FROM
, 0 as A_SND_CNT hubez_common.EZ_WEB_MSG ewm INNER JOIN
, 0 as A_SUCC_CNT hubez_common.EZ_SVC_USER esu ON ewm.USER_SEQ = esu.USER_SEQ
, 0 as A_SUCC_RT INNER JOIN hubez_common.EZ_CUST_INFO eci ON esu.CUST_SEQ = eci.CUST_SEQ
FROM hubez_common.EZ_MON_STAT WHERE
WHERE 1=1 ewm.YMD BETWEEN DATE_FORMAT( NOW(), '%Y-%m-01') AND DATE_FORMAT( NOW(), '%Y-%m-%d')
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d') AND BIZRNO != '1234567890'
AND SND_CH_CD = 'SMS' GROUP BY ewm.YMD, ewm.CH_STR
union all UNION ALL
SELECT 0 as T_SND_CNT SELECT
, 0 as T_SUCC_CNT DATE_FORMAT(ewm.YMD, '%Y-%m-01') AS SUM_YM,
, 0 as T_SUCC_RT FB_CH_STR AS SND_CH_CD,
, 0 as S_SND_CNT 0 AS SND_CNT,
, 0 as S_SUCC_CNT 0 AS SUCC_CNT,
, 0 as S_SUCC_RT SUM(IFNULL(ewm.FB_SUCC_CNT + ewm.FB_FAIL_CNT, 0)) AS FBACK_CNT,
, SUM(IFNULL(SND_CNT,0)) AS L_SND_CNT SUM(IFNULL(ewm.FB_SUCC_CNT, 0)) AS FBACK_SUCC_CNT
, SUM(IFNULL(SUCC_CNT,0)) AS L_SUCC_CNT FROM
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS L_SUCC_RT hubez_common.EZ_WEB_MSG ewm INNER JOIN
, 0 as M_SND_CNT hubez_common.EZ_SVC_USER esu ON ewm.USER_SEQ = esu.USER_SEQ
, 0 as M_SUCC_CNT INNER JOIN hubez_common.EZ_CUST_INFO eci ON esu.CUST_SEQ = eci.CUST_SEQ
, 0 as M_SUCC_RT WHERE
, 0 as A_SND_CNT ewm.YMD BETWEEN DATE_FORMAT( NOW(), '%Y-%m-01') AND DATE_FORMAT( NOW(), '%Y-%m-%d')
, 0 as A_SUCC_CNT AND BIZRNO != '1234567890'
, 0 as A_SUCC_RT AND (FB_SUCC_CNT > 0 OR FB_FAIL_CNT > 0)
FROM hubez_common.EZ_MON_STAT GROUP BY ewm.YMD, ewm.FB_CH_STR
WHERE 1=1 ) T1
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d') WHERE
AND SND_CH_CD = 'LMS' 1 = 1
union all GROUP BY SUM_YM, SND_CH_CD
SELECT 0 as T_SND_CNT </if>
, 0 as T_SUCC_CNT ) S1
, 0 as T_SUCC_RT WHERE
, 0 as S_SND_CNT 1 = 1
, 0 as S_SUCC_CNT GROUP BY S1.SUM_YM
, 0 as S_SUCC_RT UNION ALL
, 0 as L_SND_CNT SELECT
, 0 as L_SUCC_CNT S1.SUM_YM,
, 0 as L_SUCC_RT (SUM(S1.sndCntS) + SUM(S1.sndCntL) + SUM(S1.sndCntM) + SUM(S1.sndCntR)) AS sndCnt,
, SUM(IFNULL(SND_CNT,0)) AS M_SND_CNT (SUM(S1.succCntS) + SUM(S1.succCntL) +SUM(S1.succCntM) +SUM(S1.succCntR) + SUM(fbSuccCntS) + SUM(fbSuccCntL)+ SUM(fbSuccCntM)) AS succCnt,
, SUM(IFNULL(SUCC_CNT,0)) AS M_SUCC_CNT 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,
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS M_SUCC_RT 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,
, 0 as A_SND_CNT SUM(S1.fbSndCntL) AS fbSndCntL, SUM(S1.fbSuccCntL) AS fbSuccCntL, SUM(S1.fbSndCntM) AS fbSndCntM, SUM(S1.fbSuccCntM) AS fbSuccCntM
, 0 as A_SUCC_CNT FROM
, 0 as A_SUCC_RT (
FROM hubez_common.EZ_MON_STAT SELECT
WHERE 1=1 '전체' AS SUM_YM,
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d') CASE WHEN SND_CH_CD = 'SMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntS,
AND SND_CH_CD = 'MMS' CASE WHEN SND_CH_CD = 'SMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntS,
union all CASE WHEN SND_CH_CD = 'LMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntL,
SELECT 0 as T_SND_CNT CASE WHEN SND_CH_CD = 'LMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntL,
, 0 as T_SUCC_CNT CASE WHEN SND_CH_CD = 'MMS' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntM,
, 0 as T_SUCC_RT CASE WHEN SND_CH_CD = 'MMS' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntM,
, 0 as S_SND_CNT CASE WHEN SND_CH_CD = 'ALIMTALK' THEN IFNULL(SND_CNT, 0) ELSE 0 END AS sndCntR,
, 0 as S_SUCC_CNT CASE WHEN SND_CH_CD = 'ALIMTALK' THEN IFNULL(SUCC_CNT, 0) ELSE 0 END AS succCntR,
, 0 as S_SUCC_RT CASE WHEN RPLCSND_CH_CD = 'SMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntS,
, 0 as L_SND_CNT CASE WHEN RPLCSND_CH_CD = 'SMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntS,
, 0 as L_SUCC_CNT CASE WHEN RPLCSND_CH_CD = 'LMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntL,
, 0 as L_SUCC_RT CASE WHEN RPLCSND_CH_CD = 'LMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntL,
, 0 as M_SND_CNT CASE WHEN RPLCSND_CH_CD = 'MMS' THEN IFNULL(FBACK_CNT, 0) ELSE 0 END AS fbSndCntM,
, 0 as M_SUCC_CNT CASE WHEN RPLCSND_CH_CD = 'MMS' THEN IFNULL(FBACK_SUCC_CNT, 0) ELSE 0 END AS fbSuccCntM
, 0 as M_SUCC_RT FROM
, SUM(IFNULL(SND_CNT,0)) AS A_SND_CNT hubez_common.EZ_CUST_MSTAT
, SUM(IFNULL(SUCC_CNT,0)) AS A_SUCC_CNT WHERE
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS A_SUCC_RT SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d')
FROM hubez_common.EZ_MON_STAT AND BIZRNO != '1234567890'
WHERE 1=1 <if test='nowDiv == "Y"'>
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d') UNION ALL
AND SND_CH_CD = 'ALIMTALK' SELECT
) T '전체' AS SUM_YM,
UNION ALL CASE WHEN SND_CH_CD = 'SMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntS,
select SUM_YM AS sumYm CASE WHEN SND_CH_CD = 'SMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntS,
, sum(T_SND_CNT) AS sndCnt CASE WHEN SND_CH_CD = 'LMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntL,
, sum(T_SUCC_CNT) AS succCnt CASE WHEN SND_CH_CD = 'LMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntL,
, sum(T_SUCC_RT) AS succRt CASE WHEN SND_CH_CD = 'MMS' THEN SUM(SND_CNT) ELSE 0 END AS sndCntM,
, sum(S_SND_CNT) AS sndCntS CASE WHEN SND_CH_CD = 'MMS' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntM,
, sum(S_SUCC_CNT) AS succCntS CASE WHEN SND_CH_CD = 'ALIMTALK' THEN SUM(SND_CNT) ELSE 0 END AS sndCntR,
, sum(S_SUCC_RT) AS succRtS CASE WHEN SND_CH_CD = 'ALIMTALK' THEN SUM(SUCC_CNT) ELSE 0 END AS succCntR,
, sum(L_SND_CNT) AS sndCntL CASE WHEN SND_CH_CD = 'SMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntS,
, sum(L_SUCC_CNT) AS succCntL CASE WHEN SND_CH_CD = 'SMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntS,
, sum(L_SUCC_RT) AS succRtL CASE WHEN SND_CH_CD = 'LMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntL,
, sum(M_SND_CNT) AS sndCntM CASE WHEN SND_CH_CD = 'LMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntL,
, sum(M_SUCC_CNT) AS succCntM CASE WHEN SND_CH_CD = 'MMS' THEN SUM(FBACK_CNT) ELSE 0 END AS fbSndCntM,
, sum(M_SUCC_RT) AS succRtM CASE WHEN SND_CH_CD = 'MMS' THEN SUM(FBACK_SUCC_CNT) ELSE 0 END AS fbSuccCntM
, sum(A_SND_CNT) AS sndCntR FROM
, sum(A_SUCC_CNT) AS succCntR (
, sum(A_SUCC_RT) AS succRtR SELECT
from ( DATE_FORMAT(ewm.YMD, '%Y-%m-01') AS SUM_YM,
<include refid="todayMonth"/> REPLACE (ewm.CH_STR ,'KKO_NOTI', 'ALIMTALK') AS SND_CH_CD,
SELECT DATE_FORMAT(SUM_YM, '%Y-%m') AS SUM_YM SUM(IFNULL(ewm.SEND_CNT, 0)) AS SND_CNT,
, SUM(IFNULL(SND_CNT,0)) AS T_SND_CNT SUM(IFNULL(ewm.SUCC_CNT, 0)) AS SUCC_CNT,
,SUM(IFNULL(SUCC_CNT,0)) AS T_SUCC_CNT 0 AS FBACK_CNT,
,TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS T_SUCC_RT 0 AS FBACK_SUCC_CNT
, 0 as S_SND_CNT FROM
, 0 as S_SUCC_CNT hubez_common.EZ_WEB_MSG ewm INNER JOIN
, 0 as S_SUCC_RT hubez_common.EZ_SVC_USER esu ON ewm.USER_SEQ = esu.USER_SEQ
, 0 as L_SND_CNT INNER JOIN hubez_common.EZ_CUST_INFO eci ON esu.CUST_SEQ = eci.CUST_SEQ
, 0 as L_SUCC_CNT WHERE
, 0 as L_SUCC_RT ewm.YMD BETWEEN DATE_FORMAT( NOW(), '%Y-%m-01') AND DATE_FORMAT( NOW(), '%Y-%m-%d')
, 0 as M_SND_CNT AND BIZRNO != '1234567890'
, 0 as M_SUCC_CNT GROUP BY ewm.YMD, ewm.CH_STR
, 0 as M_SUCC_RT UNION ALL
, 0 as A_SND_CNT SELECT
, 0 as A_SUCC_CNT DATE_FORMAT(ewm.YMD, '%Y-%m-01') AS SUM_YM,
, 0 as A_SUCC_RT FB_CH_STR AS SND_CH_CD,
FROM hubez_common.EZ_MON_STAT 0 AS SND_CNT,
WHERE 1=1 0 AS SUCC_CNT,
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d') SUM(IFNULL(ewm.FB_SUCC_CNT + ewm.FB_FAIL_CNT, 0)) AS FBACK_CNT,
GROUP BY SUM_YM SUM(IFNULL(ewm.FB_SUCC_CNT, 0)) AS FBACK_SUCC_CNT
union all FROM
SELECT DATE_FORMAT(SUM_YM, '%Y-%m') AS SUM_YM hubez_common.EZ_WEB_MSG ewm INNER JOIN
, 0 as T_SND_CNT hubez_common.EZ_SVC_USER esu ON ewm.USER_SEQ = esu.USER_SEQ
, 0 as T_SUCC_CNT INNER JOIN hubez_common.EZ_CUST_INFO eci ON esu.CUST_SEQ = eci.CUST_SEQ
, 0 as T_SUCC_RT WHERE
, SUM(IFNULL(SND_CNT,0)) AS S_SND_CNT ewm.YMD BETWEEN DATE_FORMAT( NOW(), '%Y-%m-01') AND DATE_FORMAT( NOW(), '%Y-%m-%d')
, SUM(IFNULL(SUCC_CNT,0)) AS S_SUCC_CNT AND BIZRNO != '1234567890'
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS S_SUCC_RT AND (FB_SUCC_CNT > 0 OR FB_FAIL_CNT > 0)
, 0 as L_SND_CNT GROUP BY ewm.YMD, ewm.FB_CH_STR
, 0 as L_SUCC_CNT ) T1
, 0 as L_SUCC_RT WHERE
, 0 as M_SND_CNT 1 = 1
, 0 as M_SUCC_CNT GROUP BY SUM_YM, SND_CH_CD
, 0 as M_SUCC_RT </if>
, 0 as A_SND_CNT ) S1
, 0 as A_SUCC_CNT WHERE
, 0 as A_SUCC_RT 1 = 1
FROM hubez_common.EZ_MON_STAT GROUP BY S1.SUM_YM
WHERE 1=1 ) A
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d') WHERE 1 = 1
AND SND_CH_CD = 'SMS' ORDER BY A.SUM_YM DESC
GROUP BY SUM_YM
union all
SELECT DATE_FORMAT(SUM_YM, '%Y-%m') AS SUM_YM
, 0 as T_SND_CNT
, 0 as T_SUCC_CNT
, 0 as T_SUCC_RT
, 0 as S_SND_CNT
, 0 as S_SUCC_CNT
, 0 as S_SUCC_RT
, SUM(IFNULL(SND_CNT,0)) AS L_SND_CNT
, SUM(IFNULL(SUCC_CNT,0)) AS L_SUCC_CNT
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS L_SUCC_RT
, 0 as M_SND_CNT
, 0 as M_SUCC_CNT
, 0 as M_SUCC_RT
, 0 as A_SND_CNT
, 0 as A_SUCC_CNT
, 0 as A_SUCC_RT
FROM hubez_common.EZ_MON_STAT
WHERE 1=1
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d')
AND SND_CH_CD = 'LMS'
GROUP BY SUM_YM
union all
SELECT DATE_FORMAT(SUM_YM, '%Y-%m') AS SUM_YM
, 0 as T_SND_CNT
, 0 as T_SUCC_CNT
, 0 as T_SUCC_RT
, 0 as S_SND_CNT
, 0 as S_SUCC_CNT
, 0 as S_SUCC_RT
, 0 as L_SND_CNT
, 0 as L_SUCC_CNT
, 0 as L_SUCC_RT
, SUM(IFNULL(SND_CNT,0)) AS M_SND_CNT
, SUM(IFNULL(SUCC_CNT,0)) AS M_SUCC_CNT
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS M_SUCC_RT
, 0 as A_SND_CNT
, 0 as A_SUCC_CNT
, 0 as A_SUCC_RT
FROM hubez_common.EZ_MON_STAT
WHERE 1=1
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d')
AND SND_CH_CD = 'MMS'
GROUP BY SUM_YM
union all
SELECT DATE_FORMAT(SUM_YM, '%Y-%m') AS SUM_YM
, 0 as T_SND_CNT
, 0 as T_SUCC_CNT
, 0 as T_SUCC_RT
, 0 as S_SND_CNT
, 0 as S_SUCC_CNT
, 0 as S_SUCC_RT
, 0 as L_SND_CNT
, 0 as L_SUCC_CNT
, 0 as L_SUCC_RT
, 0 as M_SND_CNT
, 0 as M_SUCC_CNT
, 0 as M_SUCC_RT
, SUM(IFNULL(SND_CNT,0)) AS A_SND_CNT
, SUM(IFNULL(SUCC_CNT,0)) AS A_SUCC_CNT
, TRUNCATE((SUM(IFNULL(SUCC_CNT,0)) / SUM(IFNULL(SND_CNT,0)) * 100), 2) AS A_SUCC_RT
FROM hubez_common.EZ_MON_STAT
WHERE 1=1
AND SUM_YM BETWEEN STR_TO_DATE(CONCAT(#{startMon},'01'),'%Y%m%d') AND STR_TO_DATE(CONCAT(#{endMon},'01'),'%Y%m%d')
AND SND_CH_CD = 'ALIMTALK'
GROUP BY SUM_YM
) T GROUP BY SUM_YM order by sumYm desc
</select> </select>