gao.qiang 1 ano atrás
pai
commit
7d92921a40

+ 2 - 0
base-system/src/main/java/com/ozs/system/mapper/SysRoleMapper.java

@@ -121,4 +121,6 @@ public interface SysRoleMapper extends JoinBaseMapper<SysRole> {
     List<SysRole> selectSysRoleList(SysRoleRequestVo sysRoleRequestVo);
 
     String getRoleKey(@Param("roleId") Long roleId);
+
+    List<SysRole> roleList(SysRoleRequestVo sysRoleRequestVo);
 }

+ 1 - 1
base-system/src/main/java/com/ozs/system/service/impl/SysRoleServiceImpl.java

@@ -113,7 +113,7 @@ public class SysRoleServiceImpl extends JoinServiceImpl<SysRoleMapper, SysRole>
 
     @Override
     public List<SysRole> roleList(SysRoleRequestVo sysRoleRequestVo) {
-        return roleMapper.selectSysRoleList(sysRoleRequestVo);
+        return roleMapper.roleList(sysRoleRequestVo);
     }
 
     /**

+ 40 - 0
base-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -136,6 +136,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<select id="getRoleKey" resultType="java.lang.String">
 		select role_key from sys_role where role_id = #{roleId}
 	</select>
+	<select id="roleList" resultMap="SysRoleResult" parameterType="com.ozs.common.core.domain.vo.SysRoleRequestVo">
+		select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
+		r.status, r.del_flag, r.create_time, r.remark,r.update_by,r.update_time
+		from sys_role r
+		left  join sys_user_role ur on ur.role_id = r.role_id
+		left join sys_user u on u.id = ur.user_id
+		<where>
+			<if test="roleName != null and roleName != ''">
+				and r.role_name like concat('%', #{roleName}, '%')
+			</if>
+			<if test="roleId != null and roleId != 0">
+				and r.role_id = #{roleId}
+			</if>
+			<if test="status != null and status != 0">
+				and r.status=#{status}
+			</if>
+			<if test="status == null || status == ''">
+				AND r.status = '1'
+			</if>
+			<if test="!dsFlay">
+				and
+				<trim prefix="(" prefixOverrides="or" suffix=")">
+					<if test="dsUserId != null and dsUserId != ''">
+						or r.create_by=#{dsUserId}
+					</if>
+					<if test="dsDeptId != null and dsDeptId != 0">
+						or u.dept_id=#{dsDeptId}
+					</if>
+					<if test="dsDeptIds != null">
+						or	u.dept_id in
+						<foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+							#{item}
+						</foreach>
+					</if>
+				</trim>
+			</if>
+			and r.del_flag = '1'
+		</where>
+		order by r.role_sort
+	</select>
 
 	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
  		insert into sys_role(