角色权限列表查询

master
shijie 4 years ago
parent 062963fbc0
commit 9c5987aa7b
  1. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/RolePermissionMapper.java
  2. 5
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/RolePermissionServiceImpl.java
  3. 6
      dq-financial-hrms-auth/src/main/resources/mapper/hrmsauth/RolePermissionMapper.xml
  4. 5
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/response/RolePermissionResponse.java

@ -15,7 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2020-09-07 16:26:04 * @date 2020-09-07 16:26:04
*/ */
@Mapper @Mapper
public interface PermissionDao extends BaseMapper<PermissionEntity> { public interface RolePermissionMapper extends BaseMapper<PermissionEntity> {
IPage<PermissionEntity> pageByCondition(Page page); IPage<PermissionEntity> pageByCondition(Page page);
} }

@ -3,10 +3,9 @@ package com.daqing.financial.hrauth.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.hrauth.dao.PermissionDao; import com.daqing.financial.hrauth.dao.RolePermissionMapper;
import com.daqing.financial.hrauth.service.RolePermissionService; import com.daqing.financial.hrauth.service.RolePermissionService;
import com.daqing.framework.domain.hrms.PermissionEntity; import com.daqing.framework.domain.hrms.PermissionEntity;
import com.daqing.framework.domain.hrms.SystemLog;
import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.PageUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -16,7 +15,7 @@ import java.util.stream.Collectors;
@Service("rolePermissionService") @Service("rolePermissionService")
public class RolePermissionServiceImpl extends ServiceImpl<PermissionDao, PermissionEntity> implements RolePermissionService { public class RolePermissionServiceImpl extends ServiceImpl<RolePermissionMapper, PermissionEntity> implements RolePermissionService {
@Override @Override
public List<PermissionEntity> listWithTree() { public List<PermissionEntity> listWithTree() {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.hrauth.dao.PermissionDao"> <mapper namespace="com.daqing.financial.hrauth.dao.RolePermissionMapper">
<!-- 可根据自己的需求,是否要使用 --> <!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.PermissionEntity" id="permissionMap"> <resultMap type="com.daqing.framework.domain.hrms.PermissionEntity" id="permissionMap">
@ -18,8 +18,8 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/> <result property="motifyTime" column="motify_time"/>
</resultMap> </resultMap>
<select id="pageByCondition" resultType="com.daqing.framework.domain.hrms.PermissionEntity"> <select id="pageByCondition" resultType="com.daqing.framework.domain.hrms.response.RolePermissionResponse">
select hr.`name`,hr.description,GROUP_CONCAT(hp.`name`separator '/') select hr.`name`,hr.description,GROUP_CONCAT(hp.`name`separator '/') as permissionName
FROM hrms_role_permission rp FROM hrms_role_permission rp
LEFT JOIN hrms_role hr on hr.id = rp.role_id LEFT JOIN hrms_role hr on hr.id = rp.role_id
LEFT JOIN hrms_permission hp on hp.id= rp.permission_id LEFT JOIN hrms_permission hp on hp.id= rp.permission_id

@ -23,5 +23,10 @@ import java.util.List;
public class RolePermissionResponse implements Serializable { public class RolePermissionResponse implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String name;
private String description;
private String permissionName;
} }

Loading…
Cancel
Save