作者 朱兆平

add: 增加用户管理搜索项

... ... @@ -72,10 +72,16 @@ public class UserController {
@RequestParam(value = "pageSize",required = false,defaultValue = "5")
int pageSize,
@RequestParam(value = "userName",required = false) String username,
@RequestParam(value = "realName",required = false) String realname)
@RequestParam(value = "realName",required = false) String realname,
@RequestParam(value = "online",required = false) Boolean online,
@RequestParam(value = "loginFlag",required = false) String loginFlag)
{
PageInfo<KakoUser> usersPageInfo = userService.selectAllUser(pageNum,pageSize, username, realname);
KakoUser kakoUser = new KakoUser();
kakoUser.setLoginFlag(loginFlag);
kakoUser.setLoginName(username);
kakoUser.setName(realname);
kakoUser.setOnline(online);
PageInfo<KakoUser> usersPageInfo = userService.selectAllUser(pageNum,pageSize, kakoUser);
return new ResultJson("200","success",usersPageInfo);
}
... ...
... ... @@ -13,7 +13,7 @@ public interface KakoUserService {
KakoUser loadByUsername(String username);
PageInfo<KakoUser> selectAllUser(int pageNum, int pageSize, String username, String realName);
PageInfo<KakoUser> selectAllUser(int pageNum, int pageSize, KakoUser kakoUser);
int insertSelective(KakoUser record);
... ...
... ... @@ -59,11 +59,8 @@ public class KakoUserServiceImpl implements KakoUserService{
}
@Override
public PageInfo<KakoUser> selectAllUser(int pageNum, int pageSize,String username, String realName){
public PageInfo<KakoUser> selectAllUser(int pageNum, int pageSize,KakoUser users){
Page<KakoUser> page = PageHelper.startPage(pageNum,pageSize);
KakoUser users = new KakoUser();
users.setLoginName(username);
users.setName(realName);
List<KakoUser> list = kakoUserMapper.selectAllUser(users);
for (KakoUser user: list) {
// List<PERMISSION> permissionList = permissionMapper.findByUserId(user.getUserId());
... ...
... ... @@ -40,14 +40,21 @@
select
<include refid="Base_Column_List" />
from sys_user
WHERE 1=1
and del_flag= '0'
<if test=" loginName != null" >
and login_name like concat('%',#{loginName,jdbcType=VARCHAR},'%')
</if>
<if test="name != null" >
and name like concat('%',#{name,jdbcType=VARCHAR},'%')
</if>
<where>
and del_flag= '0'
<if test=" loginName != null" >
and login_name like concat('%',#{loginName,jdbcType=VARCHAR},'%')
</if>
<if test="name != null" >
and name like concat('%',#{name,jdbcType=VARCHAR},'%')
</if>
<if test="online != null" >
and online = #{online,jdbcType=BOOLEAN}
</if>
<if test="loginFlag != null" >
and login_flag = #{loginFlag,jdbcType=VARCHAR}
</if>
</where>
</select>
<select id="selectByUsername" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
... ...