<?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.tamguo.admin.dao.TeacherMapper">

	<select id="queryPage" resultType="TeacherEntity">
		SELECT
			t.uid,
			t.mobile,
			t.name,
			t.motto,
			t.province_id,
			a.name as province_name,
			t.city_id,
			a1.name as city_name,
			t.course_id,
			c.name as course_name,
			t.subject_id,
			s.name as subject_name,
			t.card_id,
		    t.card_photo , 
			t.occupation_papers , 
			t.qq,
			t.create_time,
			t.status,
			t.email
		FROM
			tiku_teacher t
		left join tiku_area a on t.province_id = a.uid
		left join tiku_area a1 on t.city_id = a1.uid
		left join tiku_subject s on t.subject_id = s.uid
		left join tiku_course c on t.course_id = c.uid
		<where>
			<if test="mobile != null and mobile != ''">
				t.mobile = #{mobile}
			</if>
		</where>
	</select>

</mapper>