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
     String getHearfileByPaperid(@Param("paperid") Integer paperid);
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
     List<Map> listTeacherClassByPaperid(@Param("param")PaperParam param);
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
     List<TPaper> listPapersForAllFb();
171
     List<TPaper> listPapersForAllFb();

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

63
      * @author WN
63
      * @author WN
64
      * @date 2020/6/17
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
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
69
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
69
     /**
70
     /**

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

1314
 
1314
 
1315
         List<Map> rtnList = new ArrayList<>();
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
         if(N_Utils.isListNotEmpty(schoolClassList)){
1318
         if(N_Utils.isListNotEmpty(schoolClassList)){
1319
             Map schoolClass = schoolClassList.get(0);
1319
             Map schoolClass = schoolClassList.get(0);
1320
             param.setSubjectid(schoolClass.get("subjectid").toString());
1320
             param.setSubjectid(schoolClass.get("subjectid").toString());
1365
     * @Date 2023/4/14 11:21
1365
     * @Date 2023/4/14 11:21
1366
     */
1366
     */
1367
     public Map listPaperStudentsByPaperid(PaperParam param){
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
         List<Map> bxList = new ArrayList<>();
1369
         List<Map> bxList = new ArrayList<>();
1370
         List<Map> hbList = new ArrayList<>();
1370
         List<Map> hbList = new ArrayList<>();
1371
 
1371
 

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

85
         List<Map> list = new ArrayList<>();
85
         List<Map> list = new ArrayList<>();
86
         List<Map> students = new ArrayList<>();
86
         List<Map> students = new ArrayList<>();
87
         TRecite recite = null;
87
         TRecite recite = null;
88
+        Integer rschoolid = reciteStudent.getSchoolid();
88
         if(N_Utils.isEmptyInteger(reciteStudent.getClassid())){
89
         if(N_Utils.isEmptyInteger(reciteStudent.getClassid())){
89
             //教师网页端获取所有
90
             //教师网页端获取所有
90
             recite = reciteMapper.selectByPrimaryKey(reciteStudent.getReciteid());
91
             recite = reciteMapper.selectByPrimaryKey(reciteStudent.getReciteid());
92
             String classids = "";//教师本校和集团校权限班级
93
             String classids = "";//教师本校和集团校权限班级
93
             if (reciteStudent.getTeacherid().equals(recite.getCreateid())) {//自己发布的看所有班级
94
             if (reciteStudent.getTeacherid().equals(recite.getCreateid())) {//自己发布的看所有班级
94
                 classids = null;
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
                 classids = classidMap.get("classids").toString();
98
                 classids = classidMap.get("classids").toString();
98
             }else{
99
             }else{
99
                 classids = classidMap.get("bxclassids").toString();
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
         }else{
104
         }else{
104
             //教师app获取指定班级
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
         if (N_Utils.isListEmpty(students)) return list;
109
         if (N_Utils.isListEmpty(students)) return list;
151
             list.add(saveSchoolMap);
152
             list.add(saveSchoolMap);
152
         }
153
         }
153
 
154
 
154
-        if(schoolMap.size() > 1){
155
+        /*if(schoolMap.size() > 1){
155
             //把集团校放在第一个位置
156
             //把集团校放在第一个位置
156
             for(int i=0;i<list.size();i++){
157
             for(int i=0;i<list.size();i++){
157
                 Map rtnMap= list.get(i);
158
                 Map rtnMap= list.get(i);
161
                     break;
162
                     break;
162
                 }
163
                 }
163
             }
164
             }
164
-        }
165
+        }*/
165
 
166
 
166
         return list;
167
         return list;
167
     }
168
     }

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

315
         left join t_school s on c.schoolid = s.schoolid
315
         left join t_school s on c.schoolid = s.schoolid
316
         where pg.paperid=#{paperid}
316
         where pg.paperid=#{paperid}
317
         <if test="classids!=null and classids!=''"> and pg.classid in (${classids})</if>
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
     </select>
320
     </select>
320
     <!--作业班级学生列表-->
321
     <!--作业班级学生列表-->
321
     <select id="listPaperClassStudent" resultType="com.xhkjedu.sstudy.vo.gradeclass.CStudentVo">
322
     <select id="listPaperClassStudent" resultType="com.xhkjedu.sstudy.vo.gradeclass.CStudentVo">

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

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

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

86
             and pg.checkid=#{checkid}
86
             and pg.checkid=#{checkid}
87
         </if>-->
87
         </if>-->
88
         group by pg.classid
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
     </select>
90
     </select>
91
 
91
 
92
     <!--作业报告-->
92
     <!--作业报告-->

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

184
         left join t_school s on c.schoolid = s.schoolid
184
         left join t_school s on c.schoolid = s.schoolid
185
         where q.paperid=#{paperid} and q.good=1
185
         where q.paperid=#{paperid} and q.good=1
186
         group by q.classid
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
     </select>
188
     </select>
189
 </mapper>
189
 </mapper>

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

29
         left join t_school s on pg.schoolid=s.schoolid
29
         left join t_school s on pg.schoolid=s.schoolid
30
         left join t_user u on ps.studentid=u.userid
30
         left join t_user u on ps.studentid=u.userid
31
         left join t_class c on ps.classid=c.classid
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
     </select>
34
     </select>
35
     <!--批阅完成-->
35
     <!--批阅完成-->
36
     <update id="updateChecked">
36
     <update id="updateChecked">

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

17
         <if test="recite.classids!=null and recite.classids!=''">
17
         <if test="recite.classids!=null and recite.classids!=''">
18
             and rs.classid in (${recite.classids})
18
             and rs.classid in (${recite.classids})
19
         </if>
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
     </select>
22
     </select>
22
 
23
 
23
     <!-- 背诵分页列表 网页 -->
24
     <!-- 背诵分页列表 网页 -->

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

61
         <if test="classids!=null">
61
         <if test="classids!=null">
62
             and rg.classid in (${classids})
62
             and rg.classid in (${classids})
63
         </if>
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
     </select>
65
     </select>
66
 
66
 
67
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->
67
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->

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

66
             and gg.classid in(${guide.classids})
66
             and gg.classid in(${guide.classids})
67
         </if>
67
         </if>
68
         group by gg.classid
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
     </select>
70
     </select>
71
 </mapper>
71
 </mapper>

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

338
         <if test="guide.classids!=null and guide.classids!=''">
338
         <if test="guide.classids!=null and guide.classids!=''">
339
             and rs.classid in (${guide.classids})
339
             and rs.classid in (${guide.classids})
340
         </if>
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
     </select>
343
     </select>
343
     <!--获取预习年份-->
344
     <!--获取预习年份-->
344
     <select id="getYearById" resultType="java.lang.Integer">
345
     <select id="getYearById" resultType="java.lang.Integer">

Loading…
Cancel
Save