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
         List<Integer> schoolids  = params.getSchoolids();
433
         List<Integer> schoolids  = params.getSchoolids();
434
         int timestemp = N_Utils.getSecondTimestamp();
434
         int timestemp = N_Utils.getSecondTimestamp();
435
         for(Integer shid : schoolids){
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
         ,(select u.loginname from t_user u where u.schoolid=s.schoolid and u.usertype=0 and u.userstate=1
40
         ,(select u.loginname from t_user u where u.schoolid=s.schoolid and u.usertype=0 and u.userstate=1
41
         ORDER BY u.userid ASC LIMIT 1)loginname
41
         ORDER BY u.userid ASC LIMIT 1)loginname
42
         from t_school s left join t_user tu on s.createid = tu.userid
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
         where s.schoolstate=1 order by s.createtime desc
43
         where s.schoolstate=1 order by s.createtime desc
46
     </select>
44
     </select>
47
     <!--学年升级-->
45
     <!--学年升级-->

Loading…
Cancel
Save