From 1b9c04a100ecb45d151985597092529fce0944e4 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Thu, 4 Jul 2024 18:15:36 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=97=85=EC=B2=B4=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=EC=8B=9C=20=EB=8C=80=ED=91=9C=EC=9E=90=20=EA=B2=80=EC=83=89?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/nims/service/bean/BizNimsServiceBean.java | 13 ++++++++++--- .../xit/adds/inf/nims/model/NimsApiRequest.java | 6 ++++++ .../resources/sql/mapper/biz/nims-mysql-mapper.xml | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java b/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java index 9af311a..ada3685 100644 --- a/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java +++ b/src/main/java/cokr/xit/adds/biz/nims/service/bean/BizNimsServiceBean.java @@ -97,22 +97,29 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe reqDto.setPg("1"); // 조회페이지 reqDto.setFg2("1"); // 조회범위2(1:NK(취급승인)포함 - default, 2:NK(취급승인)제외) + boolean isRprsntvNm = !isEmpty(reqDto.getRprsntvNm()); while(true) { // 마약류취급자식별번호로 마약류취급자정보 조회 NimsApiResult.Response rslt = infNimsService.getBsshInfoSt(reqDto); List curList = rslt.getResult(); - if(isEmpty(curList)) break; + if (isEmpty(curList)) + break; for (BsshInfoSt d : curList) { d.setRgtr(reqDto.getUserId()); bizNimsMapper.mergeBsshInfoSt(d); + // 대표자 검색조건이 있는 경우 + if (isRprsntvNm && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) { + list.add(d); + } + } + if (!isRprsntvNm){ + list.addAll(curList); } - list.addAll(curList); if(rslt.isEndYn()) break; reqDto.setPg(String.valueOf(Integer.parseInt(reqDto.getPg()) + 1)); - } return list; } diff --git a/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java b/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java index 3d0bf25..d9ebd2d 100644 --- a/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java +++ b/src/main/java/cokr/xit/adds/inf/nims/model/NimsApiRequest.java @@ -125,6 +125,12 @@ public class NimsApiRequest { */ @Schema(title = "사용자ID", description = "해당 사용자ID로 관할관청코드및 API KEY 조회", example = "suji") private String userId; + + /** + * 대표자명 + */ + @Schema(title = "대표자명", description = "대표자명", example = "") + private String rprsntvNm; } /** diff --git a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml index 99fdda4..0776b67 100644 --- a/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml +++ b/src/main/resources/sql/mapper/biz/nims-mysql-mapper.xml @@ -171,6 +171,9 @@ AND hptl_no = #{hp} + + AND INSTR(rprsntv_nm, #{rprsntvNm}) > 0 +