<?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.xmomen.module.base.mapper.PublicMapper" >

    <!--    查询消息    -->
    <select id="getManagerList" resultType="com.xmomen.module.base.model.CompanyCustomerManager" parameterType="java.util.HashMap">
       select 
       su.id as customerMangerId,
       su.realName as customerManger
       from sys_users su 
       left join sys_users_roles sur on sur.USER_ID = su.ID 
       left join sys_roles sr on sr.id = sur.ROLE_ID 
       <where>
           <if test="keyword">
               AND su.realName LIKE CONCAT('%', #{keyword}, '%')
           </if>
       		<if test="userType">
       			AND sr.ROLE =#{userType}
       		</if>
       		<if test="managerId">
				AND su.id = #{managerId}
			</if>
       </where>
    </select>
    
</mapper>

