~~~
public List<Map> getLessonandQ();
~~~
~~~
<select id="getLessonandQ" resultType="map">
select l.*, e.name, e.introduction, e.jczs
from lesson l, enterprise e
where l.qid = e.qid
</select>
~~~
~~~
public static void getLessonandQ()
{
//1. 得到一个SqlSession()
SqlSession session = DBUtils.getSession();
LessonMapper lessonMapper = session.getMapper(LessonMapper.class);
List<Map> list = lessonMapper.getLessonandQ();
for(Map item :list)
{
System.out.println(item.get("lname") + "\t" + item.get("name"));
}
}
~~~