Browse Source

Merge remote-tracking branch 'origin/2022-9-20' into ywx

# Conflicts:
#	sapi/src/main/java/com/xhkjedu/sapi/controller/system/SchoolController.java
#	sapi/src/main/java/com/xhkjedu/sapi/mapper/system/SchoolMapper.java
#	sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java
#	sapi/src/main/resources/mapper/system/SchoolMapper.xml
#	suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java
tags/正式版本
雍文秀 2 years ago
parent
commit
432970f42d
23 changed files with 255 additions and 123 deletions
  1. 5
    5
      sapi/src/main/java/com/xhkjedu/sapi/controller/analyze/SchoolPeopleController.java
  2. 4
    5
      sapi/src/main/java/com/xhkjedu/sapi/controller/analyze/SchoolSummaryController.java
  3. 14
    0
      sapi/src/main/java/com/xhkjedu/sapi/controller/system/SchoolController.java
  4. 3
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/system/SchoolMapper.java
  5. 31
    25
      sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolPeopleService.java
  6. 3
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolRoomService.java
  7. 4
    4
      sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolSummaryService.java
  8. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolTaskService.java
  9. 4
    0
      sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java
  10. 12
    3
      sapi/src/main/resources/mapper/analyze/SchoolRoomMapper.xml
  11. 36
    6
      sapi/src/main/resources/mapper/analyze/SchoolSummaryMapper.xml
  12. 36
    6
      sapi/src/main/resources/mapper/analyze/SchoolTaskMapper.xml
  13. 4
    0
      sapi/src/main/resources/mapper/system/SchoolMapper.xml
  14. 3
    3
      sstudy/src/main/java/com/xhkjedu/sstudy/controller/paper/PaperAnalyzeController.java
  15. 6
    6
      sstudy/src/main/java/com/xhkjedu/sstudy/controller/resource/GuideController.java
  16. 1
    1
      sstudy/src/main/java/com/xhkjedu/sstudy/mapper/gradeclass/ClassMapper.java
  17. 8
    21
      sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperAnalyzeService.java
  18. 4
    5
      sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java
  19. 1
    2
      sstudy/src/main/resources/mapper/gradeclass/ClassMapper.xml
  20. 30
    10
      sstudy/src/main/resources/mapper/paper/PaperAnalyzeMapper.xml
  21. 6
    2
      sstudy/src/main/resources/mapper/paper/PaperMapper.xml
  22. 36
    12
      sstudy/src/main/resources/mapper/resource/GuideMapper.xml
  23. 2
    2
      suser/src/main/java/com/xhkjedu/suser/service/system/TeacherRoleService.java

+ 5
- 5
sapi/src/main/java/com/xhkjedu/sapi/controller/analyze/SchoolPeopleController.java View File

@@ -2,10 +2,10 @@ package com.xhkjedu.sapi.controller.analyze;
2 2
 
3 3
 import com.xhkjedu.sapi.model.gradeclass.TClass;
4 4
 import com.xhkjedu.sapi.service.analyze.SchoolPeopleService;
5
-import com.xhkjedu.utils.N_Utils;
6
-import com.xhkjedu.vo.ResultVo;
7 5
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleGradeVo;
8 6
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleNumVo;
7
+import com.xhkjedu.utils.N_Utils;
8
+import com.xhkjedu.vo.ResultVo;
9 9
 import org.springframework.beans.factory.annotation.Autowired;
10 10
 import org.springframework.web.bind.annotation.PostMapping;
11 11
 import org.springframework.web.bind.annotation.RequestBody;
