2023-05-24 13:49 전체 발송 정보 및 상세 발송 정보 api 수정
This commit is contained in:
parent
bfd860d491
commit
aeb93b51bd
@ -1,11 +1,12 @@
|
|||||||
package com.itn.mjonApi.mjon.api.inqry.mapper;
|
package com.itn.mjonApi.mjon.api.inqry.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import com.itn.mjonApi.mjon.api.access.mapper.domain.AccessKeyVO;
|
import com.itn.mjonApi.mjon.api.access.mapper.domain.AccessKeyVO;
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryDetailVO;
|
||||||
|
import com.itn.mjonApi.mjon.api.inqry.service.mapper.domain.HstryVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @packageName : com.itn.mjonApi.mjon.api.inqry.service.mapper
|
* @packageName : com.itn.mjonApi.mjon.api.inqry.service.mapper
|
||||||
@ -31,8 +32,8 @@ public interface HstryMapper {
|
|||||||
*/
|
*/
|
||||||
//double selectUserMoney(String mberId);
|
//double selectUserMoney(String mberId);
|
||||||
|
|
||||||
List<AccessKeyVO> selectApiInqryHstry(String mberId);
|
List<AccessKeyVO> selectApiInqryHstry(HstryVO hstryVO);
|
||||||
|
|
||||||
List<AccessKeyVO> selectApiInqryHstryDetail(String mberId, String msgGroupId);
|
List<AccessKeyVO> selectApiInqryHstryDetail(HstryDetailVO hstryDetailVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,10 +43,12 @@ public class HstryServiceImpl implements HstryService {
|
|||||||
HstryResponseVO hstryResponseVO = new HstryResponseVO();
|
HstryResponseVO hstryResponseVO = new HstryResponseVO();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//page 계산
|
||||||
|
hstryVO.setPage(_calcPage(hstryVO.getPage(), hstryVO.getPageSize()));
|
||||||
|
|
||||||
|
//전체 발송 이력 가져오기
|
||||||
hstryResponseVO = HstryResponseVO.builder()
|
hstryResponseVO = HstryResponseVO.builder()
|
||||||
|
.objectList(hstryMapper.selectApiInqryHstry(hstryVO))
|
||||||
.objectList(hstryMapper.selectApiInqryHstry(hstryVO.getMberId()))
|
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -67,13 +69,11 @@ public class HstryServiceImpl implements HstryService {
|
|||||||
HstryResponseVO hstryResponseVO = new HstryResponseVO();
|
HstryResponseVO hstryResponseVO = new HstryResponseVO();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//page 계산
|
||||||
|
hstryDetailVO.setPage(_calcPage(hstryDetailVO.getPage(), hstryDetailVO.getPageSize()));
|
||||||
|
|
||||||
hstryResponseVO = HstryResponseVO.builder()
|
hstryResponseVO = HstryResponseVO.builder()
|
||||||
|
.objectList(hstryMapper.selectApiInqryHstryDetail(hstryDetailVO))
|
||||||
.objectList(hstryMapper.selectApiInqryHstryDetail(
|
|
||||||
hstryDetailVO.getMberId()
|
|
||||||
, hstryDetailVO.getMsgGroupId()
|
|
||||||
))
|
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -85,4 +85,28 @@ public class HstryServiceImpl implements HstryService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String _calcPage(String p_s_page, String p_s_pageSize) throws Exception{
|
||||||
|
//page 계산
|
||||||
|
int i_page = 1;
|
||||||
|
int i_pageSize = 30;
|
||||||
|
|
||||||
|
try {
|
||||||
|
i_page = Integer.parseInt(p_s_page);
|
||||||
|
}catch(Exception e) {
|
||||||
|
i_page = 1;
|
||||||
|
log.info("i_page Error [{}]", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
i_pageSize = Integer.parseInt(p_s_pageSize);
|
||||||
|
}catch(Exception e) {
|
||||||
|
i_page = 30;
|
||||||
|
log.info("i_pageSize Error [{}]", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
i_page = (i_page-1)*i_pageSize;
|
||||||
|
|
||||||
|
return Integer.toString(i_page);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -179,6 +179,22 @@
|
|||||||
AND B.DEL_FLAG ='N'
|
AND B.DEL_FLAG ='N'
|
||||||
AND B.RESERVE_C_YN = 'N'
|
AND B.RESERVE_C_YN = 'N'
|
||||||
AND DATE_ADD(NOW(), INTERVAL 60 MINUTE) >= B.REQ_DATE
|
AND DATE_ADD(NOW(), INTERVAL 60 MINUTE) >= B.REQ_DATE
|
||||||
|
|
||||||
|
<if test="startDate != null and startDate != ''">
|
||||||
|
AND b.regdate >= STR_TO_DATE(CONCAT(#{startDate}, '000000'), '%Y%m%d%H%i%s')
|
||||||
|
</if>
|
||||||
|
<if test="startDate == null or startDate == ''">
|
||||||
|
AND b.regdate >= STR_TO_DATE(date_format(now(),'%Y%m%d000000'), '%Y%m%d%H%i%s')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="endDate != null and endDate != ''">
|
||||||
|
AND STR_TO_DATE(CONCAT(#{endDate}, '235959'), '%Y%m%d%H%i%s') >= b.regdate
|
||||||
|
</if>
|
||||||
|
<if test="startDate == null or startDate == ''">
|
||||||
|
AND STR_TO_DATE(date_format(DATE_ADD(NOW(), INTERVAL 1 day),'%Y%m%d000000'), '%Y%m%d%H%i%s') >= b.regdate
|
||||||
|
|
||||||
|
</if>
|
||||||
|
|
||||||
)
|
)
|
||||||
M
|
M
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
@ -204,8 +220,8 @@
|
|||||||
MSG_GROUP_ID DESC ,
|
MSG_GROUP_ID DESC ,
|
||||||
regdate DESC
|
regdate DESC
|
||||||
*/
|
*/
|
||||||
LIMIT 100
|
LIMIT ${pageSize}
|
||||||
OFFSET 0
|
OFFSET ${page}
|
||||||
)AAA
|
)AAA
|
||||||
,(
|
,(
|
||||||
|
|
||||||
@ -458,9 +474,8 @@
|
|||||||
*/
|
*/
|
||||||
ORDER BY 1=1 ,
|
ORDER BY 1=1 ,
|
||||||
regdate DESC
|
regdate DESC
|
||||||
LIMIT 5
|
LIMIT ${pageSize}
|
||||||
OFFSET 0
|
OFFSET ${page}
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user