Browse Source

集团校排序

tags/正式3.10.2
雍文秀 1 year ago
parent
commit
33c6805ce6

+ 2
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperMapper.java View File

@@ -159,13 +159,13 @@ public interface PaperMapper extends TkMapper<TPaper> {
159 159
     String getHearfileByPaperid(@Param("paperid") Integer paperid);
160 160
 
161 161
     //批阅设置-作业发布班级和学校
162
-    List<Map> listSchoolClassByPaperid(@Param("paperid") Integer paperid);
162
+    List<Map> listSchoolClassByPaperid(@Param("paperid") Integer paperid,@Param("schoolid") Integer schoolid);
163 163
 
164 164
     //批阅设置-作业发布班级对应科目下所有教师和教师任教班级
165 165
     List<Map> listTeacherClassByPaperid(@Param("param")PaperParam param);
166 166
 
167 167
     //批阅设置-作业发布学生
168
-    List<Map> listPaperStudentsByPaperid(@Param("paperid") Integer paperid);
168
+    List<Map> listPaperStudentsByPaperid(@Param("paperid") Integer paperid,@Param("schoolid") Integer schoolid);
169 169
 
170 170
     //获取所有作业,处理学生试题关联关系
171 171
     List<TPaper> listPapersForAllFb();

+ 2
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/recite/ReciteStudentMapper.java View File

@@ -63,7 +63,8 @@ public interface ReciteStudentMapper extends TkMapper<TReciteStudent> {
63 63
      * @author WN
64 64
      * @date 2020/6/17
65 65
      */
66
-    List<Map> listRecitesClassForAnalyze(@Param("reciteid")Integer reciteid, @Param("classids")String classids,@Param("classid")Integer classid);
66
+    List<Map> listRecitesClassForAnalyze(@Param("reciteid")Integer reciteid, @Param("classids")String classids
67
+            ,@Param("classid")Integer classid,@Param("schoolid") Integer schoolid);
67 68
 
68 69
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
69 70
     /**

+ 2
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java View File

@@ -1314,7 +1314,7 @@ public class PaperService {
1314 1314
 
1315 1315
         List<Map> rtnList = new ArrayList<>();
1316 1316
         //获取作业发布班级和学校
1317
-        List<Map> schoolClassList = paperMapper.listSchoolClassByPaperid(param.getPaperid());
1317
+        List<Map> schoolClassList = paperMapper.listSchoolClassByPaperid(param.getPaperid(), param.getSchoolid());
1318 1318
         if(N_Utils.isListNotEmpty(schoolClassList)){
1319 1319
             Map schoolClass = schoolClassList.get(0);
1320 1320
             param.setSubjectid(schoolClass.get("subjectid").toString());
@@ -1365,7 +1365,7 @@ public class PaperService {
1365 1365
     * @Date 2023/4/14 11:21
1366 1366
     */
1367 1367
     public Map listPaperStudentsByPaperid(PaperParam param){
1368
-        List<Map> stulist = paperMapper.listPaperStudentsByPaperid(param.getPaperid());
1368
+        List<Map> stulist = paperMapper.listPaperStudentsByPaperid(param.getPaperid(), param.getSchoolid());
1369 1369
         List<Map> bxList = new ArrayList<>();
1370 1370
         List<Map> hbList = new ArrayList<>();
1371 1371
 

+ 6
- 5
sstudy/src/main/java/com/xhkjedu/sstudy/service/recite/ReciteStudentService.java View File

@@ -85,6 +85,7 @@ public class ReciteStudentService {
85 85
         List<Map> list = new ArrayList<>();
86 86
         List<Map> students = new ArrayList<>();
87 87
         TRecite recite = null;
88
+        Integer rschoolid = reciteStudent.getSchoolid();
88 89
         if(N_Utils.isEmptyInteger(reciteStudent.getClassid())){
89 90
             //教师网页端获取所有
90 91
             recite = reciteMapper.selectByPrimaryKey(reciteStudent.getReciteid());
@@ -92,17 +93,17 @@ public class ReciteStudentService {
92 93
             String classids = "";//教师本校和集团校权限班级
93 94
             if (reciteStudent.getTeacherid().equals(recite.getCreateid())) {//自己发布的看所有班级
94 95
                 classids = null;
95
-            } else if(recite.getHashb() == 1 && recite.getSchoolid().equals(reciteStudent.getSchoolid())){
96
+            } else if(recite.getHashb() == 1 && recite.getSchoolid().equals(rschoolid)){
96 97
                 //说明该条数据为登录用户学校发布,包含伙伴学校
97 98
                 classids = classidMap.get("classids").toString();
98 99
             }else{
99 100
                 classids = classidMap.get("bxclassids").toString();
100 101
             }
101 102
 
102
-            students = reciteStudentMapper.listRecitesClassForAnalyze(reciteStudent.getReciteid(), classids,null);//获取教师权限下班级所有学生背诵
103
+            students = reciteStudentMapper.listRecitesClassForAnalyze(reciteStudent.getReciteid(), classids,null, rschoolid);//获取教师权限下班级所有学生背诵
103 104
         }else{
104 105
             //教师app获取指定班级
105
-            students = reciteStudentMapper.listRecitesClassForAnalyze(reciteStudent.getReciteid(), null,reciteStudent.getClassid());//获取教师权限下班级所有学生背诵
106
+            students = reciteStudentMapper.listRecitesClassForAnalyze(reciteStudent.getReciteid(), null,reciteStudent.getClassid(), rschoolid);//获取教师权限下班级所有学生背诵
106 107
         }
107 108
 
108 109
         if (N_Utils.isListEmpty(students)) return list;
@@ -151,7 +152,7 @@ public class ReciteStudentService {
151 152
             list.add(saveSchoolMap);
152 153
         }
153 154
 
154
-        if(schoolMap.size() > 1){
155
+        /*if(schoolMap.size() > 1){
155 156
             //把集团校放在第一个位置
156 157
             for(int i=0;i<list.size();i++){
157 158
                 Map rtnMap= list.get(i);
@@ -161,7 +162,7 @@ public class ReciteStudentService {
161 162
                     break;
162 163
                 }
163 164
             }
164
-        }
165
+        }*/
165 166
 
166 167
         return list;
167 168
     }

+ 2
- 1
sstudy/src/main/resources/mapper/paper/PaperAnalyzeMapper.xml View File

@@ -315,7 +315,8 @@
315 315
         left join t_school s on c.schoolid = s.schoolid
316 316
         where pg.paperid=#{paperid}
317 317
         <if test="classids!=null and classids!=''"> and pg.classid in (${classids})</if>
318
-        group by pg.classid order by case c.schoolid when #{schoolid} then 0 else c.schoolid end,c.gradeid,c.classtype,c.classorder
318
+        group by pg.classid
319
+        order by if(s.schoolid=#{schoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder
319 320
     </select>
320 321
     <!--作业班级学生列表-->
321 322
     <select id="listPaperClassStudent" resultType="com.xhkjedu.sstudy.vo.gradeclass.CStudentVo">

+ 7
- 8
sstudy/src/main/resources/mapper/paper/PaperMapper.xml View File

@@ -143,8 +143,7 @@
143 143
             and ps.classid in(${classids})
144 144
         </if>
145 145
         group by ps.classid
146
-        order by if(c.schoolid = #{logschoolid}, 0, c.schoolid)
147
-        ,c.gradeid,c.classtype,c.classorder
146
+        order by if(s.schoolid=#{logschoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder
148 147
     </select>
149 148
     <!--本校作业班级批阅人-->
150 149
     <resultMap id="checkUserResult" type="java.util.Map">
@@ -172,8 +171,7 @@
172 171
              <if test="classids!=null and classids!=''">
173 172
                  and pg.classid in(${classids})
174 173
              </if>
175
-             order by if(c.schoolid = #{logschoolid}, 0, c.schoolid),
176
-             c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
174
+             order by if(s.schoolid=#{logschoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
177 175
          </if>
178 176
        <if test="checktype==3">
179 177
            select ps.checkid as userid,u.username,c.classid,c.classname,c.gradeid,ps.schoolid,s.schoolname
@@ -185,8 +183,7 @@
185 183
                and ps.classid in(${classids})
186 184
            </if>
187 185
            group by ps.classid,ps.checkid
188
-           order by IF(c.schoolid = #{logschoolid}, 0, c.schoolid),
189
-           c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
186
+           order by if(s.schoolid=#{logschoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
190 187
        </if>
191 188
         <if test="checktype!=1 and checktype!=3">
192 189
             select checktype from t_paper where paperid=#{paperid}
@@ -431,7 +428,8 @@
431 428
         left join t_class c on pg.classid=c.classid
432 429
         left join t_school s on s.schoolid=c.schoolid
433 430
         left join t_paper p on pg.paperid=p.paperid
434
-        where pg.paperid=#{paperid} order by s.createtime desc,c.classtype,c.classorder
431
+        where pg.paperid=#{paperid}
432
+        order by if(s.schoolid=#{schoolid},0,s.schoolid),c.classtype,c.classorder
435 433
     </select>
436 434
     <!--作业发布班级对应科目下所有教师和教师任教班级-->
437 435
     <select id="listTeacherClassByPaperid" resultType="java.util.Map">
@@ -466,7 +464,8 @@
466 464
         left join t_paper_student cs on pg.paperid=cs.paperid and pg.classid=cs.classid
467 465
         left join t_user u on cs.studentid=u.userid
468 466
         left join t_school s on s.schoolid=u.schoolid
469
-        where pg.paperid=#{paperid} order by s.createtime desc, c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
467
+        where pg.paperid=#{paperid}
468
+        order by if(s.schoolid=#{schoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
470 469
     </select>
471 470
 
472 471
     <!--获取所有作业,处理学生试题关联关系-->

+ 1
- 1
sstudy/src/main/resources/mapper/paper/PaperTeaAppMapper.xml View File

@@ -86,7 +86,7 @@
86 86
             and pg.checkid=#{checkid}
87 87
         </if>-->
88 88
         group by pg.classid
89
-        order by case c.schoolid when #{schoolid} then 0 else c.schoolid end,c.classtype,c.classorder,c.classid
89
+        order by if(c.schoolid=#{schoolid},0,c.schoolid),c.classtype,c.classorder,c.classid
90 90
     </select>
91 91
 
92 92
     <!--作业报告-->

+ 1
- 1
sstudy/src/main/resources/mapper/paperreport/PaperReportMapper.xml View File

@@ -184,6 +184,6 @@
184 184
         left join t_school s on c.schoolid = s.schoolid
185 185
         where q.paperid=#{paperid} and q.good=1
186 186
         group by q.classid
187
-        order by case c.schoolid when #{schoolid} then 0 else c.schoolid end,c.gradeid,c.classtype,c.classorder
187
+        order by if(s.schoolid=#{schoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder
188 188
     </select>
189 189
 </mapper>

+ 2
- 2
sstudy/src/main/resources/mapper/paperstudent/PaperClassMapper.xml View File

@@ -29,8 +29,8 @@
29 29
         left join t_school s on pg.schoolid=s.schoolid
30 30
         left join t_user u on ps.studentid=u.userid
31 31
         left join t_class c on ps.classid=c.classid
32
-        where pg.paperid=#{paperid} order by case c.schoolid when #{schoolid} then 0 else c.schoolid end,
33
-        c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
32
+        where pg.paperid=#{paperid}
33
+        order by if(s.schoolid=#{schoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder,convert(u.username using gbk)
34 34
     </select>
35 35
     <!--批阅完成-->
36 36
     <update id="updateChecked">

+ 2
- 1
sstudy/src/main/resources/mapper/recite/ReciteMapper.xml View File

@@ -17,7 +17,8 @@
17 17
         <if test="recite.classids!=null and recite.classids!=''">
18 18
             and rs.classid in (${recite.classids})
19 19
         </if>
20
-        group by rs.classid order by s.createtime desc, c.classtype,c.classorder
20
+        group by rs.classid
21
+        order by if(s.schoolid=#{recite.schoolid},0,s.schoolid),c.classtype,c.classorder
21 22
     </select>
22 23
 
23 24
     <!-- 背诵分页列表 网页 -->

+ 1
- 1
sstudy/src/main/resources/mapper/recite/ReciteStudentMapper.xml View File

@@ -61,7 +61,7 @@
61 61
         <if test="classids!=null">
62 62
             and rg.classid in (${classids})
63 63
         </if>
64
-        order by s.createtime desc,c.classtype,c.classorder,rs.userscore desc
64
+        order by if(s.schoolid=#{schoolid},0,s.schoolid),c.classtype,c.classorder,rs.userscore desc
65 65
     </select>
66 66
 
67 67
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->

+ 1
- 1
sstudy/src/main/resources/mapper/resource/GuideGroupMapper.xml View File

@@ -66,6 +66,6 @@
66 66
             and gg.classid in(${guide.classids})
67 67
         </if>
68 68
         group by gg.classid
69
-        order by case c.schoolid when #{guide.schoolid} then 0 else c.schoolid end,c.gradeid,c.classtype,c.classorder
69
+        order by if(s.schoolid=#{guide.schoolid},0,s.schoolid),c.gradeid,c.classtype,c.classorder
70 70
     </select>
71 71
 </mapper>

+ 2
- 1
sstudy/src/main/resources/mapper/resource/GuideMapper.xml View File

@@ -338,7 +338,8 @@
338 338
         <if test="guide.classids!=null and guide.classids!=''">
339 339
             and rs.classid in (${guide.classids})
340 340
         </if>
341
-        group by rs.classid order by s.createtime desc, c.classtype,c.classorder
341
+        group by rs.classid
342
+        order by if(s.schoolid=#{guide.schoolid},0,s.schoolid),c.classtype,c.classorder
342 343
     </select>
343 344
     <!--获取预习年份-->
344 345
     <select id="getYearById" resultType="java.lang.Integer">

Loading…
Cancel
Save