| <?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.mzl.flower.mapper.system.RoleMapper"> | 
|     <select id="searchRole" resultType="com.mzl.flower.dto.response.system.RoleListDTO"> | 
|         SELECT role.ID AS id, | 
|         role.ROLE_NAME AS roleName, | 
|         role.DESCRIPTION AS roleDesc, | 
|         role.IS_SYS AS isSys, | 
|         role.create_by AS createdId, | 
|         role.create_time AS createdDate, | 
|         (SELECT NICK_NAME FROM t_user WHERE ID = role.create_by) AS createdName | 
|         FROM t_role role | 
|         WHERE 1 = 1 | 
|         <if test="condition.isSys != null and condition.isSys != ''"> | 
|             AND role.IS_SYS = #{condition.isSys} | 
|         </if> | 
|     </select> | 
|   | 
|     <select id="getUserRoleList" resultType="com.mzl.flower.entity.system.Role"> | 
|         SELECT * | 
|         FROM t_role r | 
|         JOIN t_user_role ur ON r.id = ur.ROLE_ID | 
|         WHERE 1 = 1 | 
|         <if test="userId != null and userId != ''"> | 
|             AND ur.USER_ID = #{userId} | 
|         </if> | 
|     </select> | 
|   | 
| </mapper> |