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
package com.govmade.modules.system.service.impl;
import java.util.Map;
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.RoleDao;
import com.govmade.modules.system.entity.RoleEntity;
import com.govmade.modules.system.service.RoleService;
import cn.hutool.core.util.StrUtil;
/**
* 系统管理 - 角色设置
*
* @author 刘弈臻
* @date 2018年8月7日
*/
@Service("RoleService")
public class RoleServiceImpl extends ServiceImpl<RoleDao, RoleEntity> implements RoleService{
@Override
public PageUtils queryPage(Map<String, Object> params) {
String name = (String) params.get("name");
Page<RoleEntity> page = this.selectPage(new Query<RoleEntity>(params).getPage(),
new EntityWrapper<RoleEntity>()
.like(StrUtil.isNotBlank(name), "name", name));
return new PageUtils(page);
}
@Override
public void save(RoleEntity role) {
super.insertOrUpdate(role);
}
@Override
public void deleteBatch(Long[] roleIds) {
// TODO Auto-generated method stub
}
@Override
public Integer checkRole(String name) {
return super.selectCount(new EntityWrapper<RoleEntity>().eq("name",name));
}
}