Browse Source

学校列表、附属学校优化

tags/正式版本
王宁 2 years ago
parent
commit
2193ecda27

+ 11
- 7
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java View File

@@ -433,14 +433,18 @@ public class SchoolService {
433 433
         List<Integer> schoolids  = params.getSchoolids();
434 434
         int timestemp = N_Utils.getSecondTimestamp();
435 435
         for(Integer shid : schoolids){
436
-            TSchoolFriend sf = new TSchoolFriend();
437
-            sf.setSchoolid(params.getSchoolid());
438
-            sf.setFschoolid(shid);
439
-            sf.setCreateid(params.getCreateid());
440
-            sf.setCreatetime(timestemp);
441
-            schoolfriends.add(sf);
436
+            if(!params.getSchoolid().equals(shid)){
437
+                TSchoolFriend sf = new TSchoolFriend();
438
+                sf.setSchoolid(params.getSchoolid());
439
+                sf.setFschoolid(shid);
440
+                sf.setCreateid(params.getCreateid());
441
+                sf.setCreatetime(timestemp);
442
+                schoolfriends.add(sf);
443
+            }
444
+        }
445
+        if(N_Utils.isListNotEmpty(schoolfriends)){
446
+            schoolFriendMapper.insertList(schoolfriends);
442 447
         }
443
-        schoolFriendMapper.insertList(schoolfriends);
444 448
     }
445 449
 
446 450
     //获取学校附属学校

+ 0
- 2
sapi/src/main/resources/mapper/system/SchoolMapper.xml View File

@@ -40,8 +40,6 @@
40 40
         ,(select u.loginname from t_user u where u.schoolid=s.schoolid and u.usertype=0 and u.userstate=1
41 41
         ORDER BY u.userid ASC LIMIT 1)loginname
42 42
         from t_school s left join t_user tu on s.createid = tu.userid
43
-        left join t_school_friend f on s.schoolid=f.schoolid
44
-        left join t_school s2 on f.fschoolid=s2.schoolid
45 43
         where s.schoolstate=1 order by s.createtime desc
46 44
     </select>
47 45
     <!--学年升级-->

Loading…
Cancel
Save