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 +