mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 12:13:24 +09:00
#수정
stock/create.jsp stock/list.jsp stock/read.jsp stock/update.jsp WarehouseController.java WarehouseMapper.xml
This commit is contained in:
@@ -172,7 +172,7 @@ public class StockController {
|
|||||||
@PostMapping("/show_modal")
|
@PostMapping("/show_modal")
|
||||||
public ModelAndView showModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
public ModelAndView showModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||||
@RequestParam(name = "search", defaultValue = "") String search,
|
@RequestParam(name = "search", defaultValue = "") String search,
|
||||||
@RequestParam(name = "p", defaultValue = "1") int page, String product_id,
|
@RequestParam(name = "p", defaultValue = "1") int page,
|
||||||
@RequestParam String name, ModelAndView mav){
|
@RequestParam String name, ModelAndView mav){
|
||||||
|
|
||||||
int perPage = 5; // 한 페이지에 보일 글의 갯수
|
int perPage = 5; // 한 페이지에 보일 글의 갯수
|
||||||
@@ -193,10 +193,9 @@ public class StockController {
|
|||||||
list = service.productSelect(searchn, search, startRow, perPage);
|
list = service.productSelect(searchn, search, startRow, perPage);
|
||||||
count = service.productCount(searchn, search);
|
count = service.productCount(searchn, search);
|
||||||
}else if(name.equals("warehouse_capacity_currentCapacity")) {
|
}else if(name.equals("warehouse_capacity_currentCapacity")) {
|
||||||
list = service.warehousesSelect(searchn, search, startRow, perPage ,product_id);
|
list = service.warehousesSelect(searchn, search, startRow, perPage);
|
||||||
count = service.warehouseCount(searchn, search ,product_id);
|
count = service.warehouseCount(searchn, search);
|
||||||
}
|
}
|
||||||
System.out.println("테스트 :: "+ product_id);
|
|
||||||
mav.addObject("list", list);
|
mav.addObject("list", list);
|
||||||
|
|
||||||
mav.addObject("start", startRow + 1);
|
mav.addObject("start", startRow + 1);
|
||||||
|
|||||||
@@ -121,26 +121,24 @@ public class StockService {
|
|||||||
return mapper.productCount(m);
|
return mapper.productCount(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Map<String, Object>> warehousesSelect(int searchn, String search, int start, int perPage, String product_id){
|
public List<Map<String, Object>> warehousesSelect(int searchn, String search, int start, int perPage){
|
||||||
Map<String, Object> m = new HashMap<String, Object>();
|
Map<String, Object> m = new HashMap<String, Object>();
|
||||||
m.put("searchn", searchn);
|
m.put("searchn", searchn);
|
||||||
m.put("search", search);
|
m.put("search", search);
|
||||||
m.put("start", start);
|
m.put("start", start);
|
||||||
m.put("perPage", perPage);
|
m.put("perPage", perPage);
|
||||||
m.put("product_id", product_id);
|
|
||||||
|
|
||||||
List<Map<String, Object>> warehouseresult = mapper.warehouseSelect(m);
|
List<Map<String, Object>> warehouseresult = mapper.warehouseSelect(m);
|
||||||
|
|
||||||
return warehouseresult;
|
return warehouseresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int warehouseCount(int searchn, String search, String product_id) {
|
public int warehouseCount(int searchn, String search) {
|
||||||
|
|
||||||
|
|
||||||
Map<String,Object> m = new HashMap<String, Object>();
|
Map<String,Object> m = new HashMap<String, Object>();
|
||||||
m.put("searchn",searchn);
|
m.put("searchn",searchn);
|
||||||
m.put("search", search);
|
m.put("search", search);
|
||||||
m.put("product_id", product_id);
|
|
||||||
return mapper.warehouseCount(m);
|
return mapper.warehouseCount(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,9 +147,9 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> (s.product_id <> #{product_id} or s.product_id is null) and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
<when test="searchn == 0"> w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 1"> (s.product_id <> #{product_id} or s.product_id is null) and w.activation = 1 and address like concat('%',#{search},'%')</when>
|
<when test="searchn == 1"> w.activation = 1 and address like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 2"> (s.product_id <> #{product_id} or s.product_id is null) and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
<when test="searchn == 2"> w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
order by w.name desc limit #{start}, #{perPage}
|
order by w.name desc limit #{start}, #{perPage}
|
||||||
@@ -162,9 +162,9 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> (s.product_id <> #{product_id} or s.product_id is null) and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
<when test="searchn == 0"> w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 1"> (s.product_id <> #{product_id} or s.product_id is null) and w.activation = 1 and address like concat('%',#{search},'%')</when>
|
<when test="searchn == 1"> w.activation = 1 and address like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 2"> (s.product_id <> #{product_id} or s.product_id is null) and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
<when test="searchn == 2"> and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user