|
@@ -0,0 +1,80 @@
|
|
|
+package com.jpsoft.employment.modules.sys.service.impl;
|
|
|
+
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.employment.modules.sys.dao.RolePermissionDAO;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.RolePermission;
|
|
|
+import com.jpsoft.employment.modules.sys.service.RolePermissionService;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Transactional
|
|
|
+@Component(value="rolePermissionService")
|
|
|
+public class RolePermissionServiceImpl implements RolePermissionService {
|
|
|
+ @Resource(name="rolePermissionDAO")
|
|
|
+ private RolePermissionDAO rolePermissionDAO;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public RolePermission get(String id) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ return rolePermissionDAO.get(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int insert(RolePermission model) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ //model.setId(UUID.randomUUID().toString());
|
|
|
+
|
|
|
+ return rolePermissionDAO.insert(model);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int update(RolePermission model) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ return rolePermissionDAO.update(model);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int delete(String id) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ return rolePermissionDAO.delete(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean exist(String id) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ int count = rolePermissionDAO.exist(id);
|
|
|
+
|
|
|
+ return count > 0 ? true : false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<RolePermission> list() {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ return rolePermissionDAO.list();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<RolePermission> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,List<Sort> sortList) {
|
|
|
+ Page<RolePermission> page = PageHelper.startPage(pageNumber,pageSize).doSelectPage(()->{
|
|
|
+ rolePermissionDAO.search(searchParams,sortList);
|
|
|
+ });
|
|
|
+
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<RolePermission> findByRoleId(String roleId) {
|
|
|
+ return rolePermissionDAO.findByRoleId(roleId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int deleteByRoleId(String roleId) {
|
|
|
+ return rolePermissionDAO.deleteByRoleId(roleId);
|
|
|
+ }
|
|
|
+}
|