stock/list.jsp
WarehouseController.java
WarehouseMapper.xml
WarehouseService.java
WarehouseMapper.java
This commit is contained in:
sungsu
2024-01-09 16:35:38 +09:00
parent b82403d064
commit cd726d6c42
5 changed files with 32 additions and 18 deletions

View File

@@ -22,14 +22,15 @@ public class WarehouseController {
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
int count = service.count(searchn, search);
int perPage = 10; // 한 페이지에 보일 글의 갯수
int perPage = 5; // 한 페이지에 보일 글의 갯수
int startRow = (page - 1) * perPage;
//스톡서비스로 재고 리스트 출력 메서트 작성
List<Object> dto = service.list(searchn, search, perPage);
List<WarehouseDto> dto = service.list(searchn, search, startRow ,perPage);
m.addAttribute("wlist", dto);
m.addAttribute("start", startRow + 1);
int pageNum = 4;//보여질 페이지 번호 수
int pageNum = 5;//보여질 페이지 번호 수
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
int begin = (page - 1) / pageNum * pageNum + 1;
@@ -41,6 +42,7 @@ public class WarehouseController {
m.addAttribute("end", end);
m.addAttribute("pageNum", pageNum);
m.addAttribute("totalPages", totalPages);
m.addAttribute("p" , page);
return "warehouse/list";
}

View File

@@ -11,7 +11,7 @@ public interface WarehouseMapper {
int count(Map<String, Object> m);//검색 글 갯수
List<Object> list(Map<String, Object> m);
List<WarehouseDto> list(Map<String, Object> m);
int updateWarehouse(WarehouseDto dto);

View File

@@ -22,7 +22,7 @@ public class WarehouseService {
}
public List<Object> list(int searchn, String search, int start){
public List<WarehouseDto> list(int searchn, String search, int start, int perPage){
System.out.println(searchn+search);
@@ -30,7 +30,7 @@ public class WarehouseService {
m.put("searchn",searchn);
m.put("search", search);
m.put("start", start);
m.put("perPage", 10);
m.put("perPage", perPage);
return mapper.list(m);