회원가입, 회원정보수정, 회원탈퇴, 패스워드초기화, 상태수정, 역할 추가, 역할 삭제, 회원목록 추가
This commit is contained in:
@@ -18,7 +18,8 @@ public class MapSheetMngCoreService {
|
||||
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
|
||||
}
|
||||
|
||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.@Valid searchReq searchReq) {
|
||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(
|
||||
MapSheetMngDto.@Valid searchReq searchReq) {
|
||||
return mapSheetMngRepository.findMapSheetMngList(searchReq);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.config.BCryptSaltGenerator;
|
||||
import com.kamco.cd.kamcoback.members.dto.MembersDto;
|
||||
import com.kamco.cd.kamcoback.members.exception.MemberException;
|
||||
import com.kamco.cd.kamcoback.members.exception.MemberException.MemberNotFoundException;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MemberArchivedEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MemberEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MemberRoleEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MemberRoleEntityId;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.members.MembersArchivedRepository;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.members.MembersRepository;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.members.MembersRoleRepository;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.mindrot.jbcrypt.BCrypt;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -19,6 +25,10 @@ public class MembersCoreService {
|
||||
|
||||
private final MembersRepository membersRepository;
|
||||
private final MembersRoleRepository memberRoleRepository;
|
||||
private final MembersArchivedRepository memberArchivedRepository;
|
||||
|
||||
@Value("${member.init_password}")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 회원가입
|
||||
@@ -46,6 +56,32 @@ public class MembersCoreService {
|
||||
return membersRepository.save(memberEntity).getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원정보 수정
|
||||
*
|
||||
* @param uuid
|
||||
* @param updateReq
|
||||
*/
|
||||
public void updateMembers(UUID uuid, MembersDto.UpdateReq updateReq) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository.findByUUID(uuid).orElseThrow(() -> new MemberNotFoundException());
|
||||
|
||||
if (updateReq.getEmployeeNo() != null && !memberEntity.getEmployeeNo().isEmpty()) {
|
||||
memberEntity.setEmployeeNo(updateReq.getEmployeeNo());
|
||||
}
|
||||
if (updateReq.getName() != null && !updateReq.getName().isEmpty()) {
|
||||
memberEntity.setName(updateReq.getName());
|
||||
}
|
||||
if (updateReq.getPassword() != null && !updateReq.getPassword().isEmpty()) {
|
||||
memberEntity.setPassword(updateReq.getPassword());
|
||||
}
|
||||
if (updateReq.getEmail() != null && !updateReq.getEmail().isEmpty()) {
|
||||
memberEntity.setEmail(updateReq.getEmail());
|
||||
}
|
||||
|
||||
membersRepository.save(memberEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 역할 추가
|
||||
*
|
||||
@@ -96,6 +132,74 @@ public class MembersCoreService {
|
||||
memberRoleRepository.delete(memberRoleEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 상태 수정
|
||||
*
|
||||
* @param statusDto
|
||||
*/
|
||||
public void updateStatus(MembersDto.StatusDto statusDto) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository
|
||||
.findByUUID(statusDto.getUuid())
|
||||
.orElseThrow(() -> new MemberNotFoundException());
|
||||
|
||||
memberEntity.setStatus(statusDto.getStatus());
|
||||
memberEntity.setUpdatedDttm(ZonedDateTime.now());
|
||||
membersRepository.save(memberEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원 탈퇴
|
||||
*
|
||||
* @param statusDto
|
||||
*/
|
||||
public void deleteAccount(MembersDto.StatusDto statusDto) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository
|
||||
.findByUUID(statusDto.getUuid())
|
||||
.orElseThrow(() -> new MemberNotFoundException());
|
||||
|
||||
MemberArchivedEntity memberArchivedEntity = new MemberArchivedEntity();
|
||||
memberArchivedEntity.setUuid(memberEntity.getUuid());
|
||||
memberArchivedEntity.setId(memberEntity.getId());
|
||||
memberArchivedEntity.setEmployeeNo(memberEntity.getEmployeeNo());
|
||||
memberArchivedEntity.setName(memberEntity.getName());
|
||||
memberArchivedEntity.setPassword(memberEntity.getPassword());
|
||||
memberArchivedEntity.setEmail(memberEntity.getEmail());
|
||||
memberArchivedEntity.setStatus(memberEntity.getStatus());
|
||||
memberArchivedEntity.setCreatedDttm(memberEntity.getCreatedDttm());
|
||||
memberArchivedEntity.setArchivedDttm(ZonedDateTime.now());
|
||||
memberArchivedRepository.save(memberArchivedEntity);
|
||||
|
||||
memberEntity.setStatus("ARCHIVED");
|
||||
memberEntity.setName("**********");
|
||||
memberEntity.setEmployeeNo("**********");
|
||||
memberEntity.setPassword("**********");
|
||||
memberEntity.setEmail("**********");
|
||||
memberEntity.setUpdatedDttm(ZonedDateTime.now());
|
||||
membersRepository.save(memberEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 패스워드 초기화
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void resetPassword(Long id) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository.findById(id).orElseThrow(() -> new MemberNotFoundException());
|
||||
|
||||
String salt =
|
||||
BCryptSaltGenerator.generateSaltWithEmployeeNo(memberEntity.getEmployeeNo().trim());
|
||||
// 패스워드 암호화, 초기 패스워드 고정
|
||||
String hashedPassword = BCrypt.hashpw(password, salt);
|
||||
|
||||
memberEntity.setPassword(hashedPassword);
|
||||
memberEntity.setStatus("INACTIVE");
|
||||
memberEntity.setUpdatedDttm(ZonedDateTime.now());
|
||||
membersRepository.save(memberEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원목록 조회
|
||||
*
|
||||
|
||||
@@ -50,5 +50,4 @@ public class MapSheetMngEntity {
|
||||
@ColumnDefault("'NULL::character varying'")
|
||||
@Column(name = "mng_path")
|
||||
private String mngPath;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.UUID;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -20,11 +20,10 @@ public class MemberArchivedEntity {
|
||||
|
||||
@Id
|
||||
@Column(name = "uuid", nullable = false)
|
||||
private UUID id;
|
||||
private UUID uuid;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id1;
|
||||
private Long id;
|
||||
|
||||
@Size(max = 50)
|
||||
@Column(name = "employee_no", length = 50)
|
||||
@@ -51,10 +50,10 @@ public class MemberArchivedEntity {
|
||||
|
||||
@NotNull
|
||||
@Column(name = "created_dttm", nullable = false)
|
||||
private OffsetDateTime createdDttm;
|
||||
private ZonedDateTime createdDttm;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "archived_dttm", nullable = false)
|
||||
private OffsetDateTime archivedDttm;
|
||||
private ZonedDateTime archivedDttm;
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ public class MemberEntity {
|
||||
private String email;
|
||||
|
||||
@Size(max = 20)
|
||||
@ColumnDefault("'ACTIVE'")
|
||||
@ColumnDefault("'INACTIVE'")
|
||||
@Column(name = "status", length = 20)
|
||||
private String status = "ACTIVE";
|
||||
private String status = "INACTIVE";
|
||||
|
||||
@Column(name = "created_dttm", nullable = false, insertable = false)
|
||||
private ZonedDateTime createdDttm;
|
||||
|
||||
@@ -5,8 +5,8 @@ import jakarta.validation.Valid;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
public interface MapSheetMngRepositoryCustom {
|
||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(MapSheetMngDto.@Valid searchReq searchReq);
|
||||
Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||
MapSheetMngDto.@Valid searchReq searchReq);
|
||||
|
||||
Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.@Valid searchReq searchReq);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.mapsheet;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx50kEntity.mapInkx50kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngEntity.mapSheetMngEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngHstEntity.mapSheetMngHstEntity;
|
||||
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto;
|
||||
import com.kamco.cd.kamcoback.members.dto.RoleType;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Expression;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
@@ -12,23 +15,16 @@ import com.querydsl.core.types.dsl.NumberExpression;
|
||||
import com.querydsl.core.types.dsl.StringExpression;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import jakarta.validation.Valid;
|
||||
import jdk.jfr.Experimental;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.support.QuerydslRepositorySupport;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngHstEntity.mapSheetMngHstEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngEntity.mapSheetMngEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx50kEntity.mapInkx50kEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
implements MapSheetMngRepositoryCustom {
|
||||
implements MapSheetMngRepositoryCustom {
|
||||
|
||||
private final JPAQueryFactory queryFactory;
|
||||
private final StringExpression NULL_STRING = Expressions.stringTemplate("cast(null as text)");
|
||||
@@ -39,101 +35,112 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(MapSheetMngDto.@Valid searchReq searchReq) {
|
||||
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
|
||||
MapSheetMngDto.@Valid searchReq searchReq) {
|
||||
|
||||
Pageable pageable = PageRequest.of(searchReq.getPage(), searchReq.getSize());
|
||||
List<MapSheetMngDto.ErrorDataDto> foundContent = queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.ErrorDataDto.class,
|
||||
mapSheetMngHstEntity.hstUid,
|
||||
rowNum(),
|
||||
Expressions.stringTemplate("concat({0}, {1})", mapSheetMngHstEntity.mapSheetName, mapInkx50kEntity.mapidcdNo),
|
||||
Expressions.stringTemplate("concat({0}, substring({1}, {2}, {3}))", mapSheetMngHstEntity.mapSheetName, mapSheetMngHstEntity.mapSheetNum, 6, 8),
|
||||
mapSheetMngHstEntity.mapSheetCodeSrc,
|
||||
Expressions.stringTemplate("to_char({0}, 'YYYY-MM-DD')", mapSheetMngHstEntity.createdDate),
|
||||
mapSheetMngHstEntity.dataState
|
||||
)
|
||||
)
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||
.leftJoin(mapInkx50kEntity)
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), //오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq)
|
||||
)
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
||||
.fetch();
|
||||
List<MapSheetMngDto.ErrorDataDto> foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.ErrorDataDto.class,
|
||||
mapSheetMngHstEntity.hstUid,
|
||||
rowNum(),
|
||||
Expressions.stringTemplate(
|
||||
"concat({0}, {1})",
|
||||
mapSheetMngHstEntity.mapSheetName, mapInkx50kEntity.mapidcdNo),
|
||||
Expressions.stringTemplate(
|
||||
"concat({0}, substring({1}, {2}, {3}))",
|
||||
mapSheetMngHstEntity.mapSheetName, mapSheetMngHstEntity.mapSheetNum, 6, 8),
|
||||
mapSheetMngHstEntity.mapSheetCodeSrc,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD')", mapSheetMngHstEntity.createdDate),
|
||||
mapSheetMngHstEntity.dataState))
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||
.leftJoin(mapInkx50kEntity)
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq))
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
||||
.fetch();
|
||||
|
||||
Long countQuery = queryFactory
|
||||
.select(mapSheetMngHstEntity.hstUid.count())
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||
.leftJoin(mapInkx50kEntity)
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), //오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq)
|
||||
)
|
||||
.fetchOne();
|
||||
Long countQuery =
|
||||
queryFactory
|
||||
.select(mapSheetMngHstEntity.hstUid.count())
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||
.leftJoin(mapInkx50kEntity)
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq))
|
||||
.fetchOne();
|
||||
|
||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(MapSheetMngDto.@Valid searchReq searchReq) {
|
||||
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(
|
||||
MapSheetMngDto.@Valid searchReq searchReq) {
|
||||
|
||||
Pageable pageable = searchReq.toPageable();
|
||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||
|
||||
if (searchReq.getMngYyyy() != null ) {
|
||||
if (searchReq.getMngYyyy() != null) {
|
||||
whereBuilder.and(mapSheetMngEntity.id.eq(searchReq.getMngYyyy()));
|
||||
}
|
||||
|
||||
List<MapSheetMngDto.MngDto> foundContent = queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.MngDto.class,
|
||||
Expressions.numberTemplate(Integer.class, "row_number() over(order by {0} desc)", mapSheetMngEntity.createdDttm),
|
||||
mapSheetMngEntity.id,
|
||||
mapSheetMngEntity.mngState,
|
||||
mapSheetMngEntity.syncState,
|
||||
Expressions.stringTemplate("to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.mngStateDttm),
|
||||
Expressions.stringTemplate("to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.syncStateDttm),
|
||||
mapSheetMngEntity.mngPath,
|
||||
Expressions.stringTemplate("to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.createdDttm),
|
||||
mapSheetMngEntity.createdUid,
|
||||
Expressions.stringTemplate("to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.updatedDttm),
|
||||
mapSheetMngEntity.updatedUid
|
||||
List<MapSheetMngDto.MngDto> foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
Projections.constructor(
|
||||
MapSheetMngDto.MngDto.class,
|
||||
Expressions.numberTemplate(
|
||||
Integer.class,
|
||||
"row_number() over(order by {0} desc)",
|
||||
mapSheetMngEntity.createdDttm),
|
||||
mapSheetMngEntity.id,
|
||||
mapSheetMngEntity.mngState,
|
||||
mapSheetMngEntity.syncState,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.mngStateDttm),
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.syncStateDttm),
|
||||
mapSheetMngEntity.mngPath,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.createdDttm),
|
||||
mapSheetMngEntity.createdUid,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD HH24:MI:SS')", mapSheetMngEntity.updatedDttm),
|
||||
mapSheetMngEntity.updatedUid))
|
||||
.from(mapSheetMngEntity)
|
||||
.where(whereBuilder)
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetMngEntity.createdDttm.desc())
|
||||
.fetch();
|
||||
|
||||
)
|
||||
)
|
||||
.from(mapSheetMngEntity)
|
||||
.where(whereBuilder)
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetMngEntity.createdDttm.desc())
|
||||
.fetch();
|
||||
|
||||
Long countQuery = queryFactory
|
||||
.select(mapSheetMngEntity.id.count())
|
||||
.from(mapSheetMngEntity)
|
||||
.where(whereBuilder)
|
||||
.fetchOne();
|
||||
Long countQuery =
|
||||
queryFactory
|
||||
.select(mapSheetMngEntity.id.count())
|
||||
.from(mapSheetMngEntity)
|
||||
.where(whereBuilder)
|
||||
.fetchOne();
|
||||
|
||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||
}
|
||||
|
||||
private NumberExpression<Integer> rowNum(){
|
||||
return Expressions.numberTemplate(Integer.class, "row_number() over(order by {0} desc)", mapSheetMngHstEntity.createdDate);
|
||||
private NumberExpression<Integer> rowNum() {
|
||||
return Expressions.numberTemplate(
|
||||
Integer.class, "row_number() over(order by {0} desc)", mapSheetMngHstEntity.createdDate);
|
||||
}
|
||||
|
||||
private BooleanExpression mapSheetErrorSearchValue(MapSheetMngDto.searchReq searchReq) {
|
||||
@@ -142,10 +149,11 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
}
|
||||
|
||||
// 검색어 1개 값이 도엽명 or 도엽번호 like 검색
|
||||
return Expressions.booleanTemplate("{0} like '%" + searchReq.getSearchValue() + "%'", mapSheetMngHstEntity.mapSheetName)
|
||||
.or(Expressions.booleanTemplate("{0} like '%" + searchReq.getSearchValue() + "%'", mapSheetMngHstEntity.mapSheetNum));
|
||||
return Expressions.booleanTemplate(
|
||||
"{0} like '%" + searchReq.getSearchValue() + "%'", mapSheetMngHstEntity.mapSheetName)
|
||||
.or(
|
||||
Expressions.booleanTemplate(
|
||||
"{0} like '%" + searchReq.getSearchValue() + "%'",
|
||||
mapSheetMngHstEntity.mapSheetNum));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.members;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MemberArchivedEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface MembersArchivedRepository
|
||||
extends JpaRepository<MemberArchivedEntity, Long>, MembersArchivedRepositoryCustom {}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.members;
|
||||
|
||||
public interface MembersArchivedRepositoryCustom {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.members;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class MembersArchivedRepositoryImpl implements MembersArchivedRepositoryCustom {}
|
||||
Reference in New Issue
Block a user