|
@@ -27,16 +27,18 @@
|
27
|
27
|
<result property="createtime" column="createtime"></result>
|
28
|
28
|
<result property="createname" column="createname"></result>
|
29
|
29
|
<result property="loginname" column="loginname"></result>
|
30
|
|
- <collection property="schools" ofType="java.util.Map" javaType="java.util.List">
|
31
|
|
- <result property="schoolid" column="fschoolid"></result>
|
32
|
|
- <result property="schoolname" column="fschoolname"></result>
|
|
30
|
+ <collection property="schools" ofType="java.util.Map" javaType="java.util.List" select="listSchool" column="schoolid">
|
33
|
31
|
</collection>
|
34
|
32
|
</resultMap>
|
|
33
|
+ <select id="listSchool" resultType="java.util.Map">
|
|
34
|
+ select f.fschoolid schoolid,s2.schoolname
|
|
35
|
+ from t_school_friend f left join t_school s2 on f.fschoolid=s2.schoolid
|
|
36
|
+ where f.schoolid=#{schoolid}
|
|
37
|
+ </select>
|
35
|
38
|
<select id="findAll" resultMap="listSchools">
|
36
|
39
|
select s.*,tu.username createname
|
37
|
40
|
,(select u.loginname from t_user u where u.schoolid=s.schoolid and u.usertype=0 and u.userstate=1
|
38
|
41
|
ORDER BY u.userid ASC LIMIT 1)loginname
|
39
|
|
- ,f.schoolid fschoolid,s2.schoolname fschoolname
|
40
|
42
|
from t_school s left join t_user tu on s.createid = tu.userid
|
41
|
43
|
left join t_school_friend f on s.schoolid=f.schoolid
|
42
|
44
|
left join t_school s2 on f.fschoolid=s2.schoolid
|