2024-06-24 17:32:19 +08:00
<?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">
<mapper namespace= "com.das.modules.auth.mapper.SysRoleMapper" >
2024-06-25 17:41:41 +08:00
<resultMap type= "com.das.modules.auth.entity.SysRole" id= "SysRoleMap" >
2024-06-24 17:32:19 +08:00
<result property= "id" column= "id" jdbcType= "BIGINT" />
<result property= "roleCode" column= "role_code" jdbcType= "VARCHAR" />
<result property= "roleName" column= "role_name" jdbcType= "VARCHAR" />
<result property= "revision" column= "revision" jdbcType= "VARCHAR" />
<result property= "createdBy" column= "created_by" jdbcType= "VARCHAR" />
<result property= "createdTime" column= "created_time" jdbcType= "VARCHAR" />
<result property= "updatedBy" column= "updated_by" jdbcType= "VARCHAR" />
<result property= "updatedTime" column= "updated_time" jdbcType= "VARCHAR" />
</resultMap>
2024-06-26 09:32:17 +08:00
<resultMap type= "com.das.modules.auth.domain.vo.SysRoleVo" id= "SysRoleAuthMap" >
<result property= "id" column= "id" jdbcType= "BIGINT" />
<result property= "roleCode" column= "role_code" jdbcType= "VARCHAR" />
<result property= "roleName" column= "role_name" jdbcType= "VARCHAR" />
<result property= "revision" column= "revision" jdbcType= "VARCHAR" />
<collection property= "list" column= "id" ofType= "com.das.modules.auth.domain.vo.SysRoleAuthVo" select= "queryAuthorityById" />
</resultMap>
<select id= "queryRoleList" resultMap= "SysRoleAuthMap" >
2024-06-24 17:32:19 +08:00
select * from sys_role
<where >
<if test= "sysRole.roleName != null and sysRole.roleName != ''" >
and role_name like concat('%',#{sysRole.roleName},'%')
</if>
</where>
</select>
2024-06-25 14:57:19 +08:00
<select id= "existRoleByRoleCode" resultType= "java.lang.Long" >
select count(1) from sys_role t where t.role_code=#{roleCode}
</select>
2024-06-26 14:54:29 +08:00
<select id= "existRoleByRoleId" resultType= "java.lang.Long" >
select count(1) from sys_role t where t.id=#{id}
</select>
2024-06-25 18:17:04 +08:00
<select id= "queryAuthorityById" resultType= "com.das.modules.auth.domain.vo.SysRoleAuthVo" >
select sa.id, sa.authority_code as authorityCode, sa.authority_name as authorityName from sys_authority sa left join sys_r_role_authority srra on sa.id = srra.authority_id
where srra.role_id = #{id}
</select>
2024-06-25 18:34:27 +08:00
<select id= "selectByCode" resultMap= "SysRoleMap" >
select * from sys_role t where t.role_code=#{roleCode}
</select>
<select id= "existRoleByName" resultType= "java.lang.Long" >
select count(1) from sys_role t where t.role_name=#{name}
</select>
2024-06-24 17:32:19 +08:00
</mapper>