|
|
|
@ -5,10 +5,7 @@ import com.xit.biz.ctgy.repository.IPublicBoardRepository;
|
|
|
|
|
import com.xit.biz.ctgy.service.IPublicBoardService;
|
|
|
|
|
import com.xit.core.support.jpa.JpaUtil;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import org.springframework.data.domain.Example;
|
|
|
|
|
import org.springframework.data.domain.ExampleMatcher;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
|
import org.springframework.data.domain.*;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
@ -22,13 +19,16 @@ public class PublicBoardService implements IPublicBoardService {
|
|
|
|
|
|
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
|
public Page<MinInfoBoard680> findAll(final MinInfoBoard680 entity, Pageable pageable) {
|
|
|
|
|
//Sort sort = Sort.by(Sort.Direction.ASC, "codeOrdr");
|
|
|
|
|
// Sort sort = Sort.by(Sort.Direction.DESC, "inCode");
|
|
|
|
|
pageable = JpaUtil.getPagingInfo(pageable);
|
|
|
|
|
// pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("inCode").descending())
|
|
|
|
|
ExampleMatcher exampleMatcher = ExampleMatcher.matchingAll()
|
|
|
|
|
.withMatcher("inTitle", contains())
|
|
|
|
|
.withMatcher("inName", contains());
|
|
|
|
|
Example<MinInfoBoard680> example = Example.of(entity, exampleMatcher);
|
|
|
|
|
Page<MinInfoBoard680> page = repository.findAll(example, pageable);
|
|
|
|
|
Page<MinInfoBoard680> page = repository.findAll(
|
|
|
|
|
example,
|
|
|
|
|
PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("inCode").descending()));
|
|
|
|
|
// List<CmmUser> userList = page.getContent();
|
|
|
|
|
return page;
|
|
|
|
|
}
|
|
|
|
|