mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
Merge branch 'master' of https://github.com/suhf/No1WMS.git
This commit is contained in:
@@ -33,10 +33,9 @@ public class PlanInController {
|
||||
|
||||
@GetMapping("/list")
|
||||
public ModelAndView list(ModelAndView mav,@RequestParam(defaultValue = "0") int searchn, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "1") int page){
|
||||
int perPage = 15;
|
||||
int perPage = 10;
|
||||
int startRow = (page - 1) * perPage;
|
||||
int count = planinservice.count(searchn, search);
|
||||
|
||||
int count = planinservice.count(searchn, search, startRow, perPage);
|
||||
|
||||
|
||||
int pageNum = 4;//보여질 페이지 번호 수
|
||||
|
||||
@@ -20,11 +20,13 @@ public class PlanInService {
|
||||
return mapper.selectAll(map);
|
||||
}
|
||||
|
||||
|
||||
int count(int searchn, String search){
|
||||
int count(int searchn, String search, int start, int perPage){
|
||||
System.out.printf("searchn : %d, search : %s, start : %d, perpage : %d", searchn, search, start, perPage);
|
||||
HashMap<String, Object> m = new HashMap<>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
m.put("start", start);
|
||||
m.put("perPage", perPage);
|
||||
return mapper.count(m);
|
||||
}
|
||||
|
||||
@@ -47,7 +49,4 @@ public class PlanInService {
|
||||
|
||||
return mapper.selectByQRHash(qrHash);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -127,9 +127,10 @@
|
||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||
select count(*) from ( SELECT 1 from plan_In i join product p
|
||||
<where>
|
||||
<choose>
|
||||
<choose>
|
||||
<when test="searchn == 0"> i.product_id = p.id and i.activation = 1 and i.view_group_number like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 1"> i.product_id = p.id and i.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> i.product_id = p.id and i.activation = 1 and i.group_number like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 2"> i.product_id = p.id and i.activation = 1 and i.quantity like concat(#{search})</when>
|
||||
</choose>
|
||||
</where>
|
||||
) t
|
||||
|
||||
@@ -31,6 +31,14 @@
|
||||
$form.trigger("submit");
|
||||
|
||||
}
|
||||
|
||||
function onPaging(target){
|
||||
const p = $(target).data("p");
|
||||
$("#pPage").val(p);
|
||||
const $form = $("#search_form");
|
||||
$form.attr("action", "/plan_in/list");
|
||||
$form.trigger("submit");
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="container">
|
||||
@@ -77,6 +85,23 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="page">
|
||||
<ul class="pagination justify-content-center">
|
||||
<c:if test="${begin > pageNum }">
|
||||
<li class="page-item"><a class="page-link" data-p='${begin-1 }' href="#" onclick="onPaging(this)">[<]</a></li>
|
||||
</c:if>
|
||||
<c:forEach begin="${begin }" end="${end}" var="i" varStatus="status">
|
||||
<li class="page-item <c:if test="${page eq status.count}">active</c:if> "><a class="page-link" data-p='${i}' href="#" onclick="onPaging(this)" >${i}</a></li>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<li class="page-item"><a class="page-link" data-p='${end+1}' href="#" onclick="onPaging(this)">[>]</a></li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="form" action='/plan_in/read' method="post">
|
||||
<input name="groupNumber" id="groupId" hidden>
|
||||
|
||||
Reference in New Issue
Block a user