2023-05-24 13:49 전체 발송 정보 및 상세 발송 정보 api 수정

This commit is contained in:
myname 2023-05-24 13:49:21 +09:00
parent bfd860d491
commit aeb93b51bd
3 changed files with 61 additions and 21 deletions

View File

@ -1,11 +1,12 @@
package com.itn.mjonApi.mjon.api.inqry.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
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
@ -31,8 +32,8 @@ public interface HstryMapper {
*/
//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);
}

View File

@ -39,15 +39,17 @@ public class HstryServiceImpl implements HstryService {
//전체 발송 이력
log.info(" :: hstryList ::");
HstryResponseVO hstryResponseVO = new HstryResponseVO();
try {
hstryResponseVO = HstryResponseVO.builder()
.objectList(hstryMapper.selectApiInqryHstry(hstryVO.getMberId()))
try {
//page 계산
hstryVO.setPage(_calcPage(hstryVO.getPage(), hstryVO.getPageSize()));
.build();
//전체 발송 이력 가져오기
hstryResponseVO = HstryResponseVO.builder()
.objectList(hstryMapper.selectApiInqryHstry(hstryVO))
.build();
} catch (Exception e) {
log.info("selectPrice Error [{}]", e.getMessage());
@ -67,14 +69,12 @@ public class HstryServiceImpl implements HstryService {
HstryResponseVO hstryResponseVO = new HstryResponseVO();
try {
hstryResponseVO = HstryResponseVO.builder()
.objectList(hstryMapper.selectApiInqryHstryDetail(
hstryDetailVO.getMberId()
, hstryDetailVO.getMsgGroupId()
))
//page 계산
hstryDetailVO.setPage(_calcPage(hstryDetailVO.getPage(), hstryDetailVO.getPageSize()));
.build();
hstryResponseVO = HstryResponseVO.builder()
.objectList(hstryMapper.selectApiInqryHstryDetail(hstryDetailVO))
.build();
} catch (Exception e) {
log.info("selectPrice Error [{}]", e.getMessage());
@ -84,5 +84,29 @@ 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);
}
}

View File

@ -179,6 +179,22 @@
AND B.DEL_FLAG ='N'
AND B.RESERVE_C_YN = 'N'
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
LEFT JOIN
@ -204,8 +220,8 @@
MSG_GROUP_ID DESC ,
regdate DESC
*/
LIMIT 100
OFFSET 0
LIMIT ${pageSize}
OFFSET ${page}
)AAA
,(
@ -458,9 +474,8 @@
*/
ORDER BY 1=1 ,
regdate DESC
LIMIT 5
OFFSET 0
LIMIT ${pageSize}
OFFSET ${page}
</select>
</mapper>