Parcourir la source

学校管理列表

tags/正式版本
雍文秀 il y a 2 ans
Parent
révision
b4cfbe56b9
1 fichiers modifiés avec 6 ajouts et 4 suppressions
  1. 6
    4
      sapi/src/main/resources/mapper/system/SchoolMapper.xml

+ 6
- 4
sapi/src/main/resources/mapper/system/SchoolMapper.xml Voir le fichier

@@ -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

Chargement…
Annuler
Enregistrer