|
|
@@ -0,0 +1,42 @@
|
|
|
+package com.goafanti.permission.service.impl;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import com.goafanti.common.dao.RoleMapper;
|
|
|
+import com.goafanti.common.dao.RolePermissionMapper;
|
|
|
+import com.goafanti.common.dao.UserMapper;
|
|
|
+import com.goafanti.common.dao.UserRoleMapper;
|
|
|
+import com.goafanti.common.model.Role;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
+import com.goafanti.core.mybatis.page.Pagination;
|
|
|
+import com.goafanti.permission.service.NewRoleService;
|
|
|
+@Service
|
|
|
+public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements NewRoleService {
|
|
|
+ @Autowired
|
|
|
+ RoleMapper roleMapper;
|
|
|
+ @Autowired
|
|
|
+ UserMapper userMapper;
|
|
|
+ @Autowired
|
|
|
+ UserRoleMapper userRoleMapper;
|
|
|
+ @Autowired
|
|
|
+ RolePermissionMapper rolePermissionMapper;
|
|
|
+ @Override
|
|
|
+ public Pagination<Role> findRoles(Role role, Integer pageNo, Integer pageSize) {
|
|
|
+ Map<String,Object> params =disposeParams(role);
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ Pagination<Role> p=(Pagination<Role>)findPage("selectRoleList","selectRoleCount",params,pageNo,pageSize);
|
|
|
+ return p;
|
|
|
+ }
|
|
|
+ private Map<String,Object> disposeParams(Role role){
|
|
|
+ Map<String,Object> params = new HashMap<String, Object>();
|
|
|
+ if(StringUtils.isNotBlank(role.getRoleName())) params.put("roleName", role.getRoleName());
|
|
|
+ return params;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|