feat: 일련번호 조회(seqinfo_pub) API 적용

제품조회 반영(업체의 제품 조회 되도록)
main
Jonguk. Lim 1 month ago
parent 37052ea41c
commit 5d751cab85

@ -1,17 +1,12 @@
package cokr.xit.adds.biz.nims.dao; package cokr.xit.adds.biz.nims.dao;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.Optional;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import cokr.xit.adds.biz.nims.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.foundation.component.*;
import cokr.xit.adds.inf.nims.model.NimsApiDto;
import cokr.xit.adds.inf.nims.model.NimsApiRequest;
import cokr.xit.foundation.component.AbstractMapper;
/** /**
* <pre> * <pre>
@ -36,7 +31,7 @@ public interface BizNimsMapper extends AbstractMapper {
void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto); void mergeBsshInfoSt(final NimsApiDto.BsshInfoSt dto);
List<NimsApiDto.BsshInfoSt> selectBsshInfos(final NimsApiRequest.BsshInfoReq dto); List<NimsApiDto.BsshInfoSt> selectBsshInfos(final NimsApiRequest.BsshInfoReq dto);
void mergeProductInfoKd(final NimsApiDto.ProductInfoKd dto); void mergeProductInfoKd(final NimsApiDto.ProductInfoKdSaveDTO dto);
List<NimsApiDto.ProductInfoKd> selectProductInfos(final NimsApiRequest.ProductInfoReq dto); List<NimsApiDto.ProductInfoKd> selectProductInfos(final NimsApiRequest.ProductInfoReq dto);
void mergeJurisdictionGovInfo(NimsApiDto.JurisdictionGovInfo dto); void mergeJurisdictionGovInfo(NimsApiDto.JurisdictionGovInfo dto);

@ -1,15 +1,12 @@
package cokr.xit.adds.biz.nims.service; package cokr.xit.adds.biz.nims.service;
import java.util.List; import java.util.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import cokr.xit.adds.biz.nims.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.core.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.core.model.ApiBaseResponse;
import cokr.xit.adds.inf.nims.model.NimsApiDto;
import cokr.xit.adds.inf.nims.model.NimsApiRequest;
/** /**
* <pre> * <pre>
@ -41,7 +38,7 @@ public interface BizNimsService {
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
// NIMS BIZ // NIMS BIZ
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq dto, final List<BizNimsDto.DsuseMgtDtl> dtls, List<MultipartFile> files); BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq reqDto, final List<BizNimsDto.DsuseMgtDtl> dtls, final List<MultipartFile> files, final NimsApiDto.BsshInfoSt bsshInfoSt, final List<NimsApiDto.ProductInfoKdSaveDTO> prdList);
BizNimsRequest.DsuseMgtReceiptReq modifyDsuseMgtReceiptMstInfo(final BizNimsRequest.DsuseMgtReceiptReq reqDto); BizNimsRequest.DsuseMgtReceiptReq modifyDsuseMgtReceiptMstInfo(final BizNimsRequest.DsuseMgtReceiptReq reqDto);

@ -1,41 +1,32 @@
package cokr.xit.adds.biz.nims.service.bean; package cokr.xit.adds.biz.nims.service.bean;
import java.util.ArrayList; import java.util.*;
import java.util.Collections; import java.util.concurrent.*;
import java.util.HashMap;
import java.util.List; import javax.validation.*;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList; import org.apache.commons.lang3.*;
import org.springframework.stereotype.*;
import javax.validation.Validation; import org.springframework.web.multipart.*;
import javax.validation.Validator;
import cokr.xit.adds.biz.nims.dao.*;
import org.apache.commons.lang3.StringUtils; import cokr.xit.adds.biz.nims.model.*;
import org.springframework.stereotype.Service; import cokr.xit.adds.biz.nims.service.*;
import org.springframework.web.multipart.MultipartFile; import cokr.xit.adds.core.*;
import cokr.xit.adds.core.Constants.*;
import cokr.xit.adds.biz.nims.dao.BizNimsMapper; import cokr.xit.adds.core.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import cokr.xit.adds.core.spring.exception.*;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.core.util.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.biz.nims.service.BizNimsService; import cokr.xit.adds.inf.nims.model.NimsApiDto.*;
import cokr.xit.adds.core.Constants; import cokr.xit.adds.inf.nims.model.NimsApiRequest.*;
import cokr.xit.adds.core.Constants.RPT_TY_CD; import cokr.xit.adds.inf.nims.service.*;
import cokr.xit.adds.core.model.ApiBaseResponse; import cokr.xit.base.file.*;
import cokr.xit.adds.core.spring.exception.ApiCustomException; import cokr.xit.base.file.service.*;
import cokr.xit.adds.core.util.ApiUtil; import cokr.xit.base.file.web.*;
import cokr.xit.adds.inf.nims.model.NimsApiDto; import cokr.xit.foundation.component.*;
import cokr.xit.adds.inf.nims.model.NimsApiDto.BsshInfoSt; import lombok.*;
import cokr.xit.adds.inf.nims.model.NimsApiRequest; import lombok.extern.slf4j.*;
import cokr.xit.adds.inf.nims.model.NimsApiRequest.BsshInfoReq;
import cokr.xit.adds.inf.nims.model.NimsApiResult;
import cokr.xit.adds.inf.nims.service.InfNimsService;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.service.FileService;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.foundation.component.AbstractServiceBean;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
@ -86,10 +77,12 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
// DB 조회 // DB 조회
List<BsshInfoSt> list = new ArrayList<>(); List<BsshInfoSt> list = new ArrayList<>();
if("N".equals(reqDto.getDbSkipYn())) {
list = bizNimsMapper.selectBsshInfos(reqDto); // FIXME: API 적용 - db 조회 skip
if (!isEmpty(list)) return list; // if("N".equals(reqDto.getDbSkipYn())) {
} // list = bizNimsMapper.selectBsshInfos(reqDto);
// if (!isEmpty(list)) return list;
// }
if(isEmpty(reqDto.getK())){ if(isEmpty(reqDto.getK())){
reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey")); reqDto.setK(getApiInfInfo(reqDto.getUserId()).get("apiKey"));
@ -107,16 +100,23 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
if (isEmpty(curList)) if (isEmpty(curList))
break; break;
for (BsshInfoSt d : curList) { // FIXME: API 적용 - db 저장 skip
d.setRgtr(reqDto.getUserId()); // for (BsshInfoSt d : curList) {
bizNimsMapper.mergeBsshInfoSt(d); // d.setRgtr(reqDto.getUserId());
// 대표자 검색조건이 있는 경우 // bizNimsMapper.mergeBsshInfoSt(d);
if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) { // // 대표자 검색조건이 있는 경우
list.add(d); // if (isRprsntvNm && !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm())) {
} // list.add(d);
} // }
// }
if (!isRprsntvNm){ if (!isRprsntvNm){
list.addAll(curList); list.addAll(curList);
}else{
list.addAll(
curList.stream()
.filter(d -> !isEmpty(d.getRprsntvNm()) && d.getRprsntvNm().contains(reqDto.getRprsntvNm()))
.toList());
} }
if(rslt.isEndYn()) break; if(rslt.isEndYn()) break;
@ -150,7 +150,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
List<NimsApiDto.ProductInfoKd> list = new ArrayList<>(); List<NimsApiDto.ProductInfoKd> list = new ArrayList<>();
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// TODO: API 적용후 DB 조회 skip 처리 // FIXME: 신규 API 적용 - DB 조회 skip 처리
// if("N".equals(reqDto.getDbSkipYn())) { // if("N".equals(reqDto.getDbSkipYn())) {
// list = bizNimsMapper.selectProductInfos(reqDto); // list = bizNimsMapper.selectProductInfos(reqDto);
// if (!isEmpty(list)){ // if (!isEmpty(list)){
@ -180,10 +180,11 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
if(isEmpty(curList)) break; if(isEmpty(curList)) break;
for (NimsApiDto.ProductInfoKd d : curList) { // FIXME: 신규 API 적용 - 조회 결과 저장 skip
d.setRgtr(reqDto.getUserId()); // for (NimsApiDto.ProductInfoKd d : curList) {
bizNimsMapper.mergeProductInfoKd(d); // d.setRgtr(reqDto.getUserId());
} // bizNimsMapper.mergeProductInfoKd(d);
// }
// 제조 번호, 일련번호, 유효기간 정보 목록 추가 // 제조 번호, 일련번호, 유효기간 정보 목록 추가
if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK()); if(isMnfSeqInfo) productInfoaddMnfSeqs(curList, reqDto.getBc(), reqDto.getK());
@ -283,7 +284,7 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
* </pre> * </pre>
*/ */
@Override @Override
public BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq reqDto, final List<BizNimsDto.DsuseMgtDtl> dtls, final List<MultipartFile> files) { public BizNimsRequest.DsuseMgtReceiptReq saveDsuseMgtReceipt(final BizNimsRequest.DsuseMgtReceiptReq reqDto, final List<BizNimsDto.DsuseMgtDtl> dtls, final List<MultipartFile> files, final NimsApiDto.BsshInfoSt bsshInfoSt, final List<NimsApiDto.ProductInfoKdSaveDTO> prdList) {
ApiUtil.validate(reqDto, null, validator); ApiUtil.validate(reqDto, null, validator);
if(reqDto.getRndDtlRptCnt() != dtls.size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]"); if(reqDto.getRndDtlRptCnt() != dtls.size()) throw ApiCustomException.create("폐기물 보고수 오류[폐기물 갯수 확인]");
ApiUtil.validate(dtls, null, validator); ApiUtil.validate(dtls, null, validator);
@ -291,6 +292,16 @@ public class BizNimsServiceBean extends AbstractServiceBean implements BizNimsSe
if(files.size() != dtls.size()) throw ApiCustomException.create("폐기물 파일 갯수 오류[파일 갯수 확인]"); if(files.size() != dtls.size()) throw ApiCustomException.create("폐기물 파일 갯수 오류[파일 갯수 확인]");
// FIXME: 신규 API 적용 - 취급자 및 제품 정보 저장
bsshInfoSt.setRgtr(reqDto.getUserId());
bizNimsMapper.mergeBsshInfoSt(bsshInfoSt);
prdList.forEach(
d -> {
d.setRgtr(reqDto.getUserId());
bizNimsMapper.mergeProductInfoKd(d);
}
);
if(isEmpty(reqDto.getDscdmngId())) { if(isEmpty(reqDto.getDscdmngId())) {
if (bizNimsMapper.insertDsuseMgtReceipt(reqDto) == 1) { if (bizNimsMapper.insertDsuseMgtReceipt(reqDto) == 1) {

@ -1,32 +1,22 @@
package cokr.xit.adds.biz.nims.web; package cokr.xit.adds.biz.nims.web;
import java.util.List; import java.util.*;
import org.springframework.http.MediaType; import org.springframework.http.*;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.multipart.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import cokr.xit.adds.biz.nims.model.*;
import cokr.xit.adds.biz.nims.model.BizNimsRequest; import cokr.xit.adds.biz.nims.service.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import cokr.xit.adds.core.model.*;
import cokr.xit.adds.biz.nims.service.BizNimsService; import cokr.xit.adds.core.util.*;
import cokr.xit.adds.core.model.ApiBaseResponse; import cokr.xit.adds.inf.nims.model.*;
import cokr.xit.adds.core.util.XingUtils; import cokr.xit.foundation.data.*;
import cokr.xit.adds.inf.nims.model.NimsApiDto; import io.swagger.v3.oas.annotations.*;
import cokr.xit.adds.inf.nims.model.NimsApiRequest; import io.swagger.v3.oas.annotations.media.*;
import cokr.xit.foundation.data.JSON; import lombok.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import lombok.RequiredArgsConstructor;
/** /**
* <pre> * <pre>
@ -128,9 +118,11 @@ public class BizNimsController {
@RequestParam(value = "dsusePrdImgFiles", required = false) List<MultipartFile> dsusePrdImgFiles @RequestParam(value = "dsusePrdImgFiles", required = false) List<MultipartFile> dsusePrdImgFiles
) { ) {
JSON json = new JSON(); JSON json = new JSON();
NimsApiDto.BsshInfoSt bsshInfoSt = json.parse(dsuseMgtJsonStr, new TypeReference<>() {});
BizNimsRequest.DsuseMgtReceiptReq receiptDto = json.parse(dsuseMgtJsonStr, new TypeReference<>() {}); BizNimsRequest.DsuseMgtReceiptReq receiptDto = json.parse(dsuseMgtJsonStr, new TypeReference<>() {});
List<NimsApiDto.ProductInfoKdSaveDTO> productInfoKds = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {});
List<BizNimsDto.DsuseMgtDtl> dsuseMgtDtls = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {}); List<BizNimsDto.DsuseMgtDtl> dsuseMgtDtls = json.parse(dsuseMgtDtlsJsonStr, new TypeReference<>() {});
return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles)); return ApiBaseResponse.of(bizNimsService.saveDsuseMgtReceipt(receiptDto, dsuseMgtDtls, dsusePrdImgFiles, bsshInfoSt, productInfoKds));
} }
@Operation(summary = "사고 마약류 폐기 관리 폐기 신청서 마스터 정보 변경", description = "사고 마약류 폐기 관리 폐기 신청서 접수 마스터 정보 변경", tags = { "BIZ API" }) @Operation(summary = "사고 마약류 폐기 관리 폐기 신청서 마스터 정보 변경", description = "사고 마약류 폐기 관리 폐기 신청서 접수 마스터 정보 변경", tags = { "BIZ API" })

@ -1,30 +1,21 @@
package cokr.xit.adds.inf.nims.model; package cokr.xit.adds.inf.nims.model;
import java.io.IOException; import java.io.*;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Objects; import javax.validation.*;
import javax.validation.Valid; import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.annotation.*;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer; import cokr.xit.adds.biz.nims.model.*;
import com.fasterxml.jackson.databind.SerializerProvider; import cokr.xit.adds.core.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import cokr.xit.adds.core.model.*;
import cokr.xit.adds.core.spring.exception.*;
import cokr.xit.adds.biz.nims.model.BizNimsDto; import lombok.*;
import cokr.xit.adds.biz.nims.model.BizNimsResponse; import lombok.experimental.*;
import cokr.xit.adds.core.Constants;
import cokr.xit.adds.core.model.AuditDto;
import cokr.xit.adds.core.spring.exception.ApiCustomException;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
/** /**
* <pre> * <pre>
@ -210,6 +201,88 @@ public class NimsApiDto {
private List<NimsApiDto.MnfSeqInfo> mnfSeqInfos = new ArrayList<>(); private List<NimsApiDto.MnfSeqInfo> mnfSeqInfos = new ArrayList<>();
} }
/**
* DTO
*/
@Getter
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public static class ProductInfoKdSaveDTO extends AuditDto {
/**
*
*/
@JsonAlias("PRDUCT_CD")
private String prductCd;
/**
*
*/
@JsonAlias("PRDLST_MST_CD")
private String prdlstMstCd;
/**
*
*/
@JsonAlias("PRDUCT_NM")
private String prductNm;
/**
* /
*/
@JsonAlias("NRCD_SE_NM")
private String nrcdSeNm;
/**
* /
*/
@JsonAlias("PRTM_SE_NM")
private String prtmSeNm;
/**
*
* ( = 1)
*/
@JsonAlias("minDistbQy")
private Integer prdMinDistbQy;
/**
*
*/
@JsonAlias("minDistbUnit")
private String stdPackngStleNm;
/**
*
*/
@JsonAlias("pceQy")
private Integer prdTotPceQy;
/**
*
*/
@JsonAlias("pceUnit")
private String pceCoUnitNm;
/**
*
*/
@JsonAlias("BSSH_CD")
private String bsshCd;
/**
*
*/
@JsonAlias("RGS_DT")
private String rgsDt;
/**
*
*/
@JsonAlias("UPD_DT")
private String updDt;;
}
/** /**
* response * response
*/ */
@ -678,4 +751,3 @@ public class NimsApiDto {
private String bassDtlAdres; private String bassDtlAdres;
} }
} }

@ -2,17 +2,13 @@ package cokr.xit.adds.inf.nims.model;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*; import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.*;
import javax.validation.constraints.Pattern;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.*;
import cokr.xit.adds.core.Constants; import cokr.xit.adds.core.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.*;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* <pre> * <pre>
@ -114,9 +110,9 @@ public class NimsApiRequest {
* true DB skip * true DB skip
* </pre> * </pre>
*/ */
@Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N") // @Schema(title = "DB 조회 skip 여부", description = "DB 조회 skip 여부(DB 조회 없이 NIMS API호출 하려면 Y)", example = "N")
@Builder.Default // @Builder.Default
private String dbSkipYn = "N"; // private String dbSkipYn = "N";
/** /**
* <pre> * <pre>

@ -44,21 +44,21 @@
) )
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
bssh_nm = #{bsshNm}, /* 마약류취급자명 */ bssh_nm = #{bsshNm}, /* 마약류취급자명 */
induty_nm = #{indutyNm}, /* 업종명 */ bizrno = #{bizrno}, /* 사업자등록번호 */
hdnt_cd = #{hdntCd}, /* 의료업자구분 */ rprsntv_nm = #{rprsntvNm}, /* 대표자명 */
hdnt_nm = #{hdntNm}, /* 의료업자구분명 */ prmisn_no = #{prmisnNo}, /* 허가번호 */
bizrno = #{bizrno}, /* 사업자등록번호 */ induty_nm = CASE WHEN induty_nm != IFNULL(#{indutyNm}, '') AND IFNULL(#{indutyNm}, '') != '' THEN #{indutyNm} ELSE induty_nm END, /* 업종명 */
rprsntv_nm = #{rprsntvNm}, /* 대표자명 */ hdnt_cd = CASE WHEN hdnt_cd != IFNULL(#{hdntCd}, '') AND IFNULL(#{hdntCd}, '') != '' THEN #{hdntCd} ELSE hdnt_cd END, /* 의료업자구분 */
chrg_nm = #{chrgNm}, /* 담당자명 */ hdnt_nm = CASE WHEN hdnt_nm != IFNULL(#{hdntNm}, '') AND IFNULL(#{hdntNm}, '') != '' THEN #{hdntNm} ELSE hdnt_nm END, /* 의료업자구분명 */
hptl_no = #{hptlNo}, /* 요약기관번호 */ chrg_nm = CASE WHEN chrg_nm != IFNULL(#{chrgNm}, '') AND IFNULL(#{chrgNm}, '') != '' THEN #{chrgNm} ELSE chrg_nm END, /* 담당자명 */
join_yn = #{joinYn}, /* 가입여부 */ hptl_no = CASE WHEN hptl_no != IFNULL(#{hptlNo}, '') AND IFNULL(#{hptlNo}, '') != '' THEN #{hptlNo} ELSE hptl_no END, /* 요약기관번호 */
bssh_stts_nm = #{bsshSttusNm}, /* 마약류취급자상태명 */ join_yn = CASE WHEN join_yn != IFNULL(#{joinYn}, '') AND IFNULL(#{joinYn}, '') != '' THEN #{joinYn} ELSE join_yn END, /* 가입여부 */
prmisn_no = #{prmisnNo}, /* 허가번호 */ bssh_stts_nm = CASE WHEN bssh_stts_nm != IFNULL(#{bsshSttusNm}, '') AND IFNULL(#{bsshSttusNm}, '') != '' THEN #{bsshSttusNm} ELSE bssh_stts_nm END, /* 마약류취급자상태명 */
mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'), mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
mdfr = #{rgtr} mdfr = #{rgtr}
</insert> </insert>
<insert id="mergeProductInfoKd" parameterType="cokr.xit.adds.inf.nims.model.NimsApiDto$ProductInfoKd"> <insert id="mergeProductInfoKd" parameterType="cokr.xit.adds.inf.nims.model.NimsApiDto$ProductInfoKdSaveDTO">
/** nims-mysql-mapper|mergeProductInfoKd-상품정보 생성|julim */ /** nims-mysql-mapper|mergeProductInfoKd-상품정보 생성|julim */
INSERT INTO tb_prduct_info( INSERT INTO tb_prduct_info(
prduct_cd, /* 제품코드 */ prduct_cd, /* 제품코드 */
@ -87,24 +87,24 @@
#{prdTotPceQy}, #{prdTotPceQy},
#{pceCoUnitNm}, #{pceCoUnitNm},
#{bsshCd}, #{bsshCd},
#{rgsDt}, NULLIF(#{rgsDt}, ''),
#{updDt}, NULLIF(#{updDt}, ''),
'Y', 'Y',
DATE_FORMAT(now(), '%Y%m%d%H%i%s'), DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
#{rgtr} #{rgtr}
) )
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
prdlst_mst_cd = #{prdlstMstCd}, /* 제품대표코드 */
prduct_nm = #{prductNm}, /* 제품명 */ prduct_nm = #{prductNm}, /* 제품명 */
nrcd_se_nm = #{nrcdSeNm}, /* 마약항정구분 */
prtm_se_nm = #{prtmSeNm}, /* 중점일반구분 */
prd_min_distb_qy = #{prdMinDistbQy}, /* 최소유통단위수량 - 제품규격정보(고정값=1) */ prd_min_distb_qy = #{prdMinDistbQy}, /* 최소유통단위수량 - 제품규격정보(고정값=1) */
std_packng_stle_nm = #{stdPackngStleNm}, /* 제품최소유통단위 */ std_packng_stle_nm = #{stdPackngStleNm}, /* 제품최소유통단위 */
prd_tot_pce_qy = #{prdTotPceQy}, /* 제품총낱개단위수량 */ prd_tot_pce_qy = #{prdTotPceQy}, /* 제품총낱개단위수량 */
pce_co_unit_nm = #{pceCoUnitNm}, /* 제품낱개단위 */ pce_co_unit_nm = #{pceCoUnitNm}, /* 제품낱개단위 */
bssh_cd = #{bsshCd}, /* 마약류취급자식별번호 */ prdlst_mst_cd = CASE WHEN prdlst_mst_cd != IFNULL(#{prdlstMstCd}, '') AND IFNULL(#{prdlstMstCd}, '') != '' THEN #{prdlstMstCd} ELSE prdlst_mst_cd END, /* 제품대표코드 */
rgs_dt = #{rgsDt}, /* 등록일 */ nrcd_se_nm = CASE WHEN nrcd_se_nm != IFNULL(#{nrcdSeNm}, '') AND IFNULL(#{nrcdSeNm}, '') != '' THEN #{nrcdSeNm} ELSE nrcd_se_nm END, /* 마약항정구분 */
upd_dt = #{updDt}, /* 변경일 */ prtm_se_nm = CASE WHEN prtm_se_nm != IFNULL(#{prtmSeNm}, '') AND IFNULL(#{prtmSeNm}, '') != '' THEN #{prtmSeNm} ELSE prtm_se_nm END, /* 중점일반구분 */
bssh_cd = CASE WHEN bssh_cd != IFNULL(#{bsshCd}, '') AND IFNULL(#{bsshCd}, '') != '' THEN #{bsshCd} ELSE bssh_cd END, /* 마약류취급자식별번호 */
rgs_dt = CASE WHEN rgs_dt != NULLIF(#{rgsDt}, '') AND IFNULL(#{rgsDt}, '') != '' THEN NULLIF(#{rgsDt}, '') ELSE rgs_dt END, /* 등록일 */
upd_dt = CASE WHEN upd_dt != NULLIF(#{updDt}, '') AND IFNULL(#{updDt}, '') != '' THEN NULLIF(#{updDt}, '') ELSE upd_dt END, /* 변경일 */
mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'), mdfcn_dt = DATE_FORMAT(now(), '%Y%m%d%H%i%s'),
mdfr = #{rgtr} mdfr = #{rgtr}
</insert> </insert>

Loading…
Cancel
Save