1、多对一
<select id="getStudent" resultMap="StudentTeacher">
select * from student
</select>
<resultMap id="StudentTeacher" type="com.le.pojo.Student">
<result property="id" column="id"/>
<result property="name" column="name"/>
<association property="teacher" column="tid" javaType="com.le.pojo.Teacher" select="getTeacher"/>
</resultMap>
<select id="getTeacher" resultType="com.le.pojo.Teacher">
select * from teacher where id =#{id}
</select