Ver código fonte

KICC 거래내역 관리

marseyes 2 anos atrás
pai
commit
91fc44c185

+ 4 - 0
src/main/java/com/oqpo/api/entity/settmng/PgKiccPayPtclEntity.java

@@ -18,12 +18,16 @@ public class PgKiccPayPtclEntity implements Serializable {
18 18
     private String brandId;
19 19
     @ApiModelProperty(value = "매장아이디")
20 20
     private String storeId;
21
+    @ApiModelProperty(value = "매장명")
22
+    private String storeNm;
21 23
     @ApiModelProperty(value = "몰아이디")
22 24
     private String mallId;
23 25
     @ApiModelProperty(value = "결제번호")
24 26
     private String paymentNo;
25 27
     @ApiModelProperty(value = "거래타입(O:주문,C:취소)")
26 28
     private String tranType;
29
+    @ApiModelProperty(value = "거래타입명")
30
+    private String tranTypeNm;
27 31
     @ApiModelProperty(value = "응답코드")
28 32
     private String resCd;
29 33
     @ApiModelProperty(value = "응답메시지")

+ 1 - 0
src/main/java/com/oqpo/api/enums/SystemMessageCode.java

@@ -71,6 +71,7 @@ public enum SystemMessageCode {
71 71
     ERR_AUTHSTORE (40037, "매장소속 담당자가 아닙니다.", HttpStatus.BAD_REQUEST),
72 72
     ERR_CODE_NM (40038, "정의되지 않은 코드명을 사용하였습니다.", HttpStatus.BAD_REQUEST),
73 73
     ERR_BO_STORE (40039, "매장정보를 찿을 수 없습니다.", HttpStatus.BAD_REQUEST),
74
+    ERR_PG_FAIL (40040, "PG 결제 처리중 에러가 발생하였습니다.", HttpStatus.BAD_REQUEST),
74 75
     ;
75 76
 
76 77
 

+ 26 - 0
src/main/java/com/oqpo/api/mapper/sttlmng/KiccPayMngMapper.java

@@ -0,0 +1,26 @@
1
+package com.oqpo.api.mapper.sttlmng;
2
+
3
+
4
+import com.oqpo.api.entity.settmng.PgKiccPayPtclEntity;
5
+import com.oqpo.api.web.dto.request.GridRequest;
6
+import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
8
+
9
+import java.util.List;
10
+
11
+@Mapper
12
+public interface KiccPayMngMapper {
13
+
14
+    List<PgKiccPayPtclEntity> selectKiccPayGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,
15
+                                                    @Param("sTranType") String sTranType, @Param("sAuthNo") String sAuthNo,
16
+                                                    @Param("fromDt") String fromDt, @Param("toDt") String toDt, GridRequest gridRequest) throws Exception;
17
+
18
+    int selectKiccPayGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,
19
+                             @Param("sTranType") String sTranType, @Param("sAuthNo") String sAuthNo,
20
+                             @Param("fromDt") String fromDt, @Param("toDt") String toDt) throws Exception;
21
+
22
+    PgKiccPayPtclEntity selectPgKiccPayPtcl(@Param("poOrdNo") String poOrdNo) throws Exception;
23
+
24
+    int updatePgKiccPayPtcl4Cancel(@Param("userId") String userId, PgKiccPayPtclEntity entity) throws Exception;
25
+
26
+}

+ 9 - 9
src/main/java/com/oqpo/api/service/loanmng/EasypayPaymentService.java

