diff --git a/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/controller/AcntCrtfyhpController.java b/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/controller/AcntCrtfyhpController.java index 357a796c..efc4fd33 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/controller/AcntCrtfyhpController.java +++ b/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/controller/AcntCrtfyhpController.java @@ -49,36 +49,43 @@ public class AcntCrtfyhpController { @ApiImplicitParam(name = "hnpo",value = "휴대폰번호", dataTypeClass = String.class) public ResponseEntity send(String hpno) { - Map resultMap = new HashMap(); + Map resultMap = new HashMap(); // 결과 반환을 위한 객체선언 try { - if(hpno == null) { - return ResponseEntity.status(HttpStatus.OK) + if(hpno == null) { // hpno[휴대폰번호] 가 없을시 서버에서 파라미터가 없다는 "의도적인" 에러 반환 + return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드 .body(new ErrorResponse(RSErrorCode.ER_PARAM)); } //회원정보에 동일한 휴대폰 번호가 있는지 확인 , 암호화 해서 검색 String encHpno = EncryptUtils.encrypt(hpno); + // 휴대폰 번호가 종복이면 isHpno가 True boolean isHpno = ptyCstmrQueryRepository.findCstmrByHpno(encHpno); - - if(isHpno) { - resultMap.put("result" , false); + + if(isHpno) { // 휴대폰 번호 중복인 경우 + resultMap.put("result" , false); // 성공하지 못함을 의미 resultMap.put("code" , -1); // 동일한 휴대폰 번호 존재 - - - }else { - boolean result = service.registerSend(hpno); - resultMap.put("result" , result); + }else { // 휴대폰 번호 중복이 아닌경우 + boolean result = service.registerSend(hpno); // 해당 휴대폰번호로 문자 메세지 발송 + resultMap.put("result" , result); // 메세지 발송이 성공일 경우 true } } catch (Exception e) { + /** + * try{ + ... + } + * try 영역 안 코드들중 문제가 생기면 오는 곳. + * log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 + */ log.error("IGNORE : {}", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(new ErrorResponse("Server Error", "-1")); } + // 문제없을 시 결과값을 최종적으로 리턴해줌 return ResponseEntity.ok().body(new SuccessResponse(resultMap)); } @@ -93,22 +100,25 @@ public class AcntCrtfyhpController { public ResponseEntity confirm(String hpno , String crtfyNo) { - Map resultMap = new HashMap(); + Map resultMap = new HashMap(); // 결과 반환을 위한 객체선언 - if(hpno == null || crtfyNo == null) { - return ResponseEntity.status(HttpStatus.OK) + if(hpno == null || crtfyNo == null) { // hpno[휴대폰번호], crtfyNo[인증번호] 값이 없을 시 서버에서 파라미터가 없다는 "의도적인" 에러 반환 + return ResponseEntity.status(HttpStatus.OK)// "의도적인" 에러 반환코드 .body(new ErrorResponse(RSErrorCode.ER_PARAM)); } - - try { - - boolean result = service.registerConfirm(hpno, crtfyNo); - resultMap.put("result" , result); - - - + try { + + boolean result = service.registerConfirm(hpno, crtfyNo); // 휴대폰번호로 전송된 인증번호가 맞는지 확인하는 코드 + resultMap.put("result" , result); // 인증성공하면 true } catch (Exception e) { + /** + * try{ + ... + } + * try 영역 안 코드들중 문제가 생기면 오는 곳. + * log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 + */ log.error("IGNORE : {}", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(new ErrorResponse("Server Error", "-1")); @@ -127,15 +137,15 @@ public class AcntCrtfyhpController { @ApiImplicitParam(name = "hpno", value = "휴대폰 번호", dataTypeClass = String.class) }) public ResponseEntity sendForId(String memberName, String hpno) { - Map resultMap = new HashMap(); + Map resultMap = new HashMap(); // 결과 반환을 위한 객체선언 - if(memberName == null || hpno == null) { - return ResponseEntity.status(HttpStatus.OK) + if(memberName == null || hpno == null) { // hpno[휴대폰번호]와 memberName[회원이름]이 없을시 서버에서 파라미터가 없다는 "의도적인" 에러 반환 + return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드 .body(new ErrorResponse(RSErrorCode.ER_PARAM)); } try { - boolean result = service.certifNum(memberName, hpno); + boolean result = service.certifNum(memberName, hpno); // resultMap.put("result" , result); if(!result) { resultMap.put("code", -1); //일치하는 회원 없음 @@ -143,6 +153,13 @@ public class AcntCrtfyhpController { resultMap.put("code", 0); //일치하는 회원 존재 } } catch (Exception e) { + /** + * try{ + ... + } + * try 영역 안 코드들중 문제가 생기면 오는 곳. + * log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 + */ log.error("IGNORE : {}", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(new ErrorResponse("Server Error", "-1")); @@ -159,10 +176,10 @@ public class AcntCrtfyhpController { @ApiImplicitParam(name = "hpno",value = "휴대폰번호", dataTypeClass = String.class) }) public ResponseEntity findUserId(String memberName, String hpno) { - Map resultMap = new HashMap(); + Map resultMap = new HashMap(); // 결과 반환을 위한 객체선언 - if(memberName == null || hpno == null) { - return ResponseEntity.status(HttpStatus.OK) + if(memberName == null || hpno == null) { // hpno[휴대폰번호]와 memberName[회원이름]이 없을시 서버에서 파라미터가 없다는 "의도적인" 에러 반환 + return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드 .body(new ErrorResponse(RSErrorCode.ER_PARAM)); } @@ -195,13 +212,13 @@ public class AcntCrtfyhpController { public ResponseEntity sendForPw(String userId, String hpno) { Map resultMap = new HashMap(); - if(userId == null || hpno == null) { - return ResponseEntity.status(HttpStatus.OK) + if(userId == null || hpno == null) { // userId[회원아이디]와 memberName[회원이름]이 없을시 서버에서 파라미터가 없다는 "의도적인" 에러 반환 + return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드 .body(new ErrorResponse(RSErrorCode.ER_PARAM)); } try { - boolean result = service.certifPw(userId, hpno); + boolean result = service.certifPw(userId, hpno); // 회원 ID와 휴대폰번호로 인증메세지 보내는 기능 resultMap.put("result", result); if(!result) { resultMap.put("code", -1); //일치하는 회원 없음 @@ -209,6 +226,13 @@ public class AcntCrtfyhpController { resultMap.put("code", 0); //일치하는 회원 존재 } } catch (Exception e) { + /** + * try{ + ... + } + * try 영역 안 코드들중 문제가 생기면 오는 곳. + * log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 + */ log.error("IGNORE : {}", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(new ErrorResponse("Server Error", "-1")); @@ -229,13 +253,13 @@ public class AcntCrtfyhpController { public ResponseEntity updatePw(String userId, String hpno, String newPw) throws Exception { Map resultMap = new HashMap(); - if(hpno == null || newPw == null) { - return ResponseEntity.status(HttpStatus.OK) + if(hpno == null || newPw == null) { // hpno[휴대폰번호]와 newPw[새로운 비밀번호]가 없을시 서버에서 파라미터가 없다는 "의도적인" 에러 반환 + return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드 .body(new ErrorResponse(RSErrorCode.ER_PARAM)); } - try { - boolean result = service.updatePw(userId, hpno, newPw); + try { + boolean result = service.updatePw(userId, hpno, newPw); // 사용자가 입력한 새로운 암호로 업데이트 resultMap.put("result", result); if(!result) { resultMap.put("code", -1); @@ -243,6 +267,13 @@ public class AcntCrtfyhpController { resultMap.put("code", 0); } } catch(Exception e) { + /** + * try{ + ... + } + * try 영역 안 코드들중 문제가 생기면 오는 곳. + * log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌 + */ log.error("IGNORE : {}", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(new ErrorResponse("Server Error", "-1")); diff --git a/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/service/AcntCrtfyhpService.java b/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/service/AcntCrtfyhpService.java index dea69c94..79d77b5d 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/service/AcntCrtfyhpService.java +++ b/pav-server/src/main/java/com/palnet/biz/api/acnt/crtfyhp/service/AcntCrtfyhpService.java @@ -106,9 +106,16 @@ public class AcntCrtfyhpService { // // return true; // } + + /** + * hpno에 있는 번호로 인증번호 메세지 발송하는 기능 + * @param hpno + * @return + * @throws Exception + */ public boolean registerSend(String hpno) throws Exception{ - //인증번호 만들기 ( 6자리) + //인증번호 만들기 (6자리) String certifyNo = numberGen(6, 2); //메시지 만들기 @@ -126,15 +133,25 @@ public class AcntCrtfyhpService { ptyEntity.setCrtfyhpYn("N"); ptyCrtfyhpBasRepository.save(ptyEntity); - logger.info("certifyNo :: " + certifyNo); + logger.info("certifyNo :: {}", certifyNo); // 로그로 인증번호 값을 찍어줌 - String nowStr = InstantUtils.toDatetimeStringByFormat(Instant.now(), "yyyyMMddHHmmss"); + // 현재시간 값을 구해옴 예시 => nowStr = "20231206135600" + String nowStr = InstantUtils.toDatetimeStringByFormat(Instant.now(), "yyyyMMddHHmmss"); //발송 테이블 입력 SuredataEntity entity = new SuredataEntity(); entity.setIntime(nowStr); entity.setCallphone(hpno); entity.setMsg(msg); + + + /** + * Message 기본값들 applcation-local[dev,prod등].properties 파일에서 확인할 수 있음 + * local,dev,prod는 서버가 돌아가는 환경 옵션입니다. + * local - 개발자 개인 컴퓨터 환경 + * dev - 상용서버 배포전 테스트할 서버 환경[테스트서버] + * prod - 상용화 환경 + */ entity.setSubject(SUBJECT_CETIFY); entity.setCallname(CALLNAME_CERTIFY); entity.setUsercode(USER_CODE); @@ -146,9 +163,11 @@ public class AcntCrtfyhpService { entity.setKind(KIND); - SuredataEntity result = sureDataRepository.save(entity); - - if(result == null) { + SuredataEntity result = sureDataRepository.save(entity); // 데이터 베이스에 저장[Data Insert] + + // Save했을시 성공하지 못하면 result는 null됨 + // 그래서 null경우 성공하지 못한다고 판단 + if(result == null) { return false; } @@ -156,14 +175,33 @@ public class AcntCrtfyhpService { } + /** + * 휴대폰 번호에 전송된 인증번호가 맞는지 확인하는 기능 + * @param hpno + * @param crtfyNo + * @return + * @throws Exception + */ public boolean registerConfirm(String hpno , String crtfyNo ) throws Exception{ hpno = EncryptUtils.encrypt(hpno); //암호화 해서 검색 - List entity = query.confirmSms(hpno , crtfyNo); + List entity = query.confirmSms(hpno , crtfyNo); // 데이터 베이스에서 휴대폰 번호와 인증번호 맞는지 체크 - return entity.size() == 0 ? false : true; + /** + * entity.size() 값은 인증성공하면 1이상 인증이 실패하면 0입니다. + * 그래서, [0]이면 false [인증실패] + * [1]이면 true [인증성공] + */ + return entity.size() == 0 ? false : true; } - + + /** + * len의 크기만큼 난수 생성, + * dupCd가 [1]이면 [중복허용], [2]면 [중복불가] + * @param len + * @param dupCd + * @return + */ public static String numberGen(int len, int dupCd){ Random rand = new Random(); String numStr = ""; //난수가 저장될 변수 @@ -187,46 +225,78 @@ public class AcntCrtfyhpService { } return numStr; } - + + /** + * 휴대폰 번호와 회원이름으로 회원 휴대폰에 인증번호 발송하는 기능 + * @param memberName + * @param hpno + * @return + * @throws Exception + */ public boolean certifNum(String memberName, String hpno) throws Exception{ // String name = EncryptUtils.encrypt(memberName); String phone = EncryptUtils.encrypt(hpno); boolean certifNum = cstmrQuery.certifNum(memberName , phone); - if(certifNum) { - registerSend(hpno); + + if(certifNum) { // 회원정보가 있어 true면 인증문자 발송 + registerSend(hpno); // hpno번호에 있는 번호로 문자발송 } return certifNum; } + /** + * 휴대폰 번호와 회원 명으로 회원 ID 찾는 기능 + * @param memberName + * @param hpno + * @return + * @throws Exception + */ public String findUserId(String memberName, String hpno) throws Exception{ // String name = EncryptUtils.encrypt(memberName); - String phone = EncryptUtils.encrypt(hpno); - String resultFindId = cstmrQuery.findUserId(memberName,phone); + String phone = EncryptUtils.encrypt(hpno); // 번호 암호화 + String resultFindId = cstmrQuery.findUserId(memberName,phone); // 휴대폰번호[hpno]와 회원명[memberName]으로 ID찾기 return resultFindId; } - + + /** + * 회원 ID와 휴대폰번호로 인증메세지 보내는 기능 + * @param userId + * @param hpno + * @return + * @throws Exception + */ public boolean certifPw(String userId, String hpno) throws Exception{ - String phone = EncryptUtils.encrypt(hpno); + String phone = EncryptUtils.encrypt(hpno); // 번호 암호화 PtyCstmrBas certifNum = cstmrQuery.findUserPw(userId , phone); boolean result = false; - if(certifNum != null) { + + //certifNum이 값이 있을경우 메세지 전송, 값이 있다는것은 데이터베이스에 ID와 휴대폰번호[hpno]가 일치한다는 것 + if(certifNum != null) { registerSend(hpno); result = true; } return result; } + /** + * 사용자가 입력한 새로운 암호로 변경[수정]하는 기능 + * @param userId + * @param hpno + * @param newPw + * @return + * @throws Exception + */ public boolean updatePw(String userId, String hpno, String newPw) throws Exception{ - String phone = EncryptUtils.encrypt(hpno); - PtyCstmrBas certifNum = cstmrQuery.findUserPw(userId , phone); + String phone = EncryptUtils.encrypt(hpno); // 휴대폰번호 암호화 + PtyCstmrBas certifNum = cstmrQuery.findUserPw(userId , phone); // 회원 아이디와 휴대폰번호로 데이터베이스에서 조회 boolean result = false; - if(certifNum != null) { + if(certifNum != null) { //certifNum이 값이 있을경우 메세지 전송, 값이 있다는것은 데이터베이스에 ID와 휴대폰번호[hpno]가 일치한다는 것 String encryptPw = EncryptUtils.sha256Encrypt(newPw); certifNum.setUserPswd(encryptPw); certifNum.setPswdUpdtDt(Instant.now()); - ptyCstmrBasRepository.save(certifNum); + ptyCstmrBasRepository.save(certifNum); // 바뀐 암호로 변경[수정] 하는 코드 result = true; } return result; diff --git a/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCrtfyhpBasQueryRepository.java b/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCrtfyhpBasQueryRepository.java index 87631ba3..962b865d 100644 --- a/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCrtfyhpBasQueryRepository.java +++ b/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCrtfyhpBasQueryRepository.java @@ -6,7 +6,6 @@ import com.palnet.biz.jpa.entity.QPtyCrtfyhpBas; import com.querydsl.core.BooleanBuilder; import com.querydsl.jpa.impl.JPAQueryFactory; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; import java.time.Instant; @@ -14,26 +13,43 @@ import java.time.temporal.ChronoUnit; import java.util.List; -@Slf4j @Repository @RequiredArgsConstructor public class PtyCrtfyhpBasQueryRepository { private final JPAQueryFactory query; + /** + * 휴대폰에 전송된 인증코드가 맞는지 확인하는 SQL기능 + * @param hpno + * @param crtfyNo + * @return + */ public List confirmSms(String hpno, String crtfyNo) { QPtyCrtfyhpBas qEntity = QPtyCrtfyhpBas.ptyCrtfyhpBas; Instant now = Instant.now(); Instant prevTime = Instant.now().minus(5, ChronoUnit.MINUTES); + BooleanBuilder builder = new BooleanBuilder(); builder.and(qEntity.crtfyhpNo.eq(crtfyNo)); - + builder.and(qEntity.crtfyhpYn.eq("N")); builder.and(qEntity.createDt.goe(prevTime)); builder.and(qEntity.createDt.loe(now)); + /** + * 휴대폰 번호와 인증번호가 맞는지 확인하는 SQL 입니다. + * + * SELECT + * * + * FROM PTY_CRTFYHP_BAS PCB + * WHERE PCB.CRTFYHP_NO = #{crtfyNo} -- 인증번호 + * AND PCB.CRTFYHP_YN = 'N' + * AND PCB.CREATE_DT = DATE_SUB(NOW(), INTERVAL 5 MINUTE) + * AND PCB.CREATE_DT = NOW() + */ List entity = query.select(qEntity).from(qEntity) .where(builder) @@ -43,5 +59,5 @@ public class PtyCrtfyhpBasQueryRepository { return entity; } - + } diff --git a/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrQueryRepository.java b/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrQueryRepository.java index eeff29fe..2a6ae1fa 100644 --- a/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrQueryRepository.java +++ b/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyCstmrQueryRepository.java @@ -49,24 +49,49 @@ public class PtyCstmrQueryRepository { return result; } + /** + * 회원 이름과 휴대폰번호로 데이터 베이스에서 회원정보 찾는 SQL 기능 + * @param name + * @param hpno + * @return + */ public boolean certifNum(String name, String hpno) { - QPtyCstmrDtl dtl = QPtyCstmrDtl.ptyCstmrDtl; + QPtyCstmrDtl dtl = QPtyCstmrDtl.ptyCstmrDtl; // PTY_CSTMR_DTL - 고객 상세 테이블 + // 데이터베이스 조건 문을 주는 코드 BooleanBuilder builder = new BooleanBuilder(); - builder.and(dtl.hpno.eq(hpno)); - builder.and(dtl.memberName.eq(name)); - + builder.and(dtl.hpno.eq(hpno)); // 휴대폰 번호가 맞는지 조건추가 + builder.and(dtl.memberName.eq(name)); // 회원이름이 맞는지 조건추가 + + /** + * 휴대폰 번호와 이름으로 데이터베이스에서 회원정보를 가져오는 SQL 입니다. + * + * SELECT + * * + * FROM PTY_CSTMR_DTL PCD + * WHERE PCD.HPNO = #{hpno} + * AND PCD.MEMBER_NAME = #{name} + */ PtyCstmrDtl entity = query.select(dtl) .from(dtl) .where(builder) .fetchFirst(); + boolean result = false; + if (entity != null) { result = true; } return result; } - + + + /** + * 회원명과 암호화된 휴대폰 번호로 ID찾는 SQL 기능 + * @param name + * @param hpno + * @return + */ public String findUserId(String name, String hpno) { QPtyCstmrBas bas = QPtyCstmrBas.ptyCstmrBas; QPtyCstmrDtl dtl = QPtyCstmrDtl.ptyCstmrDtl; @@ -75,6 +100,20 @@ public class PtyCstmrQueryRepository { builder.and(bas.cstmrStatusCd.eq("A")); builder.and(dtl.hpno.eq(hpno)); builder.and(dtl.memberName.eq(name)); + + /** + * 회원상태 활성화 여부[CSTMR_STATUS_CD], + * 휴대폰 번호 [HPNO], + * 회원 이름 [MEMBER_NAME] 으로 회원정보를 찾는 SQL 입니다. + * SELECT + * * + * FROM PTY_CSTMR_BAS PCB + * LEFT OUTER JOIN PTY_CSTMR_DTL PCD + * ON PCB.CSTMR_SNO = PCD.CSTMR_SNO + * WHERE PCB.CSTMR_STATUS_CD = 'A' + * AND PCD.HPNO = #{hpno} + * AND PCD.MEMBER_NAME = #{name} + */ PtyCstmrBas entity = query.select(bas) .from(bas) .leftJoin(dtl) @@ -86,6 +125,12 @@ public class PtyCstmrQueryRepository { return userId; } + /** + * 회원 ID와 휴대폰번호[hpno]가 일치한지 확인하는 SQL기능 + * @param id + * @param hpno + * @return + */ public PtyCstmrBas findUserPw(String id, String hpno) { QPtyCstmrBas bas = QPtyCstmrBas.ptyCstmrBas; QPtyCstmrDtl dtl = QPtyCstmrDtl.ptyCstmrDtl; @@ -94,6 +139,20 @@ public class PtyCstmrQueryRepository { builder.and(bas.cstmrStatusCd.eq("A")); builder.and(dtl.hpno.eq(hpno)); builder.and(bas.userId.eq(id)); + + /** + * 회원 아이디[USER_ID], + * 회원활성화 여부[CSTMR_STATUS_CD], + * 휴대폰번호 [HPNO] 값이 조건에 맞으면 회원 정보를 가져오는 SQL입니다. + * SELECT + * * + * FROM PTY_CSTMR_BAS PCB + * LEFT OUTER JOIN PTY_CSTMR_DTL PCD + * ON PCB.CSTMR_SNO = PCD.CSTMR_SNO + * WHERE PCB.CSTMR_STATUS_CD = 'A' + * AND PCD.HPNO = #{hpno} + * AND PCB.USER_ID = #{id} + */ PtyCstmrBas entity = query.select(bas) .from(bas) .leftJoin(dtl) @@ -104,27 +163,44 @@ public class PtyCstmrQueryRepository { return entity; } + /** + * 데이터베이스 안에 같은 휴대폰 번호가 있는지 확인 + * result가 true 일시 동일한 번호가 존재함 + * @param hpno + * @return + */ public boolean findCstmrByHpno(String hpno) { - boolean result = false; + boolean result = false; // 반환할 값 선언 [default false를 의미함] - QPtyCstmrBas basEntity = QPtyCstmrBas.ptyCstmrBas; - QPtyCstmrDtl dtlEntity = QPtyCstmrDtl.ptyCstmrDtl; + QPtyCstmrBas basEntity = QPtyCstmrBas.ptyCstmrBas; + QPtyCstmrDtl dtlEntity = QPtyCstmrDtl.ptyCstmrDtl; + // 데이터베이스 조건 문을 주는 코드 BooleanBuilder builder = new BooleanBuilder(); - builder.and(basEntity.cstmrStatusCd.eq("A")); //활성화 상태 - builder.and(dtlEntity.hpno.eq(hpno)); - + builder.and(basEntity.cstmrStatusCd.eq("A")); + builder.and(dtlEntity.hpno.eq(hpno)); + + + /** + * 휴대폰 번호가 데이터베이스 안에 있는지 확인하는 SQL 입니다. + * SELECT + * * + * FROM PTY_CSTMR_BAS PCB + * LEFT OUTER JOIN PTY_CSTMR_DTL PCD + * ON PCB.CSTMR_SNO = PCD.CSTMR_SNO + * WHERE PCB.CSTMR_STATUS_CD = 'A' + * AND PCD.HPNO = #{hpno} + */ PtyCstmrBas entity = query.select(basEntity) .from(basEntity) .leftJoin(dtlEntity) - .on(basEntity.cstmrSno.eq(dtlEntity.cstmrSno)) + .on(basEntity.cstmrSno.eq(dtlEntity.cstmrSno)) .where(builder) .fetchFirst(); if (entity != null) { result = true; } return result; - } public JwtUserModel findUserPassword(String userId) {