1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package com.govmade.modules.system.service.impl;
import java.util.Map;
import java.util.Set;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.govmade.common.utils.PageUtils;
import com.govmade.common.utils.Query;
import com.govmade.modules.system.dao.UserDao;
import com.govmade.modules.system.entity.UserEntity;
import com.govmade.modules.system.service.UserService;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
/**
* 系统管理 - 用户设置
*
* @author Fred
* @email fangtaosh@qq.com
* @date 2018年8月7日
*/
@Service("UserService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
// TODO Auto-generated method stub
String username = (String) params.get("username");
Long createBy = (Long) params.get("createBy");
Long deptId = (Long) params.get("deptId");
Page<UserEntity> page = this.selectPage(new Query<UserEntity>(params).getPage(),
new EntityWrapper<UserEntity>().like(StrUtil.isNotBlank(username), "username", username)
.eq(deptId != null, "dept_id", deptId).eq(createBy != null, "create_by", createBy));
return new PageUtils(page);
}
@Override
public UserEntity queryById(Long id) {
return super.selectById(id);
}
@Override
public void save(UserEntity user) {
super.insertOrUpdate(user);
}
@Override
public void deleteBatch(Set<Long> ids) {
this.baseMapper.deleteBatch(ids);
}
@Override
public boolean updatePassword(Long userId, String password, String newPassword) {
// TODO Auto-generated method stub
return false;
}
@Override
public Integer checkUser(String username) {
return super.selectCount(new EntityWrapper<UserEntity>().eq("username", username));
}
@Override
public UserEntity queryOne(Map<String, Object> params) {
String username = (String) params.get("username");
return (UserEntity) this
.selectOne(new EntityWrapper<UserEntity>().eq(StrUtil.isNotBlank(username), "username", username));
}
}