Browse Source

bas/group 패키지 주석추가

pull/18/head
lkd9125(이경도) 9 months ago
parent
commit
e240392b25
  1. 129
      pav-server/src/main/java/com/palnet/biz/api/bas/group/controller/BasGroupController.java
  2. 31
      pav-server/src/main/java/com/palnet/biz/api/bas/group/service/BasGroupService.java
  3. 139
      pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyGroupQueryRepository.java

129
pav-server/src/main/java/com/palnet/biz/api/bas/group/controller/BasGroupController.java

@ -44,6 +44,10 @@ public class BasGroupController {
@Autowired @Autowired
private final BasGroupService service; private final BasGroupService service;
/**
* 그룹코드 생성
* @return
*/
@GetMapping(value = "/createid") @GetMapping(value = "/createid")
@ApiOperation(value = "그룹코드 생성") @ApiOperation(value = "그룹코드 생성")
@Tag(name = "그룹 컨트롤러", description = "그룹 관련 API") @Tag(name = "그룹 컨트롤러", description = "그룹 관련 API")
@ -51,11 +55,18 @@ public class BasGroupController {
Map<String , Object> resultMap = new HashMap<String,Object>(); Map<String , Object> resultMap = new HashMap<String,Object>();
try { try {
String result = service.createid(); String result = service.createid(); // 그룹코드를 생성하는 기능
resultMap.put("result", result); resultMap.put("result", result);
} catch (Exception e) { } catch (Exception e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
@ -66,7 +77,8 @@ public class BasGroupController {
} }
/** /**
* 나의 그룹 목록 조회 * 내가 만든 그룹 목록조회하는 기능.
* 고객고유번호[cstmrSno] 내가 만든 그룹을 조회함.
* @param rq * @param rq
* @return * @return
*/ */
@ -77,19 +89,27 @@ public class BasGroupController {
public ResponseEntity<? extends BasicResponse> mylist(Integer cstmrSno) { public ResponseEntity<? extends BasicResponse> mylist(Integer cstmrSno) {
List<BasGroupModel> result = null; List<BasGroupModel> result = null;
log.debug("Param : " + cstmrSno); log.debug("Param : {}", cstmrSno);
//입력값 검증 // 고객고유번호[cstmrSno]값 입력값 검증처리
if(StringUtils.isEmpty(cstmrSno)) { if(StringUtils.isEmpty(cstmrSno)) {
return ResponseEntity.status(HttpStatus.OK) // 검증통과하지 못할 시 서버에서 "의도적인" 에러 반환
return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); .body(new ErrorResponse(RSErrorCode.ER_PARAM));
} }
try { try {
result = service.mylist(cstmrSno); result = service.mylist(cstmrSno); // 나의 그룹 목록조회하는 기능.
} catch (Exception e) { } catch (Exception e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
@ -100,7 +120,8 @@ public class BasGroupController {
} }
/** /**
* 나의 그룹 - 참여 그룹 목록 조회 * 나의 그룹 - 참여 그룹 목록 조회하는 기능,
* 고객고유번호[cstmrSno] 나의 그룹을 조회함.
* @param rq * @param rq
* @return * @return
*/ */
@ -112,17 +133,25 @@ public class BasGroupController {
List<BasGroupJoinModel> result = null; List<BasGroupJoinModel> result = null;
//입력값 검증 // 고객고유번호[cstmrSno]값 입력값 검증처리
if(StringUtils.isEmpty(cstmrSno)) { if(StringUtils.isEmpty(cstmrSno)) {
return ResponseEntity.status(HttpStatus.OK) // 검증통과하지 못할 시 서버에서 "의도적인" 에러 반환
return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); .body(new ErrorResponse(RSErrorCode.ER_PARAM));
} }
try { try {
result = service.joinList(cstmrSno); result = service.joinList(cstmrSno); // 나의 그룹 - 참여 그룹 목록을 조회하는 기능.
} catch (Exception e) { } catch (Exception e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
@ -133,7 +162,7 @@ public class BasGroupController {
} }
/** /**
* 그룹 목록 조회 * 그룹 목록 조회하는 기능
* @param rq * @param rq
* @return * @return
*/ */
@ -145,17 +174,25 @@ public class BasGroupController {
List<BasGroupJoinModel> result = null; List<BasGroupJoinModel> result = null;
//입력값 검증 // 고객고유번호[cstmrSno]값 입력값 검증처리
if(StringUtils.isEmpty(cstmrSno)) { if(StringUtils.isEmpty(cstmrSno)) {
return ResponseEntity.status(HttpStatus.OK) // 검증통과하지 못할 시 서버에서 "의도적인" 에러 반환
return ResponseEntity.status(HttpStatus.OK) // "의도적인" 에러 반환코드
.body(new ErrorResponse(RSErrorCode.ER_PARAM)); .body(new ErrorResponse(RSErrorCode.ER_PARAM));
} }
try { try {
result = service.groupList(cstmrSno); result = service.groupList(cstmrSno); // 그룹 목록조회하는 기능
} catch (Exception e) { } catch (Exception e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
@ -166,7 +203,8 @@ public class BasGroupController {
} }
/** /**
* 전체 그룹 목록 조회 * 전체 그룹 목록 조회하는 기능,
* BasGroupRqModel 모델 값에 따라 조회하는 기능.
* @param rq * @param rq
* @return * @return
*/ */
@ -177,10 +215,17 @@ public class BasGroupController {
List<BasGroupModel> result = null; List<BasGroupModel> result = null;
try { try {
result = service.list(rq); result = service.list(rq); // 전체 그룹 목록하는 기능
} catch (Exception e) { } catch (Exception e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
@ -191,7 +236,8 @@ public class BasGroupController {
} }
/** /**
* 그룹 상세 조회 * 그룹 상세 조회하는 기능,
* 그룹아이디[groupId] 조회함.
* @param id * @param id
* @return * @return
*/ */
@ -203,9 +249,16 @@ public class BasGroupController {
BasGroupModel result = null; BasGroupModel result = null;
try { try {
result = service.detail(id); result = service.detail(id); // 그룹아이디[groupId]로 상세 조회하는 기능
} catch (Exception e) { } catch (Exception e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
@ -217,7 +270,8 @@ public class BasGroupController {
/** /**
* 그룹 생성 * 그룹 생성하는 기능,
* BasGroupModel 모델에 입력받은 값으로 그룹 생성.
* @return * @return
* @throws Exception * @throws Exception
*/ */
@ -228,11 +282,19 @@ public class BasGroupController {
Map<String , Object> resultMap = new HashMap<String,Object>(); Map<String , Object> resultMap = new HashMap<String,Object>();
try { try {
boolean result = service.create(rq); boolean result = service.create(rq); // 그룹 생성하는 기능
resultMap.put("result", result); resultMap.put("result", result);
} catch (CustomException e) { } catch (CustomException e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* CustomException은 개발자가 "의도적으로" 예외처리,
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
resultMap.put("result", false); resultMap.put("result", false);
resultMap.put("errorCode", e.getErrorCode()); resultMap.put("errorCode", e.getErrorCode());
@ -244,7 +306,8 @@ public class BasGroupController {
} }
/** /**
* 그룹 수정 * 그룹 수정하는 기능,
* BasGroupModel 모델에 입력받은 값으로 그룹 수정.
* @return * @return
* @throws Exception * @throws Exception
*/ */
@ -255,7 +318,7 @@ public class BasGroupController {
Map<String , Object> resultMap = new HashMap<String,Object>(); Map<String , Object> resultMap = new HashMap<String,Object>();
try { try {
boolean result = service.update(rq); boolean result = service.update(rq); // 그룹 수정하는 기능
resultMap.put("result", result); resultMap.put("result", result);
@ -266,6 +329,14 @@ public class BasGroupController {
// //
// } // }
} catch (CustomException e) { } catch (CustomException e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* CustomException은 개발자가 "의도적으로" 예외처리,
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
resultMap.put("result", false); resultMap.put("result", false);
resultMap.put("errorCode", e.getErrorCode()); resultMap.put("errorCode", e.getErrorCode());
@ -277,7 +348,8 @@ public class BasGroupController {
} }
/** /**
* 그룹 삭제 * 그룹 삭제하는 기능,
* 그룹아이디[groupId] 삭제함.
* @param id * @param id
* @return * @return
*/ */
@ -289,11 +361,18 @@ public class BasGroupController {
Map<String , Object> resultMap = new HashMap<String,Object>(); Map<String , Object> resultMap = new HashMap<String,Object>();
try { try {
boolean result = service.delete(id); boolean result = service.delete(id); // 그룹아이디[groupId]로 삭제하는 기능
resultMap.put("result", result); resultMap.put("result", result);
} catch (Exception e) { } catch (Exception e) {
/**
* try{
...
}
* try 영역 코드들중 문제가 생기면 오는 .
* log.error 로그로 원인 파악과 함께 API를 호출한 곳에 서버에러 내려줌
*/
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));

31
pav-server/src/main/java/com/palnet/biz/api/bas/group/service/BasGroupService.java

@ -42,7 +42,10 @@ public class BasGroupService {
@Autowired @Autowired
private JwtTokenUtil jwtTokenUtil; private JwtTokenUtil jwtTokenUtil;
/**
* 그룹코드를 생성하는 기능.
* @return
*/
public String createid() { public String createid() {
String groupId = ""; String groupId = "";
@ -59,20 +62,19 @@ public class BasGroupService {
} }
/** /**
* 나의 그룹 목록 * 내가 만든 그룹 목록조회하는 기능.
* @param cstmrSno * @param cstmrSno
* @return * @return
*/ */
public List<BasGroupModel> mylist(int cstmrSno){ public List<BasGroupModel> mylist(int cstmrSno){
List<BasGroupModel> resultList = query.mylist(cstmrSno); List<BasGroupModel> resultList = query.mylist(cstmrSno); // 데이터베이스에서 cstmrSno에 맞춰 내가 만든 그룹을 조회하는 기능.
return resultList; return resultList;
} }
/** /**
* 그룹 목록 * 그룹 목록조회하는 기능.
* @param cstmrSno * @param cstmrSno
* @return * @return
*/ */
@ -81,7 +83,7 @@ public class BasGroupService {
String appAuth = jwtTokenUtil.getUserAuthByToken(); String appAuth = jwtTokenUtil.getUserAuthByToken();
List<BasGroupJoinModel> resultList = new ArrayList<>(); List<BasGroupJoinModel> resultList = new ArrayList<>();
if("SUPER".equals(appAuth)||"ADMIN".equals(appAuth)) { if("SUPER".equals(appAuth)||"ADMIN".equals(appAuth)) {
resultList = query.groupAdminList(cstmrSno); resultList = query.groupAdminList(cstmrSno); // Super, Admin권한으로 그룹을 조회하는 SQL 기능.
} else { } else {
resultList = query.groupUserList(cstmrSno); resultList = query.groupUserList(cstmrSno);
} }
@ -90,7 +92,7 @@ public class BasGroupService {
} }
/** /**
* 나의 그룹 - 참여 그룹 목록 * 나의 그룹 - 참여 그룹 목록 조회하는 기능.
* @param cstmrSno * @param cstmrSno
* @return * @return
*/ */
@ -102,20 +104,20 @@ public class BasGroupService {
} }
/** /**
* 전체 그룹 목록 * 전체 그룹 목록하는 기능.
* @param rq * @param rq
* @return * @return
*/ */
public List<BasGroupModel> list(BasGroupRqModel rq){ public List<BasGroupModel> list(BasGroupRqModel rq){
List<BasGroupModel> resultList = query.list(rq); List<BasGroupModel> resultList = query.list(rq); // 전체 그룹을 조회하는 SQL기능
return resultList; return resultList;
} }
/** /**
* 그룹 상세 조회 * 그룹아이디[groupId] 상세 조회하는 기능.
* @param groupId * @param groupId
* @return * @return
* @throws Exception * @throws Exception
@ -134,13 +136,12 @@ public class BasGroupService {
BeanUtils.copyProperties(entity , model); BeanUtils.copyProperties(entity , model);
return model; return model;
} }
/** /**
* 그룹 생성 * 그룹 생성하는 기능.
* @param rq * @param rq
* @return * @return
* @throws Exception * @throws Exception
@ -188,7 +189,7 @@ public class BasGroupService {
} }
/** /**
* 그룹 수정 * 그룹 수정하는 기능.
* @param rq * @param rq
* @return * @return
* @throws Exception * @throws Exception
@ -222,7 +223,7 @@ public class BasGroupService {
} }
/** /**
* 그룹 삭제 * 그룹아이디[groupId] 삭제하는 기능.
* @param groupId * @param groupId
* @return * @return
* @throws Exception * @throws Exception

139
pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyGroupQueryRepository.java

@ -49,6 +49,11 @@ public class PtyGroupQueryRepository{
@Autowired @Autowired
private JwtTokenUtil jwtTokenUtil; private JwtTokenUtil jwtTokenUtil;
/**
* 전체 그룹을 조회하는 SQL기능.
* @param rq
* @return
*/
public List<BasGroupModel> list(BasGroupRqModel rq){ public List<BasGroupModel> list(BasGroupRqModel rq){
QPtyGroupBas bas = QPtyGroupBas.ptyGroupBas; QPtyGroupBas bas = QPtyGroupBas.ptyGroupBas;
@ -63,6 +68,23 @@ public class PtyGroupQueryRepository{
builder.and(bas.groupNm.like(rq.getGroupNm())); builder.and(bas.groupNm.like(rq.getGroupNm()));
} }
/**
* 사용여부[useYn] 조건,
* 그룹아이디[groupId] 조건,
* 그룹이름[groupNm] 조건으로 조회하는 SQL입니다.
*
* SELECT
* PGB.GROUP_ID ,
* PGB.GROUP_NM ,
* PGB.GROUP_TYPE_CD ,
* PGB.UPDATE_DT ,
* PGB.CREATE_DT
* FROM PTY_GROUP_BAS PGB
* WHERE PGB.USE_YN = 'Y'
* AND PGB.GROUP_ID = #{groupId} -- 입력받았으면 조건 추가
* AND PGB.GROUP_NM LIKE #{groupNm} -- 입력받았으면 조건 추가
* ORDER BY PGB.CREATE_DT DESC
*/
List<BasGroupModel> result = List<BasGroupModel> result =
query.select(Projections.bean(BasGroupModel.class , query.select(Projections.bean(BasGroupModel.class ,
bas.groupId, bas.groupId,
@ -75,12 +97,11 @@ public class PtyGroupQueryRepository{
.orderBy(bas.createDt.desc()) .orderBy(bas.createDt.desc())
.fetch(); .fetch();
return result; return result;
} }
/** /**
* 내가 생성한 그룹 목록 * 내가 생성한 그룹 목록 조회하는 SQL 기능.
* @param cstmrSno * @param cstmrSno
* @return * @return
*/ */
@ -97,6 +118,24 @@ public class PtyGroupQueryRepository{
builder.and(dtl.groupAuthCd.eq("MASTER")); builder.and(dtl.groupAuthCd.eq("MASTER"));
/**
* 고객고유번호[cstmrSno] 조건,
* 그룹내애 권한[groupAuthCd] 조건 ,
* 사용여부 [useYn] 조건으로 조회하는 SQL 입니다.
*
* SELECT
* PGB.GROUP_ID ,
* PGB.GROUP_NM ,
* PGB.GROUP_TYPE_CD ,
* PGB.UPDATE_DT ,
* PGB.CREATE_DT
* FROM PTY_GROUP_BAS PGB
* LEFT OUTER JOIN PTY_CSTMR_GROUP PCG
* ON PGB.GROUP_ID = PCG.GROUP_ID
* WHERE PGB.USE_YN = 'Y'
* AND PCG.CSTMR_SNO = #{cstmrSno}
* AND PCG.GROUP_AUTH_CD = 'MASTER'
*/
List<BasGroupModel> result = List<BasGroupModel> result =
query.select(Projections.bean(BasGroupModel.class , query.select(Projections.bean(BasGroupModel.class ,
bas.groupId, bas.groupId,
@ -116,7 +155,7 @@ public class PtyGroupQueryRepository{
} }
/** /**
* 그룹 목록 * Super, Admin권한으로 그룹을 조회하는 SQL 기능.
* @param cstmrSno * @param cstmrSno
* @return * @return
*/ */
@ -127,7 +166,25 @@ public class PtyGroupQueryRepository{
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
builder.and(bas.useYn.eq("Y")); builder.and(bas.useYn.eq("Y"));
builder.and(group.groupAuthCd.eq("MASTER")); builder.and(group.groupAuthCd.eq("MASTER"));
/**
* 사용여부[useYn] 조건,
* 그룹권한[groupAuthCd] 조건 으로 조회하는 SQL입니다.
*
* SELECT
* PGB.GROUP_ID ,
* PGB.GROUP_NM ,
* PCG.GROUP_AUTH_CD ,
* PGB.CREATE_DT ,
* PCG.CSTMR_GROUP_SNO
* FROM PTY_GROUP_BAS PGB
* LEFT OUTER JOIN PTY_CSTMR_GROUP PCG
* ON PGB.GROUP_ID = PCG.GROUP_ID
* WHERE PGB.USE_YN = 'Y'
* AND PCG.GROUP_AUTH_CD = 'MASTER'
* GROUP BY PGB.GROUP_ID
* ORDER BY PGB.CREATE_DT DESC, PGB.GROUP_ID ASC
*/
List<BasGroupJoinModel> result = query.select(Projections.bean(BasGroupJoinModel.class , List<BasGroupJoinModel> result = query.select(Projections.bean(BasGroupJoinModel.class ,
bas.groupId, bas.groupId,
bas.groupNm, bas.groupNm,
@ -147,7 +204,24 @@ public class PtyGroupQueryRepository{
BooleanBuilder builder2 = new BooleanBuilder(); BooleanBuilder builder2 = new BooleanBuilder();
builder2.and(bas.useYn.eq("Y")); builder2.and(bas.useYn.eq("Y"));
builder2.and(group.cstmrGroupSno.isNotNull()); builder2.and(group.cstmrGroupSno.isNotNull());
/**
* 사용여부[useYn] 조건,
* 그룹권한[groupAuthCd] NULL이 아닌 조건으로 조회하는 SQL입니다.
*
* SELECT
* PGB.GROUP_ID ,
* PGB.GROUP_NM ,
* PCG.CSTMR_GROUP_SNO ,
* PCG.CSTMR_SNO ,
* PCG.GROUP_AUTH_CD
* FROM PTY_GROUP_BAS PGB
* LEFT OUTER JOIN PTY_CSTMR_GROUP PCG
* ON PGB.GROUP_ID = PCG.GROUP_ID
* ON PCG.CSTMR_SNO = #{cstmrSno}
* WHERE PGB.USE_YN = 'Y'
* AND PCG.GROUP_AUTH_CD IS NOT NULL
*/
List<BasGroupUserModel> my = query.select(Projections.bean(BasGroupUserModel.class , List<BasGroupUserModel> my = query.select(Projections.bean(BasGroupUserModel.class ,
bas.groupId, bas.groupId,
bas.groupNm, bas.groupNm,
@ -175,6 +249,11 @@ public class PtyGroupQueryRepository{
return result; return result;
} }
/**
* User 권한으로 그룹을 조회하는 SQL 기능.
* @param cstmrSno
* @return
*/
public List<BasGroupJoinModel> groupUserList(int cstmrSno){ public List<BasGroupJoinModel> groupUserList(int cstmrSno){
QPtyGroupBas bas = QPtyGroupBas.ptyGroupBas; QPtyGroupBas bas = QPtyGroupBas.ptyGroupBas;
QPtyCstmrGroup group = QPtyCstmrGroup.ptyCstmrGroup; QPtyCstmrGroup group = QPtyCstmrGroup.ptyCstmrGroup;
@ -184,7 +263,26 @@ public class PtyGroupQueryRepository{
builder.and(group.joinYn.eq("Y")); builder.and(group.joinYn.eq("Y"));
builder.and(group.cstmrSno.eq(cstmrSno)); builder.and(group.cstmrSno.eq(cstmrSno));
/**
* 사용여부[useYn] 조건,
* 참여여부[joinYn] 조건,
* 유저고유번호[cstmrSno] 조건으로 조회하는 SQL입니다.
*
* SELECT
* PGB.GROUP_ID ,
* PGB.GROUP_NM ,
* PGB.CREATE_DT ,
* PCG.CSTMR_GROUP_SNO
* FROM PTY_GROUP_BAS PGB
* LEFT OUTER JOIN PTY_CSTMR_GROUP PCG
* ON PGB.GROUP_ID = PCG.GROUP_ID
* WHERE PGB.USE_YN = 'Y'
* AND PCG.JOIN_YN = 'Y'
* AND PCG.CSTMR_SNO = #{cstmrSno}
* GROUP BY PGB.GROUP_ID
* ORDER BY PGB.CREATE_DT DESC, PGB.GROUP_NM ASC
*/
List<BasGroupJoinModel> result = query.select(Projections.bean(BasGroupJoinModel.class , List<BasGroupJoinModel> result = query.select(Projections.bean(BasGroupJoinModel.class ,
bas.groupId, bas.groupId,
bas.groupNm, bas.groupNm,
@ -203,7 +301,7 @@ public class PtyGroupQueryRepository{
} }
/** /**
* 나의 그룹 - 참여 그룹 목록 * 나의 그룹 - 참여 그룹 목록 조회하는 SQL기능.
* @param cstmrSno * @param cstmrSno
* @return * @return
*/ */
@ -216,6 +314,31 @@ public class PtyGroupQueryRepository{
builder.and(dtl.joinYn.eq("Y")); builder.and(dtl.joinYn.eq("Y"));
builder.and(dtl.cstmrSno.eq(cstmrSno)); builder.and(dtl.cstmrSno.eq(cstmrSno));
/**
* 고객고유번호[cstmrSno] 조건,
* 참여여부[joinYn] 조건,
* 사용여부[useYn] 조건으로 참여그룹을 조회하는 SQL입니다.
*
* SELECT
* PGB.GROUP_ID ,
* PGB.GROUP_NM ,
* PGB.GROUP_TYPE_CD ,
* PGB.TRMNL_ID ,
* PCG.CSTMR_SNO ,
* PCG.CSTMR_GROUP_SNO ,
* PGB.UPDATE_DT ,
* PGB.CREATE_DT ,
* PCG.APRVL_YN ,
* PCG.JOIN_DT ,
* PCG.APRVL_DT ,
* PCG.GROUP_AUTH_CD
* FROM PTY_GROUP_BAS PGB
* LEFT OUTER JOIN PTY_CSTMR_GROUP PCG
* ON PGB.GROUP_ID = PCG.GROUP_ID
* WHERE PGB.USE_YN = 'Y'
* AND PCG.JOIN_YN = 'Y'
* AND PCG.CSTMR_SNO = #{cstmrSno}
*/
List<BasGroupJoinModel> result = List<BasGroupJoinModel> result =
query.select(Projections.bean(BasGroupJoinModel.class , query.select(Projections.bean(BasGroupJoinModel.class ,
bas.groupId, bas.groupId,

Loading…
Cancel
Save