@@ -37,7 +37,7 @@ public class SchoolPeopleController {
37 37
     @PostMapping("/allnum")
38 38
     public ResultVo getSchoolAllNum(@RequestBody TClass tClass){
39 39
         N_Utils.validation(new Object[]{tClass.getSchoolid(),"学校id",1});
40
-        SchoolPeopleNumVo sp = schoolPeopleService.getSchoolAllNum(tClass.getSchoolid());
40
+        SchoolPeopleNumVo sp = schoolPeopleService.getSchoolAllNum(tClass.getSchoolid(), tClass.getYear());
41 41
         return  new ResultVo(0,"",sp);
42 42
     }
43 43
 
@@ -51,7 +51,7 @@ public class SchoolPeopleController {
51 51
     @PostMapping("/gradenum")
52 52
     public ResultVo getSchoolGradeNum(@RequestBody TClass tClass){
53 53
         N_Utils.validation(new Object[]{tClass.getSchoolid(),"学校id",1});
54
-        List<SchoolPeopleGradeVo> list = schoolPeopleService.listSchoolGrades(tClass.getSchoolid());
54
+        List<SchoolPeopleGradeVo> list = schoolPeopleService.listSchoolGrades(tClass.getSchoolid(), tClass.getYear());
55 55
         return new ResultVo(0,"",list);
56 56
     }
57 57
 
@@ -65,7 +65,7 @@ public class SchoolPeopleController {
65 65
     @PostMapping("/gradeclass")
66 66
     public ResultVo listSchoolGradeClasses(@RequestBody TClass tClass){
67 67
         N_Utils.validation(new Object[]{tClass.getSchoolid(),"学校id",1});
68
-        List<SchoolPeopleGradeVo> list = schoolPeopleService.listSchoolGradeClasses(tClass.getSchoolid());
68
+        List<SchoolPeopleGradeVo> list = schoolPeopleService.listSchoolGradeClasses(tClass.getSchoolid(), tClass.getYear());
69 69
         return new ResultVo(0,"",list);
70 70
     }
71 71
 

+ 4
- 5
sapi/src/main/java/com/xhkjedu/sapi/controller/analyze/SchoolSummaryController.java View File

@@ -1,10 +1,10 @@
1 1
 package com.xhkjedu.sapi.controller.analyze;
2 2
 
3 3
 import com.xhkjedu.sapi.service.analyze.SchoolSummaryService;
4
-import com.xhkjedu.utils.N_Utils;
5
-import com.xhkjedu.vo.ResultVo;
6 4
 import com.xhkjedu.sapi.vo.analyze.SchoolParams;
7 5
 import com.xhkjedu.sapi.vo.analyze.SchoolSummaryVo;
6
+import com.xhkjedu.utils.N_Utils;
7
+import com.xhkjedu.vo.ResultVo;
8 8
 import org.springframework.beans.factory.annotation.Autowired;
9 9
 import org.springframework.web.bind.annotation.PostMapping;
10 10
 import org.springframework.web.bind.annotation.RequestBody;
@@ -28,9 +28,8 @@ public class SchoolSummaryController {
28 28
     //数据汇总
29 29
     @PostMapping("/summary")
30 30
     public ResultVo listSchoolTaskWork(@RequestBody SchoolParams srparams){
31
-        N_Utils.validation(new Object[]{srparams.getSchoolid(),"学校id",1,
32
-                srparams.getGradeid(),"年级",1,
33
-                srparams.getStarttime(),"开始时间",1,srparams.getStoptime(),"结束时间",1});
31
+        N_Utils.validation(new Object[]{srparams.getSchoolid(), "学校id", 1,
32
+                srparams.getGradeid(), "年级", 1});
34 33
         List<SchoolSummaryVo> lst = schoolSummaryService.schoolSummary(srparams);
35 34
         return new ResultVo(0,"",lst);
36 35
     }

+ 14
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/system/SchoolController.java View File

@@ -174,4 +174,18 @@ public class SchoolController {
174 174
 
175 175
 
176 176
 
177
+     /* 获取学年列表
178
+     *
179
+     * @return com.xhkjedu.vo.ResultVo
180
+     * @Param [tSchool]
181
+     * @Author ywx
182
+     * @Date 2022/9/20 10:04
183
+     **/
184
+    @PostMapping("/list_year")
185
+    public ResultVo listYear(@RequestBody TSchool tSchool) {
186
+        Integer schoolid = tSchool.getSchoolid();
187
+        N_Utils.validation(new Object[]{schoolid, "学校id", 1});
188
+        List<Integer> list = schoolService.listYear(schoolid);
189
+        return new ResultVo(0, "获取列表成功", list);
190
+    }
177 191
 }

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/SchoolMapper.java View File

@@ -60,4 +60,7 @@ public interface SchoolMapper extends TkMapper<TSchool> {
60 60
 
61 61
     //获取准考证号长度限制
62 62
     Integer getLimiteNoLen(@Param("schoolid") Integer schoolid);
63
+
64
+    //获取学年列表
65
+    List<Integer> listYear(@Param("schoolid") Integer schoolid);
63 66
 }

+ 31
- 25
sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolPeopleService.java View File

@@ -2,10 +2,10 @@ package com.xhkjedu.sapi.service.analyze;
2 2
 
3 3
 import com.xhkjedu.sapi.mapper.analyze.SchoolPeopleMapper;
4 4
 import com.xhkjedu.sapi.mapper.system.SchoolMapper;
5
-import com.xhkjedu.utils.N_Utils;
6 5
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleGradeVo;
7 6
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleNumVo;
8 7
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleStuSexVo;
8
+import com.xhkjedu.utils.N_Utils;
9 9
 import org.springframework.beans.factory.annotation.Autowired;
10 10
 import org.springframework.stereotype.Service;
11 11
 
@@ -28,24 +28,26 @@ public class SchoolPeopleService {
28 28
     private SchoolMapper schoolMapper;
29 29
 
30 30
     /**
31
-     *功能描述 全校概况--班级、师生数量
31
+     * 功能描述 全校概况--班级、师生数量
32
+     *
33
+     * @param *    @param schoolid
34
+     * @param year
35
+     * @return com.xhkjedu.vo.analyze.SchoolPeopleNumVo
32 36
      * @author WN
33 37
      * @date 2020/8/8
34
-     * @param  * @param schoolid
35
-     * @return com.xhkjedu.vo.analyze.SchoolPeopleNumVo
36 38
      */
37
-    public SchoolPeopleNumVo getSchoolAllNum(Integer schoolid){
38
-        Integer year = schoolMapper.getYearById(schoolid);
39
-        SchoolPeopleNumVo rtnsp = schoolPeopleMapper.getSchoolClassNum(schoolid,year);
40
-        if(rtnsp!=null){
39
+    public SchoolPeopleNumVo getSchoolAllNum(Integer schoolid, Integer year) {
40
+        //Integer year = schoolMapper.getYearById(schoolid);
41
+        SchoolPeopleNumVo rtnsp = schoolPeopleMapper.getSchoolClassNum(schoolid, year);
42
+        if (rtnsp != null) {
41 43
             //性别数量
42
-            List<SchoolPeopleStuSexVo> sexlist = schoolPeopleMapper.listSchoolStudentSexnum(schoolid,year);
43
-            for(SchoolPeopleStuSexVo ssex:sexlist){
44
-                if(ssex.getUsersex()==1){
44
+            List<SchoolPeopleStuSexVo> sexlist = schoolPeopleMapper.listSchoolStudentSexnum(schoolid, year);
45
+            for (SchoolPeopleStuSexVo ssex : sexlist) {
46
+                if (ssex.getUsersex() == 1) {
45 47
                     rtnsp.setBoystunum(ssex.getSexnum());
46
-                }else if (ssex.getUsersex()==2){
48
+                } else if (ssex.getUsersex() == 2) {
47 49
                     rtnsp.setGirlstunum(ssex.getSexnum());
48
-                }else {
50
+                } else {
49 51
                     rtnsp.setWzxbstunum(ssex.getSexnum());
50 52
                 }
51 53
             }
@@ -57,15 +59,17 @@ public class SchoolPeopleService {
57 59
     }
58 60
 
59 61
     /**
60
-     *功能描述 全校概况--年级下教师班级学生数量
62
+     * 功能描述 全校概况--年级下教师班级学生数量
63
+     *
64
+     * @param *    @param schoolid
65
+     * @param year
66
+     * @return java.util.List<com.xhkjedu.vo.analyze.SchoolPeopleGradeVo>
61 67
      * @author WN
62 68
      * @date 2020/8/8
63
-     * @param  * @param schoolid
64
-     * @return java.util.List<com.xhkjedu.vo.analyze.SchoolPeopleGradeVo>
65 69
      */
66
-    public List<SchoolPeopleGradeVo> listSchoolGrades(Integer schoolid){
67
-        Integer year = schoolMapper.getYearById(schoolid);
68
-        List<SchoolPeopleGradeVo> list = schoolPeopleMapper.listSchoolGrades(schoolid,year);
70
+    public List<SchoolPeopleGradeVo> listSchoolGrades(Integer schoolid, Integer year) {
71
+        //Integer year = schoolMapper.getYearById(schoolid);
72
+        List<SchoolPeopleGradeVo> list = schoolPeopleMapper.listSchoolGrades(schoolid, year);
69 73
         Integer totalNum = list.stream().collect(Collectors.summingInt(SchoolPeopleGradeVo::getStudentnum));
70 74
         for (SchoolPeopleGradeVo p : list) {
71 75
             p.setNumrate(N_Utils.getIntegerDivideAndMulitiply(p.getStudentnum(), totalNum));
@@ -94,15 +98,17 @@ public class SchoolPeopleService {
94 98
     }
95 99
 
96 100
     /**
97
-     *功能描述 全校概况--年级下各班级情况统计
101
+     * 功能描述 全校概况--年级下各班级情况统计
102
+     *
103
+     * @param *    @param schoolid
104
+     * @param year
105
+     * @return java.util.List<com.xhkjedu.vo.analyze.SchoolPeopleGradeVo>
98 106
      * @author WN
99 107
      * @date 2020/8/8
100
-     * @param  * @param schoolid
101
-     * @return java.util.List<com.xhkjedu.vo.analyze.SchoolPeopleGradeVo>
102 108
      */
103
-    public List<SchoolPeopleGradeVo> listSchoolGradeClasses(Integer schoolid){
104
-        Integer year = schoolMapper.getYearById(schoolid);
105
-        return schoolPeopleMapper.listSchoolGradeClasses(schoolid,year);
109
+    public List<SchoolPeopleGradeVo> listSchoolGradeClasses(Integer schoolid, Integer year) {
110
+        //Integer year = schoolMapper.getYearById(schoolid);
111
+        return schoolPeopleMapper.listSchoolGradeClasses(schoolid, year);
106 112
     }
107 113
 
108 114
 }

+ 3
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolRoomService.java View File

@@ -2,9 +2,9 @@ package com.xhkjedu.sapi.service.analyze;
2 2
 
3 3
 import com.xhkjedu.sapi.mapper.analyze.SchoolRoomMapper;
4 4
 import com.xhkjedu.sapi.mapper.system.SchoolMapper;
5
-import com.xhkjedu.utils.N_Utils;
6 5
 import com.xhkjedu.sapi.vo.analyze.*;
7 6
 import com.xhkjedu.sapi.vo.analyze.room.SchoolRoomVo;
7
+import com.xhkjedu.utils.N_Utils;
8 8
 import org.springframework.beans.factory.annotation.Autowired;
9 9
 import org.springframework.stereotype.Service;
10 10
 
@@ -78,8 +78,8 @@ public class SchoolRoomService {
78 78
     }
79 79
 
80 80
     private void setTime(SchoolParams sparams) {
81
-        Integer year = schoolMapper.getYearById(sparams.getSchoolid());
82
-        sparams.setYear(year);
81
+        //Integer year = schoolMapper.getYearById(sparams.getSchoolid());
82
+        //sparams.setYear(year);
83 83
         if (!N_Utils.isEmptyInteger(sparams.getType())) {
84 84
             Long endtime = N_Utils.getNowtimestamp();
85 85
             Long starttime = N_Utils.getLongGoTime(sparams.getType());

+ 4
- 4
sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolSummaryService.java View File

@@ -28,14 +28,14 @@ public class SchoolSummaryService {
28 28
 
29 29
     //数据汇总
30 30
     public List<SchoolSummaryVo> schoolSummary(SchoolParams params) {
31
-        Integer year = schoolMapper.getYearById(params.getSchoolid());
32
-        params.setYear(year);
31
+        //Integer year = schoolMapper.getYearById(params.getSchoolid());
32
+        //params.setYear(year);
33 33
         List<SchoolSummaryVo> users = schoolSummaryMapper.listUser(params);
34 34
         //教师作业统计
35 35
         List<SchoolSummaryVo> paperlist = schoolSummaryMapper.getPaperAnalyze(params);
36
-        for(SchoolSummaryVo paper : paperlist){
36
+        for (SchoolSummaryVo paper : paperlist) {
37 37
             SchoolSummaryVo user = users.stream().filter(u -> u.getUserid().equals(paper.getUserid())).findFirst().orElse(null);
38
-            if(user != null){
38
+            if (user != null) {
39 39
                 user.setPfabunum(paper.getPfabunum());
40 40
                 Integer stunum = paper.getPstunum();
41 41
                 user.setPstunum(stunum);

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/analyze/SchoolTaskService.java View File

@@ -86,8 +86,8 @@ public class SchoolTaskService {
86 86
     }
87 87
 
88 88
     private void setTime(SchoolParams params) {
89
-        Integer year = schoolMapper.getYearById(params.getSchoolid());
90
-        params.setYear(year);
89
+        //Integer year = schoolMapper.getYearById(params.getSchoolid());
90
+        //params.setYear(year);
91 91
         if (!N_Utils.isEmptyInteger(params.getType())) {
92 92
             Long endtime = N_Utils.getNowtimestamp();
93 93
             Long starttime = N_Utils.getLongGoTime(params.getType());

+ 4
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java View File

@@ -517,4 +517,8 @@ public class SchoolService {
517 517
         }
518 518
     }
519 519
 
520
+    //获取学年列表
521
+    public List<Integer> listYear(Integer schoolid) {
522
+        return schoolMapper.listYear(schoolid);
523
+    }
520 524
 }

+ 12
- 3
sapi/src/main/resources/mapper/analyze/SchoolRoomMapper.xml View File

@@ -18,7 +18,12 @@
18 18
          LEFT JOIN t_subject s ON sb.subjectid = s.subjectid
19 19
          LEFT JOIN t_user u ON r.createid=u.userid
20 20
           WHERE r.roomstate=2 AND r.schoolid=#{sparams.schoolid} and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} AND u.userstate=1
21
-           AND r.createtime<![CDATA[ >= ]]>#{sparams.starttime} AND r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
21
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
22
+            AND r.createtime<![CDATA[ >= ]]>#{sparams.starttime}
23
+        </if>
24
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
25
+            AND r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
26
+        </if>
22 27
           GROUP BY r.roomid ORDER BY s.subjectorder
23 28
     </select>
24 29
 
@@ -60,8 +65,12 @@
60 65
         <if test="sparams.username!=null and sparams.username!=''">
61 66
             AND u.username like '%${sparams.username}%'
62 67
         </if>
63
-
64
-        AND r.createtime<![CDATA[ >= ]]>#{sparams.starttime} AND r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
68
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
69
+            AND r.createtime<![CDATA[ >= ]]>#{sparams.starttime}
70
+        </if>
71
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
72
+            AND r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
73
+        </if>
65 74
          GROUP BY r.roomid
66 75
     </select>
67 76
 

+ 36
- 6
sapi/src/main/resources/mapper/analyze/SchoolSummaryMapper.xml View File

@@ -30,7 +30,12 @@
30 30
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
31 31
             and p.subjectid=#{sparams.subjectid}
32 32
         </if>
33
-        and p.createtime>=#{sparams.starttime} and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
33
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
34
+            and p.createtime>=#{sparams.starttime}
35
+        </if>
36
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
37
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
38
+        </if>
34 39
         group by p.createid
35 40
     </select>
36 41
     <!--获取教师资源统计-->
@@ -49,7 +54,12 @@
49 54
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
50 55
             and r.subjectid=#{sparams.subjectid}
51 56
         </if>
52
-        and r.createtime>=#{sparams.starttime} and UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
57
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
58
+            and r.createtime>=#{sparams.starttime}
59
+        </if>
60
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
61
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
62
+        </if>
53 63
         group by r.createid
54 64
     </select>
55 65
     <!--获取教师课堂统计-->
@@ -69,7 +79,12 @@
69 79
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
70 80
             and sb.subjectid=#{sparams.subjectid}
71 81
         </if>
72
-        and r.createtime>=#{sparams.starttime} and UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
82
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
83
+            and r.createtime>=#{sparams.starttime}
84
+        </if>
85
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
86
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
87
+        </if>
73 88
         group by r.roomid
74 89
     </select>
75 90
     <!--获取教师预习统计-->
@@ -84,7 +99,12 @@
84 99
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
85 100
             and g.subjectid=#{sparams.subjectid}
86 101
         </if>
87
-        and g.createtime>=#{sparams.starttime} and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
102
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
103
+            and g.createtime>=#{sparams.starttime}
104
+        </if>
105
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
106
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
107
+        </if>
88 108
         group by g.createid
89 109
     </select>
90 110
     <!--获取教师背诵统计-->
@@ -99,7 +119,12 @@
99 119
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
100 120
             and r.subjectid=#{sparams.subjectid}
101 121
         </if>
102
-        and r.createtime>=#{sparams.starttime} and UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
122
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
123
+            and r.createtime>=#{sparams.starttime}
124
+        </if>
125
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
126
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(r.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
127
+        </if>
103 128
         group by r.createid
104 129
     </select>
105 130
     <!--获取错题辅导统计-->
@@ -110,7 +135,12 @@
110 135
         left join t_class c on c.classid=qc.classid and c.schoolid=qc.schoolid
111 136
         where qc.schoolid=#{sparams.schoolid}
112 137
         and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
113
-        and qe.createtime>=#{sparams.starttime} and UNIX_TIMESTAMP(FROM_UNIXTIME(qe.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
138
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
139
+            and qe.createtime>=#{sparams.starttime}
140
+        </if>
141
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
142
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(qe.createtime,'%Y%m%d'))&lt;=#{sparams.stoptime}
143
+        </if>
114 144
         group by qe.qcpid,qe.createid)qe
115 145
         group by qe.createid
116 146
     </select>

+ 36
- 6
sapi/src/main/resources/mapper/analyze/SchoolTaskMapper.xml View File

@@ -25,7 +25,12 @@
25 25
         LEFT JOIN t_class c ON pg.classid=c.classid
26 26
         LEFT JOIN T_USER U ON p.createid=u.userid
27 27
         WHERE p.paperstate=22 AND p.schoolid=#{sparams.schoolid} AND c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} AND u.userstate=1
28
-        AND p.createtime<![CDATA[ >= ]]>#{sparams.starttime} AND p.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
28
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
29
+            AND p.createtime<![CDATA[ >= ]]>#{sparams.starttime}
30
+        </if>
31
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
32
+            AND p.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
33
+        </if>
29 34
         GROUP BY p.subjectid ORDER BY s.subjectorder
30 35
     </select>
31 36
 
@@ -39,7 +44,12 @@
39 44
         left join t_paper_student ps1 on ps1.paperid=pg.paperid and ps1.classid=pg.classid
40 45
         left join t_class c on c.classid=pg.classid
41 46
         where p.schoolid=#{sparams.schoolid} and p.paperstate=22 and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
42
-        and p.createtime<![CDATA[ >= ]]>#{sparams.starttime} and p.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
47
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
48
+            AND p.createtime<![CDATA[ >= ]]>#{sparams.starttime}
49
+        </if>
50
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
51
+            AND p.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
52
+        </if>
43 53
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
44 54
             and p.subjectid=#{sparams.subjectid}
45 55
         </if>
@@ -56,7 +66,12 @@
56 66
          LEFT JOIN t_subject s ON g.subjectid=s.subjectid
57 67
          LEFT JOIN T_USER U ON g.createid=u.userid
58 68
          WHERE g.schoolid=#{sparams.schoolid} AND c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} and u.userstate=1
59
-         AND g.createtime<![CDATA[ >= ]]>#{sparams.starttime} AND g.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
69
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
70
+            AND g.createtime<![CDATA[ >= ]]>#{sparams.starttime}
71
+        </if>
72
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
73
+            AND g.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
74
+        </if>
60 75
          GROUP BY g.subjectid ORDER BY s.subjectorder
61 76
     </select>
62 77
     <select id="listSchoolTaskGuideDetail" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
@@ -66,7 +81,12 @@
66 81
         from t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
67 82
         left join t_class c on c.classid=ggs.classid
68 83
         where g.schoolid=#{sparams.schoolid} and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
69
-        and g.createtime<![CDATA[ >= ]]>#{sparams.starttime} and g.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
84
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
85
+            AND g.createtime<![CDATA[ >= ]]>#{sparams.starttime}
86
+        </if>
87
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
88
+            AND g.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
89
+        </if>
70 90
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
71 91
             and g.subjectid=#{sparams.subjectid}
72 92
         </if>
@@ -84,7 +104,12 @@
84 104
          LEFT JOIN t_class c ON rs.classid=c.classid
85 105
          LEFT JOIN T_USER U ON r.createid=u.userid
86 106
          WHERE r.recitestate=22 AND r.schoolid=#{sparams.schoolid} AND c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} AND u.userstate=1
87
-         AND r.createtime<![CDATA[ >= ]]>#{sparams.starttime} AND r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
107
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
108
+            AND r.createtime<![CDATA[ >= ]]>#{sparams.starttime}
109
+        </if>
110
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
111
+            AND r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
112
+        </if>
88 113
          GROUP BY r.subjectid ORDER BY s.subjectorder
89 114
     </select>
90 115
 
@@ -96,7 +121,12 @@
96 121
         from t_recite r left join t_recite_student rs on rs.reciteid=r.reciteid
97 122
         left join t_class c on c.classid=rs.classid
98 123
         where r.schoolid=#{sparams.schoolid} and r.recitestate=22 and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
99
-        and r.createtime<![CDATA[ >= ]]>#{sparams.starttime} and r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
124
+        <if test="sparams.starttime!=null and sparams.starttime!=0">
125
+            AND r.createtime<![CDATA[ >= ]]>#{sparams.starttime}
126
+        </if>
127
+        <if test="sparams.stoptime!=null and sparams.stoptime!=0">
128
+            AND r.createtime<![CDATA[ <= ]]>#{sparams.stoptime}
129
+        </if>
100 130
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
101 131
             and r.subjectid=#{sparams.subjectid}
102 132
         </if>

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

@@ -104,4 +104,8 @@
104 104
     <select id="getLimiteNoLen" resultType="java.lang.Integer">
105 105
         select limitenolen from t_school where schoolid=#{schoolid}
106 106
     </select>
107
+    <!--获取学年列表-->
108
+    <select id="listYear" resultType="java.lang.Integer">
109
+        select c.year from t_class c where c.schoolid=#{schoolid} and c.classtype=1 and c.classstate=1 group by c.year
110
+    </select>
107 111
 </mapper>

+ 3
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/controller/paper/PaperAnalyzeController.java View File

@@ -173,7 +173,7 @@ public class PaperAnalyzeController {
173 173
         Integer teacherid = paper.getTeacherid();
174 174
         Integer gradeid = paper.getGradeid();
175 175
         N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1,teacherid,"教师id",1,gradeid,"年级id",1});
176
-        paperAnalyzeService.setYear(paper);
176
+        //paperAnalyzeService.setYear(paper);
177 177
         paperAnalyzeService.setClassIds(paper);//设置教师权限班级
178 178
         PageHelper.startPage(page, pageSize);
179 179
         List<PaperListVo> list = paperAnalyzeService.listPaper(paper);
@@ -200,7 +200,7 @@ public class PaperAnalyzeController {
200 200
         Integer pageSize = paper.getPageSize();
201 201
         N_Utils.validation(new Object[]{schoolid, "学校id", 1, gradeid, "年级id", 1
202 202
                 , page, "显示页码", 1, pageSize, "显示条数", 1});
203
-        paperAnalyzeService.setYear(paper);
203
+        //paperAnalyzeService.setYear(paper);
204 204
         paperAnalyzeService.setClassIds(paper);
205 205
         List<AStudentPaperVo> list = paperAnalyzeService.listPaperStuGrade(paper);
206 206
         Integer start = (page - 1) * pageSize;
@@ -216,7 +216,7 @@ public class PaperAnalyzeController {
216 216
         Integer studentid = paper.getStudentid();
217 217
         Integer gradeid = paper.getGradeid();
218 218
         N_Utils.validation(new Object[]{studentid,"学生id",1,gradeid,"年级id",1});
219
-        paperAnalyzeService.setYear(paper);
219
+        //paperAnalyzeService.setYear(paper);
220 220
         Map map = paperAnalyzeService.listPaperStuDetail(paper);
221 221
         return new ResultVo(0,"获取作业统计--按学生详情成功",map);
222 222
     }

+ 6
- 6
sstudy/src/main/java/com/xhkjedu/sstudy/controller/resource/GuideController.java View File

@@ -4,13 +4,13 @@ import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.sstudy.model.resource.TGuide;
6 6
 import com.xhkjedu.sstudy.service.resource.GuideService;
7
+import com.xhkjedu.sstudy.vo.paper.AnalyzeSearchVo;
8
+import com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo;
9
+import com.xhkjedu.sstudy.vo.resource.GuideVo;
7 10
 import com.xhkjedu.utils.N_Utils;
8 11
 import com.xhkjedu.utils.PageUtil;
9 12
 import com.xhkjedu.vo.PageResult;
10 13
 import com.xhkjedu.vo.ResultVo;
11
-import com.xhkjedu.sstudy.vo.paper.AnalyzeSearchVo;
12
-import com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo;
13
-import com.xhkjedu.sstudy.vo.resource.GuideVo;
14 14
 import lombok.extern.slf4j.Slf4j;
15 15
 import org.springframework.beans.factory.annotation.Autowired;
16 16
 import org.springframework.util.CollectionUtils;
@@ -154,7 +154,7 @@ public class GuideController {
154 154
         Integer teacherid = paper.getTeacherid();
155 155
         Integer gradeid = paper.getGradeid();
156 156
         N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1,teacherid,"教师id",1,gradeid,"年级id",1});
157
-        guideService.setYear(paper);
157
+        //guideService.setYear(paper);
158 158
         guideService.setClassIds(paper);
159 159
         PageHelper.startPage(page, pageSize);
160 160
         List<Map> list = guideService.listPreview(paper);
@@ -171,7 +171,7 @@ public class GuideController {
171 171
         Integer pageSize = paper.getPageSize();
172 172
         N_Utils.validation(new Object[]{schoolid,"学校id",1,gradeid,"年级id",1
173 173
                 ,page,"显示页码",1,pageSize,"显示条数",1});
174
-        guideService.setYear(paper);
174
+        //guideService.setYear(paper);
175 175
         guideService.setClassIds(paper);
176 176
         PageHelper.startPage(page, pageSize);
177 177
         List<Map> list = guideService.listPreviewStuGrade(paper);
@@ -185,7 +185,7 @@ public class GuideController {
185 185
         Integer studentid = paper.getStudentid();
186 186
         Integer gradeid = paper.getGradeid();
187 187
         N_Utils.validation(new Object[]{studentid,"学生id",1,gradeid,"年级id",1});
188
-        guideService.setYear(paper);
188
+        //guideService.setYear(paper);
189 189
         Map map = guideService.listPreviewStuDetail(paper);
190 190
         return new ResultVo(0,"获取预习统计--按学生详情成功",map);
191 191
     }

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/gradeclass/ClassMapper.java View File

@@ -19,7 +19,7 @@ public interface ClassMapper extends TkMapper<TClass> {
19 19
     List<AStudentPaperVo> listStu(@Param("paper") AnalyzeSearchVo paper);
20 20
 
21 21
     //班级教师--获取教师任教行政和提高班id
22
-    String getClassIds(Integer teacherid);
22
+    String getClassIds(@Param("paper") AnalyzeSearchVo paper);
23 23
 
24 24
     //班级分组--分组下学生
25 25
     List<Integer> listStudentidsByGroupids(@Param("groupids") String groupids);

+ 8
- 21
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperAnalyzeService.java View File

@@ -9,17 +9,8 @@ import com.xhkjedu.sstudy.model.paper.TPaper;
9 9
 import com.xhkjedu.sstudy.model.paper.TPaperAnalyze;
10 10
 import com.xhkjedu.sstudy.model.paper.TPaperFile;
11 11
 import com.xhkjedu.sstudy.model.paperstudent.TPaperGroup;
12
-import com.xhkjedu.sstudy.model.system.TSchool;
13 12
 import com.xhkjedu.sstudy.vo.gradeclass.CStudentVo;
14
-import com.xhkjedu.sstudy.vo.paper.AStudentPaperVo;
15
-import com.xhkjedu.sstudy.vo.paper.AnalyzeQuestionVo;
16
-import com.xhkjedu.sstudy.vo.paper.AnalyzeSearchVo;
17
-import com.xhkjedu.sstudy.vo.paper.AnalyzeStudentVo;
18
-import com.xhkjedu.sstudy.vo.paper.PaperAnalyzeVo;
19
-import com.xhkjedu.sstudy.vo.paper.PaperCAnalyzeVo;
20
-import com.xhkjedu.sstudy.vo.paper.PaperGAnalyzeVo;
21
-import com.xhkjedu.sstudy.vo.paper.PaperListVo;
22
-import com.xhkjedu.sstudy.vo.paper.QuestionAnalyzeVo;
13
+import com.xhkjedu.sstudy.vo.paper.*;
23 14
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
24 15
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
25 16
 import com.xhkjedu.utils.N_Utils;
@@ -27,12 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
27 18
 import org.springframework.stereotype.Service;
28 19
 
29 20
 import javax.annotation.Resource;
30
-import java.util.ArrayList;
31
-import java.util.Comparator;
32
-import java.util.DoubleSummaryStatistics;
33
-import java.util.HashMap;
34
-import java.util.List;
35
-import java.util.Map;
21
+import java.util.*;
36 22
 import java.util.stream.Collectors;
37 23
 
38 24
 /**
@@ -245,7 +231,7 @@ public class PaperAnalyzeService {
245 231
      * @return java.util.List<com.xhkjedu.sstudy.vo.paper.PaperGAnalyzeVo>
246 232
      **/
247 233
     public List<PaperGAnalyzeVo> listPaperGrade(AnalyzeSearchVo paper) {
248
-        setYear(paper);
234
+        //setYear(paper);
249 235
         setClassIds(paper);//设置教师权限班级
250 236
         List<PaperGAnalyzeVo> list = paperAnalyzeMapper.listUser(paper);
251 237
         List<PaperGAnalyzeVo> teapapers = paperAnalyzeMapper.getPaperGrade(paper);//发布作业的教师发布作业情况
@@ -286,7 +272,7 @@ public class PaperAnalyzeService {
286 272
     //设置教师权限班级
287 273
     public void setClassIds(AnalyzeSearchVo paper) {
288 274
         if (paper.getUsertype() == 1 && N_Utils.isEmptyInteger(paper.getClassid())) {
289
-            String classIds = classMapper.getClassIds(paper.getTeacherid());//获取教师任教行政和提高班id
275
+            String classIds = classMapper.getClassIds(paper);//获取教师任教行政和提高班id
290 276
             paper.setClassids(classIds);
291 277
         }
292 278
     }
@@ -380,15 +366,16 @@ public class PaperAnalyzeService {
380 366
     public Map listPaperStuExport(AnalyzeSearchVo paper) {
381 367
         Map map = new HashMap();
382 368
         Integer schoolid = paper.getSchoolid();
383
-        TSchool school = schoolMapper.selectByPrimaryKey(schoolid);
384
-        paper.setYear(school.getYear());
369
+        //TSchool school = schoolMapper.selectByPrimaryKey(schoolid);
370
+        //paper.setYear(school.getYear());
385 371
         setClassIds(paper);//设置教师权限班级
386 372
         List<AStudentPaperVo> subjects = new ArrayList<>();
387 373
         List<AStudentPaperVo> students = classMapper.listStu(paper);
388 374
         List<AStudentPaperVo> stupapers = paperAnalyzeMapper.listPaperAllClassStu(paper);//年级下所有学生关联的作业
389 375
         Map<String, String> subjectMap = new HashMap<>();//科目集合
390 376
         if (N_Utils.isListNotEmpty(stupapers)) {
391
-            List<String> subjectids = stupapers.stream().map(AStudentPaperVo::getSubjectid).distinct().collect(Collectors.toList());
377
+            List<String> subjectids =
378
+                    stupapers.stream().map(AStudentPaperVo::getSubjectid).distinct().collect(Collectors.toList());
392 379
             List<Map<String, String>> subjectNames = subjectMapper.listNameByIds(subjectids);//根据科目ids获取名称列表
393 380
             for (Map<String, String> subject : subjectNames) {
394 381
                 subjectMap.put(subject.get("subjectid"), subject.get("subjectname"));

+ 4
- 5
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java View File

@@ -6,7 +6,6 @@ import com.xhkjedu.sstudy.mapper.resource.*;
6 6
 import com.xhkjedu.sstudy.mapper.subjectbook.SubjectMapper;
7 7
 import com.xhkjedu.sstudy.mapper.system.SchoolMapper;
8 8
 import com.xhkjedu.sstudy.model.resource.*;
9
-import com.xhkjedu.sstudy.model.system.TSchool;
10 9
 import com.xhkjedu.sstudy.utils.ConvertUtil;
11 10
 import com.xhkjedu.sstudy.utils.StudyUtil;
12 11
 import com.xhkjedu.sstudy.vo.paper.AStudentPaperVo;
@@ -265,7 +264,7 @@ public class GuideService {
265 264
      * @return java.util.List<com.xhkjedu.vo.resource.GuideAnalyzeVo>
266 265
      **/
267 266
     public List<GuideAnalyzeVo> getPreviewAnalyze(AnalyzeSearchVo paper) {
268
-        setYear(paper);
267
+        //setYear(paper);
269 268
         setClassIds(paper);//设置教师权限班级
270 269
         List<GuideAnalyzeVo> list = guideMapper.listUser(paper);
271 270
         List<GuideAnalyzeVo> guidelist = guideMapper.getPreviewAnalyze(paper);//获取有预习教师的预习情况
@@ -305,7 +304,7 @@ public class GuideService {
305 304
     //设置教师权限班级
306 305
     public void setClassIds(AnalyzeSearchVo paper) {
307 306
         if (paper.getUsertype() == 1 && N_Utils.isEmptyInteger(paper.getClassid())) {
308
-            String classIds = classMapper.getClassIds(paper.getTeacherid());//获取教师任教行政和提高班id
307
+            String classIds = classMapper.getClassIds(paper);//获取教师任教行政和提高班id
309 308
             paper.setClassids(classIds);
310 309
         }
311 310
     }
@@ -361,8 +360,8 @@ public class GuideService {
361 360
     public Map listPreviewStuExport(AnalyzeSearchVo paper) {
362 361
         Map map = new HashMap();
363 362
         Integer schoolid = paper.getSchoolid();
364
-        TSchool school = schoolMapper.selectByPrimaryKey(schoolid);
365
-        paper.setYear(school.getYear());
363
+        //TSchool school = schoolMapper.selectByPrimaryKey(schoolid);
364
+        //paper.setYear(school.getYear());
366 365
         setClassIds(paper);//设置教师权限班级
367 366
         Map slist = new HashMap();
368 367
         List<AStudentPaperVo> subjects = new ArrayList<>();

+ 1
- 2
sstudy/src/main/resources/mapper/gradeclass/ClassMapper.xml View File

@@ -30,8 +30,7 @@
30 30
     <select id="getClassIds" resultType="java.lang.String">
31 31
         select group_concat(distinct c.classid)
32 32
         from t_class_teacher ct left join  t_class c on ct.classid=c.classid
33
-        left join t_school s on ct.schoolid=s.schoolid
34
-        where ct.teacherid=#{teacherid} and c.year=s.year and c.classstate=1
33
+        where ct.teacherid=#{paper.teacherid} and c.year=#{paper.year} and c.classstate=1
35 34
         and c.classtype in(1,2)
36 35
     </select>
37 36
 

+ 30
- 10
sstudy/src/main/resources/mapper/paper/PaperAnalyzeMapper.xml View File

@@ -341,8 +341,12 @@
341 341
         left join t_paper_student ps on ps.paperid=pg.paperid and ps.classid=pg.classid
342 342
         left join t_class c on pg.classid=c.classid
343 343
         where p.paperstate=22 and c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
344
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
345
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
344
+        <if test="paper.starttime!=null and paper.starttime!=0">
345
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
346
+        </if>
347
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
348
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
349
+        </if>
346 350
         <if test="paper.classid!=null and paper.classid!=0">
347 351
             and c.classid=#{paper.classid}
348 352
         </if>
@@ -377,8 +381,12 @@
377 381
         left join t_paper_student ps on ps.studentid=cs.studentid
378 382
         left join t_paper_group pg on pg.paperid=ps.paperid and pg.classid=ps.classid
379 383
         left join t_paper p on ps.paperid=p.paperid and p.paperstate=22
380
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))>=#{paper.starttime}
381
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))&lt;=#{paper.stoptime}
384
+        <if test="paper.starttime!=null and paper.starttime!=0">
385
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))>=#{paper.starttime}
386
+        </if>
387
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
388
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))&lt;=#{paper.stoptime}
389
+        </if>
382 390
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
383 391
             and p.subjectid=#{paper.subjectid}
384 392
         </if>
@@ -404,8 +412,12 @@
404 412
         left join t_subject s on p.subjectid=s.subjectid
405 413
         where ps.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and
406 414
         p.paperstate=22
407
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))>=#{paper.starttime}
408
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))&lt;=#{paper.stoptime}
415
+        <if test="paper.starttime!=null and paper.starttime!=0">
416
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))>=#{paper.starttime}
417
+        </if>
418
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
419
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(pg.starttime,'%Y%m%d'))&lt;=#{paper.stoptime}
420
+        </if>
409 421
         <if test="paper.classid!=null and paper.classid!=0">
410 422
             and ps.classid=#{paper.classid}
411 423
         </if>
@@ -423,8 +435,12 @@
423 435
         from t_paper_student ps left join t_class c on ps.classid=c.classid
424 436
         left join t_paper p on ps.paperid=p.paperid
425 437
         where ps.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and p.paperstate=22
426
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
427
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
438
+        <if test="paper.starttime!=null and paper.starttime!=0">
439
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
440
+        </if>
441
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
442
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
443
+        </if>
428 444
         <if test="paper.classid!=null and paper.classid!=0">
429 445
             and ps.classid=#{paper.classid}
430 446
         </if>
@@ -442,8 +458,12 @@
442 458
         from t_paper_student ps left join t_class c on ps.classid=c.classid
443 459
         left join t_paper p on ps.paperid=p.paperid
444 460
         where c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and p.paperstate=22
445
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
446
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
461
+        <if test="paper.starttime!=null and paper.starttime!=0">
462
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
463
+        </if>
464
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
465
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
466
+        </if>
447 467
         <if test="paper.classid!=null and paper.classid!=0">
448 468
             and ps.classid=#{paper.classid}
449 469
         </if>

+ 6
- 2
sstudy/src/main/resources/mapper/paper/PaperMapper.xml View File

@@ -214,8 +214,12 @@
214 214
         from t_paper p left join t_paper_group pg on p.paperid=pg.paperid
215 215
         left join t_class c on pg.classid=c.classid
216 216
         where p.createid=#{paper.teacherid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
217
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
218
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
217
+        <if test="paper.starttime!=null and paper.starttime!=0">
218
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))>=#{paper.starttime}
219
+        </if>
220
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
221
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(p.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
222
+        </if>
219 223
         <if test="paper.classid!=null and paper.classid!=0">
220 224
             and c.classid=#{paper.classid}
221 225
         </if>

+ 36
- 12
sstudy/src/main/resources/mapper/resource/GuideMapper.xml View File

@@ -158,8 +158,12 @@
158 158
         from t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
159 159
         left join t_class c on ggs.classid=c.classid
160 160
         where c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
161
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
162
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
161
+        <if test="paper.starttime!=null and paper.starttime!=0">
162
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
163
+        </if>
164
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
165
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
166
+        </if>
163 167
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
164 168
             and g.subjectid=#{paper.subjectid}
165 169
         </if>
@@ -179,8 +183,12 @@
179 183
         left join t_class c on gg.classid=c.classid
180 184
         left join t_guide_resource gr on g.guideid=gr.guideid
181 185
         where c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and g.createid=#{paper.teacherid}
182
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
183
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
186
+        <if test="paper.starttime!=null and paper.starttime!=0">
187
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
188
+        </if>
189
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
190
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
191
+        </if>
184 192
         <if test="paper.classid!=null and paper.classid!=0">
185 193
             and gg.classid=#{paper.classid}
186 194
         </if>
@@ -201,8 +209,12 @@
201 209
         from t_class_student cs left join t_class c on cs.classid=c.classid
202 210
         left join t_guide_group_student ggs on c.classid=ggs.classid and ggs.studentid=cs.studentid
203 211
         left join t_guide g on ggs.guideid=g.guideid
204
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
205
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
212
+        <if test="paper.starttime!=null and paper.starttime!=0">
213
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
214
+        </if>
215
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
216
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
217
+        </if>
206 218
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
207 219
             and g.subjectid=#{paper.subjectid}
208 220
         </if>
@@ -236,8 +248,12 @@
236 248
         group by cs2.studentid)cs
237 249
         left join t_guide_group_student ggs on ggs.studentid=cs.studentid
238 250
         left join t_guide g on ggs.guideid=g.guideid
239
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
240
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
251
+        <if test="paper.starttime!=null and paper.starttime!=0">
252
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
253
+        </if>
254
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
255
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
256
+        </if>
241 257
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
242 258
             and g.subjectid=#{paper.subjectid}
243 259
         </if>
@@ -259,8 +275,12 @@
259 275
         left join t_guide g on ggs.guideid=g.guideid
260 276
         left join t_subject s on g.subjectid=s.subjectid
261 277
         where ggs.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
262
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
263
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
278
+        <if test="paper.starttime!=null and paper.starttime!=0">
279
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
280
+        </if>
281
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
282
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
283
+        </if>
264 284
         <if test="paper.classid!=0">
265 285
             and ggs.classid=#{paper.classid}
266 286
         </if>
@@ -278,8 +298,12 @@
278 298
         from t_guide_group_student ggs left join t_class c on ggs.classid=c.classid
279 299
         left join t_guide g on ggs.guideid=g.guideid
280 300
         where ggs.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
281
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
282
-        and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
301
+        <if test="paper.starttime!=null and paper.starttime!=0">
302
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))>=#{paper.starttime}
303
+        </if>
304
+        <if test="paper.stoptime!=null and paper.stoptime!=0">
305
+            and UNIX_TIMESTAMP(FROM_UNIXTIME(g.createtime,'%Y%m%d'))&lt;=#{paper.stoptime}
306
+        </if>
283 307
         <if test="paper.classid!=0">
284 308
             and ggs.classid=#{paper.classid}
285 309
         </if>

+ 2
- 2
suser/src/main/java/com/xhkjedu/suser/service/system/TeacherRoleService.java View File

@@ -220,8 +220,8 @@ public class TeacherRoleService {
220 220
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.GradeVo>
221 221
      **/
222 222
     public List<GradeVo> listGradeClassesByUserid2(TeacherRoleParam role) {
223
-        Integer year = schoolMapper.getYearByUserId(role.getTeacherid());
224
-        role.setYear(year);
223
+        //Integer year = schoolMapper.getYearByUserId(role.getTeacherid());
224
+        //role.setYear(year);
225 225
         return classTeacherMapper.listGradeClassesByUserid2(role);
226 226
     }
227 227
 

Loading…
Cancel
Save