<?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.yida.data.system.mapper.EduAgentMapper">
	
	<!-- 查询代理商列表数据 -->
	<select id="listAgentPage"
			resultType="com.yida.data.system.vo.AgentSelectPageVO">
		select
		a.id,
		a.agent_name,
		a.create_date,
		a.create_id,
		a.principal_name,
		a.principal_phone,
		a.address,
		u.nickname as create_name
		from edu_agent a
		left join t_user u on a.create_id = u.USER_ID
		where a.del_flag = 0
		<if test='dto.agentName != null and dto.agentName != ""'>
			and a.agent_name like concat('%', #{dto.agentName}, '%')
		</if>
		order by a.create_date desc
	</select>
</mapper>