@@ -410,7 +410,7 @@ public class EasypayPaymentService extends CommonService {
410 410
                     payInfo.setStoreId(easypayPaymentRequest.getStoreId());
411 411
                     payInfo.setMallId(mall_id);
412 412
                     // payInfo.setPaymentNo(null); // TODO 결제번호
413
-                    payInfo.setTranType("O"); // 거래타입(O:주문,C:취소)
413
+                    payInfo.setTranType("40".equals(mgr_txtype) ? "C" : "O"); // 거래타입(O:주문,C:취소)
414 414
                     payInfo.setResCd(res_cd);
415 415
                     payInfo.setResMsg(res_msg);
416 416
                     payInfo.setCno(r_cno);
@@ -433,14 +433,14 @@ public class EasypayPaymentService extends CommonService {
433 433
 
434 434
                     //System.out.println("=easypayPaymentRequest.getPayTpCd()====================================>" + easypayPaymentRequest.getPayTpCd());
435 435
 
436
-                    if (PayTpCd.PRE_PAY_CHARGE.getCd().equals(easypayPaymentRequest.getPayTpCd()) //
437
-                            || PayTpCd.AFTER_PRE_PAYMENT.getCd().equals(easypayPaymentRequest.getPayTpCd())
438
-                            || PayTpCd.PR_APPR_PAYMENT.getCd().equals(easypayPaymentRequest.getPayTpCd())) { // 선결제/충전
439
-                        System.out.println("========PayTpCd.PRE_PAY_CHARGE.getCd()===========================");
440
-                        procPreChargePayment(userId, r_amount, r_pay_type, payInfo, easypayPaymentRequest);
441
-                    } else if (PayTpCd.AFTER_PAYMENT.getCd().equals(easypayPaymentRequest.getPayTpCd())) { // 후불(결제)
442
-                        System.out.println("========PayTpCd.AFTER_PAYMENT.getCd()===========================");
443
-                        procAfterPayment(userId, r_amount, r_pay_type, payInfo, easypayPaymentRequest);
436
+                    if (!"40".equals(mgr_txtype)) { // 취소거래가 아닌 경우
437
+                        if (PayTpCd.PRE_PAY_CHARGE.getCd().equals(easypayPaymentRequest.getPayTpCd()) //
438
+                                || PayTpCd.AFTER_PRE_PAYMENT.getCd().equals(easypayPaymentRequest.getPayTpCd())
439
+                                || PayTpCd.PR_APPR_PAYMENT.getCd().equals(easypayPaymentRequest.getPayTpCd())) { // 선결제/충전
440
+                            procPreChargePayment(userId, r_amount, r_pay_type, payInfo, easypayPaymentRequest);
441
+                        } else if (PayTpCd.AFTER_PAYMENT.getCd().equals(easypayPaymentRequest.getPayTpCd())) { // 후불(결제)
442
+                            procAfterPayment(userId, r_amount, r_pay_type, payInfo, easypayPaymentRequest);
443
+                        }
444 444
                     }
445 445
                 } catch (Exception e) {
446 446
                     e.printStackTrace();

+ 106 - 0
src/main/java/com/oqpo/api/service/sttlmng/KiccPayMngService.java

@@ -0,0 +1,106 @@
1
+package com.oqpo.api.service.sttlmng;
2
+
3
+
4
+import com.oqpo.api.entity.settmng.PgKiccPayPtclEntity;
5
+import com.oqpo.api.enums.SystemMessageCode;
6
+import com.oqpo.api.exception.GlobalException;
7
+import com.oqpo.api.mapper.sttlmng.KiccPayMngMapper;
8
+import com.oqpo.api.service.CommonService;
9
+import com.oqpo.api.service.loanmng.EasypayPaymentService;
10
+import com.oqpo.api.util.DateUtil;
11
+import com.oqpo.api.web.dto.request.GridRequest;
12
+import com.oqpo.api.web.dto.request.loanmng.EasypayPaymentRequest;
13
+import com.oqpo.api.web.dto.request.sttlmng.KiccPayCancelRequest;
14
+import com.oqpo.api.web.dto.response.GridResponse;
15
+import com.oqpo.api.web.dto.response.loanmng.EasypayPaymentResponse;
16
+import com.oqpo.api.web.dto.response.sttlmng.KiccPayGridResponse;
17
+import lombok.extern.slf4j.Slf4j;
18
+import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.stereotype.Service;
20
+import org.springframework.transaction.annotation.Transactional;
21
+
22
+import javax.servlet.http.HttpServletRequest;
23
+import java.util.List;
24
+import java.util.stream.Collectors;
25
+
26
+@Service
27
+@Slf4j
28
+public class KiccPayMngService extends CommonService {
29
+
30
+    @Autowired
31
+    private KiccPayMngMapper kiccPayMngMapper;
32
+
33
+    @Autowired
34
+    private EasypayPaymentService easypayPaymentService;
35
+
36
+    public GridResponse selectKiccPayGridList(String sBrandId, String sStoreId, String sTranType, String sAuthNo,
37
+                                              String fromDt, String toDt, GridRequest gridRequest) throws Exception {
38
+        int gridPage = gridRequest.getGridPage();
39
+        int gridSize = gridRequest.getGridSize();
40
+
41
+        fromDt = fromDt == null ? null : fromDt.replace(".", "");
42
+        toDt = toDt == null ? null : toDt.replace(".", "");
43
+
44
+        int gridRecords = kiccPayMngMapper.selectKiccPayGridCnt(sBrandId, sStoreId, sTranType, sAuthNo, fromDt, toDt);
45
+        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
46
+        List<PgKiccPayPtclEntity> entities = kiccPayMngMapper.selectKiccPayGridList(sBrandId, sStoreId, sTranType, sAuthNo, fromDt, toDt, gridRequest);
47
+        List<Object> gridRows = entities.stream()
48
+                .map(m -> KiccPayGridResponse.builder()
49
+                        .viewCd("R")
50
+                        .poOrdNo(m.getPoOrdNo())
51
+                        .brandId(m.getBrandId())
52
+                        .storeId(m.getStoreId())
53
+                        .storeNm(m.getStoreNm())
54
+                        .mallId(m.getMallId())
55
+                        .paymentNo(m.getPaymentNo())
56
+                        .tranType(m.getTranType())
57
+                        .tranTypeNm(m.getTranTypeNm())
58
+                        .resCd(m.getResCd())
59
+                        .resMsg(m.getResMsg())
60
+                        .cno(m.getCno())
61
+                        .amount(m.getAmount())
62
+                        .authNo(m.getAuthNo())
63
+                        .tranDate(m.getTranDate())
64
+                        .statCd(m.getStatCd())
65
+                        .statMsg(m.getStatMsg())
66
+                        .payType(m.getPayType())
67
+                        .cardNo(m.getCardNo())
68
+                        .issuerCd(m.getIssuerCd())
69
+                        .issuerNm(m.getIssuerNm())
70
+                        .acquirerCd(m.getAcquirerCd())
71
+                        .acquirerNm(m.getAcquirerNm())
72
+                        .installPeriod(m.getInstallPeriod())
73
+                        .noint(m.getNoint())
74
+                        .cancelYn(m.getCancelYn())
75
+                        .cancelDate(m.getCancelDate())
76
+                        .build())
77
+                .collect(Collectors.toList());
78
+        return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
79
+    }
80
+
81
+    @Transactional
82
+    public void procCancel(String userId, HttpServletRequest request, KiccPayCancelRequest kiccPayCancelRequest) throws Exception {
83
+        PgKiccPayPtclEntity entity = kiccPayMngMapper.selectPgKiccPayPtcl(kiccPayCancelRequest.getPoOrdNo());
84
+
85
+        EasypayPaymentRequest easypayPaymentRequest = new EasypayPaymentRequest();
86
+        easypayPaymentRequest.setEP_tr_cd("00201000");
87
+        easypayPaymentRequest.setEP_mall_id(entity.getMallId());
88
+        easypayPaymentRequest.setMgr_txtype("40");
89
+        easypayPaymentRequest.setMgr_subtype("RF01");
90
+        easypayPaymentRequest.setOrg_cno(entity.getCno());
91
+        easypayPaymentRequest.setReq_id(userId);
92
+        easypayPaymentRequest.setOrg_payment_no(entity.getPoOrdNo());
93
+
94
+        EasypayPaymentResponse response = easypayPaymentService.requestPayment(userId, request, easypayPaymentRequest);
95
+
96
+        if ("0000".equals(response.getRes_cd())) {
97
+            entity.setCancelYn("Y");
98
+            entity.setCancelDate(DateUtil.getCurrentDateTime());
99
+            kiccPayMngMapper.updatePgKiccPayPtcl4Cancel(userId, entity);
100
+        } else {
101
+            throw new GlobalException(SystemMessageCode.ERR_PG_FAIL);
102
+        }
103
+
104
+    }
105
+
106
+}

+ 74 - 0
src/main/java/com/oqpo/api/web/controller/sttlmng/KiccPayMngController.java

@@ -0,0 +1,74 @@
1
+package com.oqpo.api.web.controller.sttlmng;
2
+
3
+import com.oqpo.api.enums.SystemMessageCode;
4
+import com.oqpo.api.service.sttlmng.KiccPayMngService;
5
+import com.oqpo.api.service.sttlmng.SttlStateService;
6
+import com.oqpo.api.web.dto.request.sttlmng.KiccPayCancelRequest;
7
+import com.oqpo.api.web.dto.request.sttlmng.KiccPayGridRequest;
8
+import com.oqpo.api.web.dto.request.sttlmng.SttlConfirmRequest;
9
+import com.oqpo.api.web.dto.request.sttlmng.SttlStateGridRequest;
10
+import com.oqpo.api.web.dto.response.GridResponse;
11
+import com.oqpo.api.web.dto.response.SaveResponse;
12
+import io.swagger.annotations.Api;
13
+import io.swagger.annotations.ApiImplicitParam;
14
+import io.swagger.annotations.ApiImplicitParams;
15
+import io.swagger.annotations.ApiOperation;
16
+import lombok.extern.slf4j.Slf4j;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.http.ResponseEntity;
19
+import org.springframework.web.bind.annotation.PostMapping;
20
+import org.springframework.web.bind.annotation.RequestBody;
21
+import org.springframework.web.bind.annotation.RequestMapping;
22
+import org.springframework.web.bind.annotation.RestController;
23
+import springfox.documentation.annotations.ApiIgnore;
24
+
25
+import javax.servlet.http.HttpServletRequest;
26
+import javax.validation.Valid;
27
+
28
+@Slf4j
29
+@RestController
30
+@RequestMapping("/api/kicc/pay")
31
+@Api(tags = {"KICC 거래내역 관리 (KiccPayMngController)"})
32
+public class KiccPayMngController {
33
+
34
+    @Autowired
35
+    private KiccPayMngService kiccPayMngService;
36
+
37
+    /**
38
+     * 설명 : 거래내역 그리드 리스트
39
+     *
40
+     * @param kiccPayGridRequest
41
+     * @return
42
+     * @throws Exception
43
+     */
44
+    @ApiImplicitParams({
45
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
46
+    })
47
+    @ApiOperation(value = "거내내역 그리드 리스트")
48
+    @PostMapping("/detail-grid-list")
49
+    public ResponseEntity<GridResponse> detailGridList(@RequestBody @Valid KiccPayGridRequest kiccPayGridRequest) throws Exception {
50
+        return ResponseEntity.ok(kiccPayMngService.selectKiccPayGridList(kiccPayGridRequest.getSBrandId(), kiccPayGridRequest.getSStoreId(),
51
+                kiccPayGridRequest.getSTranType(), kiccPayGridRequest.getSAuthNo(),
52
+                kiccPayGridRequest.getFromDt(), kiccPayGridRequest.getToDt(), kiccPayGridRequest.toDTO(kiccPayGridRequest)));
53
+    }
54
+
55
+    /**
56
+     * 설명 : 거래 취소 처리
57
+     *
58
+     * @param userId
59
+     * @param kiccPayCancelRequest
60
+     * @return SaveResponse
61
+     * @throws Exception
62
+     */
63
+    @ApiImplicitParams({
64
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
65
+    })
66
+    @ApiOperation(value = "거래 취소 처리")
67
+    @PostMapping("/cancel-proc")
68
+    public ResponseEntity<SaveResponse> procCancel(@ApiIgnore String userId, HttpServletRequest request,
69
+                                                   @RequestBody @Valid KiccPayCancelRequest kiccPayCancelRequest) throws Exception {
70
+        kiccPayMngService.procCancel(userId, request, kiccPayCancelRequest);
71
+        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
72
+    }
73
+
74
+}

+ 18 - 0
src/main/java/com/oqpo/api/web/dto/request/sttlmng/KiccPayCancelRequest.java

@@ -0,0 +1,18 @@
1
+package com.oqpo.api.web.dto.request.sttlmng;
2
+
3
+import io.swagger.annotations.ApiModelProperty;
4
+import lombok.Getter;
5
+import lombok.NonNull;
6
+import lombok.Setter;
7
+
8
+import javax.validation.constraints.NotBlank;
9
+
10
+@Getter
11
+@Setter
12
+public class KiccPayCancelRequest {
13
+
14
+    @ApiModelProperty(value = "주문번호")
15
+    @NotBlank
16
+    private String poOrdNo;
17
+
18
+}

+ 29 - 0
src/main/java/com/oqpo/api/web/dto/request/sttlmng/KiccPayGridRequest.java

@@ -0,0 +1,29 @@
1
+package com.oqpo.api.web.dto.request.sttlmng;
2
+
3
+import com.oqpo.api.web.dto.request.GridRequest;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Getter;
6
+import lombok.Setter;
7
+
8
+
9
+@Getter
10
+@Setter
11
+public class KiccPayGridRequest extends GridRequest {
12
+
13
+    @ApiModelProperty(value = "브랜드아이디")
14
+    private String sBrandId;
15
+    @ApiModelProperty(value = "매장아이디")
16
+    private String sStoreId;
17
+    @ApiModelProperty(value = "거래타입")
18
+    private String sTranType;
19
+    @ApiModelProperty(value = "승인번호")
20
+    private String sAuthNo;
21
+    @ApiModelProperty(value = "조회시작일자")
22
+    private String fromDt;
23
+    @ApiModelProperty(value = "조회종료일자")
24
+    private String toDt;
25
+
26
+    protected KiccPayGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
27
+        super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
28
+    }
29
+}

+ 71 - 0
src/main/java/com/oqpo/api/web/dto/response/sttlmng/KiccPayGridResponse.java

@@ -0,0 +1,71 @@
1
+package com.oqpo.api.web.dto.response.sttlmng;
2
+
3
+import com.fasterxml.jackson.annotation.JsonInclude;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.*;
6
+
7
+
8
+@Getter
9
+@Setter
10
+@Builder
11
+@AllArgsConstructor(access = AccessLevel.PROTECTED)
12
+@JsonInclude(JsonInclude.Include.ALWAYS)
13
+public class KiccPayGridResponse {
14
+
15
+    @ApiModelProperty(value = "CRUD")
16
+    private String viewCd;
17
+
18
+    @ApiModelProperty(value = "주문번호")
19
+    private String poOrdNo;
20
+    @ApiModelProperty(value = "브랜드아이디")
21
+    private String brandId;
22
+    @ApiModelProperty(value = "매장아이디")
23
+    private String storeId;
24
+    @ApiModelProperty(value = "매장명")
25
+    private String storeNm;
26
+    @ApiModelProperty(value = "몰아이디")
27
+    private String mallId;
28
+    @ApiModelProperty(value = "결제번호")
29
+    private String paymentNo;
30
+    @ApiModelProperty(value = "거래타입(O:주문,C:취소)")
31
+    private String tranType;
32
+    @ApiModelProperty(value = "거래타입명")
33
+    private String tranTypeNm;
34
+    @ApiModelProperty(value = "응답코드")
35
+    private String resCd;
36
+    @ApiModelProperty(value = "응답메시지")
37
+    private String resMsg;
38
+    @ApiModelProperty(value = "PG거래번호")
39
+    private String cno;
40
+    @ApiModelProperty(value = "총 결제금액")
41
+    private String amount;
42
+    @ApiModelProperty(value = "승인번호")
43
+    private String authNo;
44
+    @ApiModelProperty(value = "거래일시")
45
+    private String tranDate;
46
+    @ApiModelProperty(value = "상태코드")
47
+    private String statCd;
48
+    @ApiModelProperty(value = "상태메시지")
49
+    private String statMsg;
50
+    @ApiModelProperty(value = "결제수단")
51
+    private String payType;
52
+    @ApiModelProperty(value = "카드번호")
53
+    private String cardNo;
54
+    @ApiModelProperty(value = "발급사코드")
55
+    private String issuerCd;
56
+    @ApiModelProperty(value = "발급사명")
57
+    private String issuerNm;
58
+    @ApiModelProperty(value = "매입사코드")
59
+    private String acquirerCd;
60
+    @ApiModelProperty(value = "매입사명")
61
+    private String acquirerNm;
62
+    @ApiModelProperty(value = "할부개월")
63
+    private String installPeriod;
64
+    @ApiModelProperty(value = "무이자여부")
65
+    private String noint;
66
+    @ApiModelProperty(value = "취소여부")
67
+    private String cancelYn;
68
+    @ApiModelProperty(value = "취소일시")
69
+    private String cancelDate;
70
+
71
+}

+ 86 - 0
src/main/resources/mybatis/sqlmaps/sttlmng/KiccPayMng.xml

@@ -0,0 +1,86 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+
4
+<mapper namespace="com.oqpo.api.mapper.sttlmng.KiccPayMngMapper">
5
+
6
+    <select id="selectKiccPayGridList" resultType="com.oqpo.api.entity.settmng.PgKiccPayPtclEntity">
7
+        /* KiccPayMngMapper.selectKiccPayGridList */
8
+        SELECT A.po_ord_no,
9
+            A.brand_id, FN_BRAND_NM(A.brand_id) AS brand_nm,
10
+            A.store_id, FN_STORE_NM(A.brand_id, A.store_id) AS store_nm,
11
+            A.mall_id, A.payment_no, A.tran_type, FN_CODE_NM('TRAN_TYPE', A.tran_type) AS tran_type_nm,
12
+            A.res_cd, A.res_msg, A.cno, A.amount,
13
+            A.auth_no, A.tran_date, A.stat_cd, A.stat_msg, A.pay_type, A.card_no, A.issuer_cd, A.issuer_nm, A.acquirer_cd,
14
+            A.acquirer_nm, A.install_period, A.noint, A.cancel_yn, A.cancel_date
15
+        FROM pg_kicc_pay_ptcl A
16
+        WHERE A.del_yn = 'N'
17
+        AND A.brand_id = #{sBrandId}
18
+        <if test="sStoreId != null and sStoreId != ''">
19
+            AND A.store_id = #{sStoreId}
20
+        </if>
21
+        <if test="sTranType != null and sTranType != ''">
22
+            AND A.tran_type = #{sTranType}
23
+        </if>
24
+        <if test="sAuthNo != null and sAuthNo != ''">
25
+            AND A.auth_no = #{sAuthNo}
26
+        </if>
27
+        AND A.tran_date BETWEEN CONCAT(#{fromDt},'000000') AND CONCAT(#{toDt},'235959')
28
+        <choose>
29
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
30
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
31
+                    <if test="gridRequest.sord == 'asc'.toString()">
32
+                        ORDER BY A.po_ord_no ASC
33
+                    </if>
34
+                    <if test="gridRequest.sord == 'desc'.toString()">
35
+                        ORDER BY A.po_ord_no DESC
36
+                    </if>
37
+                </if>
38
+            </when>
39
+            <otherwise>
40
+                ORDER BY A.po_ord_no ASC
41
+            </otherwise>
42
+        </choose>
43
+        <if test="gridRequest.pagingYn == true">
44
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
45
+        </if>
46
+    </select>
47
+
48
+    <select id="selectKiccPayGridCnt" resultType="int">
49
+        /* KiccPayMngMapper.selectKiccPayGridCnt */
50
+        SELECT COUNT(*)
51
+        FROM pg_kicc_pay_ptcl A
52
+        WHERE A.del_yn = 'N'
53
+        AND A.brand_id = #{sBrandId}
54
+        <if test="sStoreId != null and sStoreId != ''">
55
+            AND A.store_id = #{sStoreId}
56
+        </if>
57
+        <if test="sTranType != null and sTranType != ''">
58
+            AND A.tran_type = #{sTranType}
59
+        </if>
60
+        <if test="sAuthNo != null and sAuthNo != ''">
61
+            AND A.auth_no = #{sAuthNo}
62
+        </if>
63
+        AND A.tran_date BETWEEN CONCAT(#{fromDt},'000000') AND CONCAT(#{toDt},'235959')
64
+    </select>
65
+
66
+    <select id="selectPgKiccPayPtcl" resultType="com.oqpo.api.entity.settmng.PgKiccPayPtclEntity">
67
+        /* KiccPayMngMapper.selectPgKiccPayPtcl */
68
+        SELECT A.po_ord_no, A.brand_id, A.store_id, A.mall_id, A.payment_no, A.tran_type, A.res_cd, A.res_msg, A.cno,
69
+            A.amount, A.auth_no, A.tran_date, A.stat_cd, A.stat_msg, A.pay_type, A.card_no, A.issuer_cd, A.issuer_nm,
70
+            A.acquirer_cd, A.acquirer_nm, A.install_period, A.noint, A.cancel_yn, A.cancel_date,
71
+            A.del_yn, DATE_FORMAT(A.sys_reg_dttm,'%Y.%m.%d %H:%i:%s') AS sys_reg_dttm, A.sys_reg_id, DATE_FORMAT(A.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') AS sys_chg_dttm, A.sys_chg_id
72
+        FROM pg_kicc_pay_ptcl A
73
+        WHERE A.po_ord_no = #{poOrdNo}
74
+    </select>
75
+
76
+    <update id="updatePgKiccPayPtcl4Cancel" >
77
+        /* KiccPayMngMapper.updatePgKiccPayPtcl4Cancel */
78
+        UPDATE pg_kicc_pay_ptcl SET
79
+            cancel_yn = #{entity.cancelYn},
80
+            cancel_date = #{entity.cancelDate},
81
+            sys_chg_dttm = NOW(),
82
+            sys_chg_id = #{userId}
83
+        WHERE po_ord_no = #{entity.poOrdNo}
84
+    </update>
85
+
86
+</mapper>