<?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="cn.ey.biz.module.system.dal.mapper.permission.RoleMapper">


 <select id="selectFunctionalRoles" resultType="cn.ey.biz.module.system.controller.admin.permission.vo.role.RoleSimpleFunctionalRespVO">
     SELECT a.sort,a.role_id as roleId,a.role_code as roleCode,a.role_name as roleName,s.app_code as appCode,s.app_name as appName
     FROM(
     SELECT sort,role_id, role_name,role_code,app_code FROM system_role WHERE deleted=0 and status=0
     ) a
     LEFT JOIN system_app s
     on a.app_code=s.app_code
     <where>
         <if test="roleName != null and roleName!=''">
             a.role_name like  concat('%',#{roleName},'%')
         </if>
         <if test="appName != null and appName!=''">
             and s.app_name like  concat('%',#{appName},'%')
         </if>
     </where>
 </select>

</mapper>

