Skip to content

Commit

Permalink
Merge branch 'chacky'
Browse files Browse the repository at this point in the history
  • Loading branch information
leechenxiang committed Nov 30, 2017
2 parents 6cab9a8 + b9f5c13 commit c8d6d5d
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public interface UserService {
* @author leechenxiang
* @date 2017年9月5日 上午11:14:46
*/
public JqGridResult queryUserList(String username, Integer page, Integer pageSize);
public JqGridResult queryUserList(SysUser user, Integer page, Integer pageSize);

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,23 @@ public boolean saveUser(SysUser user) {
}

@Override
public JqGridResult queryUserList(String username, Integer page, Integer pageSize) {
public JqGridResult queryUserList(SysUser user, Integer page, Integer pageSize) {

PageHelper.startPage(page, pageSize);

SysUserExample ue = new SysUserExample();
Criteria uc = ue.createCriteria();

if (StringUtils.isNotEmpty(username)) {
uc.andUsernameLike("%" + username + "%");
if (StringUtils.isNotEmpty(user.getUsername())) {
uc.andUsernameLike("%" + user.getUsername() + "%");
}

if (StringUtils.isNotEmpty(user.getNickname())) {
uc.andNicknameLike("%" + user.getNickname() + "%");
}

if (user.getSex() != null) {
uc.andSexEqualTo(user.getSex());
}

uc.andIsDeleteEqualTo(YesOrNo.NO.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public JqGridResult getUserInfoList(SysUser user, Integer page){
page = 1;
}

JqGridResult result = userService.queryUserList(null, page, pageSize);
JqGridResult result = userService.queryUserList(user, page, pageSize);

return result;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<script src="<%=request.getContextPath() %>/static/pages/js/userInfoList.js?v=1.0.2" type="text/javascript"></script>
<script src="<%=request.getContextPath() %>/static/pages/js/userInfoList.js?v=1.0.3" type="text/javascript"></script>

<!-- BEGIN PAGE HEADER-->
<!-- BEGIN PAGE BAR -->
Expand All @@ -24,6 +24,33 @@

<!-- 用户信息列表 jqgrid start -->
<div class="row">

<!-- 搜索内容 -->
<div class="col-md-12">
<br/>

<form id="searchUserInfoListForm" action="<%=request.getContextPath() %>/admin/userInfo/queryAllUserList.shtml" class="form-inline" method="post" role="form">
<div class="form-group">
<label class="sr-only" for="username">用户名:</label>
<input id="username" name="username" type="text" class="form-control" placeholder="用户名" />
</div>
<div class="form-group">
<label class="sr-only" for="nickname">昵称:</label>
<input id="nickname" name="nickname" type="text" class="form-control" placeholder="昵称" />
</div>
<div class="form-group">
<label class="sr-only" for="sex">性别:</label>
<select class="form-control" id="sex" name="sex">
<option value="" >选择性别</option>
<option value="0" >女</option>
<option value="1" >男</option>
</select>
</div>
<button id="searchUserListButton" class="btn yellow-casablanca" type="button">搜 索</button>
</form>
</div>


<div class="col-md-12">
<br/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ var UserInfoList = function () {

// 不显示水平滚动条
jqGrid.closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });

// 条件查询所有用户列表
$("#searchUserListButton").click(function(){
var searchUserInfoListForm = $("#searchUserInfoListForm");
// console.log(searchUserInfoListForm.serialize());
jqGrid.jqGrid().setGridParam({
page: 1,
url: hdnContextPath + "/user/getUserInfoList.action?" + searchUserInfoListForm.serialize(),
}).trigger("reloadGrid");
});
}

return {
Expand Down

0 comments on commit c8d6d5d

Please sign in to comment.