날짜별 통계 수정

This commit is contained in:
kubo8
2022-12-23 12:55:04 +09:00
parent 7ef153f334
commit 76da6c8d57
6 changed files with 331 additions and 279 deletions

View File

@@ -27,6 +27,18 @@
{ {
"name": "알림톡", "name": "알림톡",
"colspan": 2 "colspan": 2
},
{
"name": "대체발송SMS",
"colspan": 2
},
{
"name": "대체발송LMS",
"colspan": 2
},
{
"name": "대체발송MMS",
"colspan": 2
} }
], ],
[ [
@@ -74,6 +86,33 @@
{ {
"key": "succCntR", "key": "succCntR",
"name": "성공건수" "name": "성공건수"
},
{
"key": "fbSndCntS",
"name": "발송건수",
"format": "Format_00"
},
{
"key": "fbSuccCntS",
"name": "성공건수/(%)"
},
{
"key": "fbSndCntL",
"name": "발송건수",
"format": "Format_00"
},
{
"key": "fbSuccCntL",
"name": "성공건수/(%)"
},
{
"key": "fbSndCntM",
"name": "발송건수",
"format": "Format_00"
},
{
"key": "fbSuccCntM",
"name": "성공건수/(%)"
} }
] ]
] ]

View File

@@ -47,17 +47,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>
@@ -67,6 +73,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>
@@ -79,6 +88,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>
@@ -102,6 +117,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>
@@ -306,6 +333,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

@@ -94,6 +94,11 @@ public class StatsService {
public DayListResDto dayList(DayListReqDto dayListReqDto) { public DayListResDto dayList(DayListReqDto dayListReqDto) {
StatsMapper statsMapper = sqlSessionSlave.getMapper(StatsMapper.class); StatsMapper statsMapper = sqlSessionSlave.getMapper(StatsMapper.class);
//오늘 날짜 조회인지 확인
if(DateUtils.date2strYMD().equals(dayListReqDto.getEndDay())) {
dayListReqDto.setNowDiv("Y");
}
List<DayList> dayLists = statsMapper.selectDayStatList(dayListReqDto); List<DayList> dayLists = statsMapper.selectDayStatList(dayListReqDto);
DayListRes dayListRes = new DayListRes(); DayListRes dayListRes = new DayListRes();

View File

@@ -41,4 +41,22 @@ public class DayList 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

@@ -15,6 +15,9 @@ public class DayListReqDto implements Serializable {
@ApiModelProperty(example = "조회종료일", name = "조회종료일",dataType = "String") @ApiModelProperty(example = "조회종료일", name = "조회종료일",dataType = "String")
private String endDay; private String endDay;
@ApiModelProperty(example = "당일 조회 여부", name = "당일 조회 여부", dataType = "String")
private String nowDiv = "N";
// @NotNull // @NotNull
// @ApiModelProperty(example = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "String") // @ApiModelProperty(example = "페이지당 조회할 목록 수", name = "페이지당 조회할 목록 수", dataType = "String")
// private int pagePerRows; // private int pagePerRows;

View File

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