Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
14c8ce51ea
24 changed files with 258 additions and 126 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. 3
    3
      suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassStudentService.java
  24. 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
 
2
 
3
 import com.xhkjedu.sapi.model.gradeclass.TClass;
3
 import com.xhkjedu.sapi.model.gradeclass.TClass;
4
 import com.xhkjedu.sapi.service.analyze.SchoolPeopleService;
4
 import com.xhkjedu.sapi.service.analyze.SchoolPeopleService;
5
-import com.xhkjedu.utils.N_Utils;
6
-import com.xhkjedu.vo.ResultVo;
7
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleGradeVo;
5
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleGradeVo;
8
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleNumVo;
6
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleNumVo;
7
+import com.xhkjedu.utils.N_Utils;
8
+import com.xhkjedu.vo.ResultVo;
9
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.web.bind.annotation.PostMapping;
10
 import org.springframework.web.bind.annotation.PostMapping;
11
 import org.springframework.web.bind.annotation.RequestBody;
11
 import org.springframework.web.bind.annotation.RequestBody;
37
     @PostMapping("/allnum")
37
     @PostMapping("/allnum")
38
     public ResultVo getSchoolAllNum(@RequestBody TClass tClass){
38
     public ResultVo getSchoolAllNum(@RequestBody TClass tClass){
39
         N_Utils.validation(new Object[]{tClass.getSchoolid(),"学校id",1});
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
         return  new ResultVo(0,"",sp);
41
         return  new ResultVo(0,"",sp);
42
     }
42
     }
43
 
43
 
51
     @PostMapping("/gradenum")
51
     @PostMapping("/gradenum")
52
     public ResultVo getSchoolGradeNum(@RequestBody TClass tClass){
52
     public ResultVo getSchoolGradeNum(@RequestBody TClass tClass){
53
         N_Utils.validation(new Object[]{tClass.getSchoolid(),"学校id",1});
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
         return new ResultVo(0,"",list);
55
         return new ResultVo(0,"",list);
56
     }
56
     }
57
 
57
 
65
     @PostMapping("/gradeclass")
65
     @PostMapping("/gradeclass")
66
     public ResultVo listSchoolGradeClasses(@RequestBody TClass tClass){
66
     public ResultVo listSchoolGradeClasses(@RequestBody TClass tClass){
67
         N_Utils.validation(new Object[]{tClass.getSchoolid(),"学校id",1});
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
         return new ResultVo(0,"",list);
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
 package com.xhkjedu.sapi.controller.analyze;
1
 package com.xhkjedu.sapi.controller.analyze;
2
 
2
 
3
 import com.xhkjedu.sapi.service.analyze.SchoolSummaryService;
3
 import com.xhkjedu.sapi.service.analyze.SchoolSummaryService;
4
-import com.xhkjedu.utils.N_Utils;
5
-import com.xhkjedu.vo.ResultVo;
6
 import com.xhkjedu.sapi.vo.analyze.SchoolParams;
4
 import com.xhkjedu.sapi.vo.analyze.SchoolParams;
7
 import com.xhkjedu.sapi.vo.analyze.SchoolSummaryVo;
5
 import com.xhkjedu.sapi.vo.analyze.SchoolSummaryVo;
6
+import com.xhkjedu.utils.N_Utils;
7
+import com.xhkjedu.vo.ResultVo;
8
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.web.bind.annotation.PostMapping;
9
 import org.springframework.web.bind.annotation.PostMapping;
10
 import org.springframework.web.bind.annotation.RequestBody;
10
 import org.springframework.web.bind.annotation.RequestBody;
28
     //数据汇总
28
     //数据汇总
29
     @PostMapping("/summary")
29
     @PostMapping("/summary")
30
     public ResultVo listSchoolTaskWork(@RequestBody SchoolParams srparams){
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
         List<SchoolSummaryVo> lst = schoolSummaryService.schoolSummary(srparams);
33
         List<SchoolSummaryVo> lst = schoolSummaryService.schoolSummary(srparams);
35
         return new ResultVo(0,"",lst);
34
         return new ResultVo(0,"",lst);
36
     }
35
     }

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

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
 
60
 
61
     //获取准考证号长度限制
61
     //获取准考证号长度限制
62
     Integer getLimiteNoLen(@Param("schoolid") Integer schoolid);
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
 
2
 
3
 import com.xhkjedu.sapi.mapper.analyze.SchoolPeopleMapper;
3
 import com.xhkjedu.sapi.mapper.analyze.SchoolPeopleMapper;
4
 import com.xhkjedu.sapi.mapper.system.SchoolMapper;
4
 import com.xhkjedu.sapi.mapper.system.SchoolMapper;
5
-import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleGradeVo;
5
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleGradeVo;
7
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleNumVo;
6
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleNumVo;
8
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleStuSexVo;
7
 import com.xhkjedu.sapi.vo.analyze.SchoolPeopleStuSexVo;
8
+import com.xhkjedu.utils.N_Utils;
9
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.stereotype.Service;
10
 import org.springframework.stereotype.Service;
11
 
11
 
28
     private SchoolMapper schoolMapper;
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
      * @author WN
36
      * @author WN
33
      * @date 2020/8/8
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
                     rtnsp.setBoystunum(ssex.getSexnum());
47
                     rtnsp.setBoystunum(ssex.getSexnum());
46
-                }else if (ssex.getUsersex()==2){
48
+                } else if (ssex.getUsersex() == 2) {
47
                     rtnsp.setGirlstunum(ssex.getSexnum());
49
                     rtnsp.setGirlstunum(ssex.getSexnum());
48
-                }else {
50
+                } else {
49
                     rtnsp.setWzxbstunum(ssex.getSexnum());
51
                     rtnsp.setWzxbstunum(ssex.getSexnum());
50
                 }
52
                 }
51
             }
53
             }
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
      * @author WN
67
      * @author WN
62
      * @date 2020/8/8
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
         Integer totalNum = list.stream().collect(Collectors.summingInt(SchoolPeopleGradeVo::getStudentnum));
73
         Integer totalNum = list.stream().collect(Collectors.summingInt(SchoolPeopleGradeVo::getStudentnum));
70
         for (SchoolPeopleGradeVo p : list) {
74
         for (SchoolPeopleGradeVo p : list) {
71
             p.setNumrate(N_Utils.getIntegerDivideAndMulitiply(p.getStudentnum(), totalNum));
75
             p.setNumrate(N_Utils.getIntegerDivideAndMulitiply(p.getStudentnum(), totalNum));
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
      * @author WN
106
      * @author WN
99
      * @date 2020/8/8
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
 
2
 
3
 import com.xhkjedu.sapi.mapper.analyze.SchoolRoomMapper;
3
 import com.xhkjedu.sapi.mapper.analyze.SchoolRoomMapper;
4
 import com.xhkjedu.sapi.mapper.system.SchoolMapper;
4
 import com.xhkjedu.sapi.mapper.system.SchoolMapper;
5
-import com.xhkjedu.utils.N_Utils;
6
 import com.xhkjedu.sapi.vo.analyze.*;
5
 import com.xhkjedu.sapi.vo.analyze.*;
7
 import com.xhkjedu.sapi.vo.analyze.room.SchoolRoomVo;
6
 import com.xhkjedu.sapi.vo.analyze.room.SchoolRoomVo;
7
+import com.xhkjedu.utils.N_Utils;
8
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.stereotype.Service;
9
 import org.springframework.stereotype.Service;
10
 
10
 
78
     }
78
     }
79
 
79
 
80
     private void setTime(SchoolParams sparams) {
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
         if (!N_Utils.isEmptyInteger(sparams.getType())) {
83
         if (!N_Utils.isEmptyInteger(sparams.getType())) {
84
             Long endtime = N_Utils.getNowtimestamp();
84
             Long endtime = N_Utils.getNowtimestamp();
85
             Long starttime = N_Utils.getLongGoTime(sparams.getType());
85
             Long starttime = N_Utils.getLongGoTime(sparams.getType());

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

28
 
28
 
29
     //数据汇总
29
     //数据汇总
30
     public List<SchoolSummaryVo> schoolSummary(SchoolParams params) {
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
         List<SchoolSummaryVo> users = schoolSummaryMapper.listUser(params);
33
         List<SchoolSummaryVo> users = schoolSummaryMapper.listUser(params);
34
         //教师作业统计
34
         //教师作业统计
35
         List<SchoolSummaryVo> paperlist = schoolSummaryMapper.getPaperAnalyze(params);
35
         List<SchoolSummaryVo> paperlist = schoolSummaryMapper.getPaperAnalyze(params);
36
-        for(SchoolSummaryVo paper : paperlist){
36
+        for (SchoolSummaryVo paper : paperlist) {
37
             SchoolSummaryVo user = users.stream().filter(u -> u.getUserid().equals(paper.getUserid())).findFirst().orElse(null);
37
             SchoolSummaryVo user = users.stream().filter(u -> u.getUserid().equals(paper.getUserid())).findFirst().orElse(null);
38
-            if(user != null){
38
+            if (user != null) {
39
                 user.setPfabunum(paper.getPfabunum());
39
                 user.setPfabunum(paper.getPfabunum());
40
                 Integer stunum = paper.getPstunum();
40
                 Integer stunum = paper.getPstunum();
41
                 user.setPstunum(stunum);
41
                 user.setPstunum(stunum);

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

86
     }
86
     }
87
 
87
 
88
     private void setTime(SchoolParams params) {
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
         if (!N_Utils.isEmptyInteger(params.getType())) {
91
         if (!N_Utils.isEmptyInteger(params.getType())) {
92
             Long endtime = N_Utils.getNowtimestamp();
92
             Long endtime = N_Utils.getNowtimestamp();
93
             Long starttime = N_Utils.getLongGoTime(params.getType());
93
             Long starttime = N_Utils.getLongGoTime(params.getType());

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

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
          LEFT JOIN t_subject s ON sb.subjectid = s.subjectid
18
          LEFT JOIN t_subject s ON sb.subjectid = s.subjectid
19
          LEFT JOIN t_user u ON r.createid=u.userid
19
          LEFT JOIN t_user u ON r.createid=u.userid
20
           WHERE r.roomstate=2 AND r.schoolid=#{sparams.schoolid} and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} AND u.userstate=1
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
           GROUP BY r.roomid ORDER BY s.subjectorder
27
           GROUP BY r.roomid ORDER BY s.subjectorder
23
     </select>
28
     </select>
24
 
29
 
60
         <if test="sparams.username!=null and sparams.username!=''">
65
         <if test="sparams.username!=null and sparams.username!=''">
61
             AND u.username like '%${sparams.username}%'
66
             AND u.username like '%${sparams.username}%'
62
         </if>
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
          GROUP BY r.roomid
74
          GROUP BY r.roomid
66
     </select>
75
     </select>
67
 
76
 

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

30
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
30
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
31
             and p.subjectid=#{sparams.subjectid}
31
             and p.subjectid=#{sparams.subjectid}
32
         </if>
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
         group by p.createid
39
         group by p.createid
35
     </select>
40
     </select>
36
     <!--获取教师资源统计-->
41
     <!--获取教师资源统计-->
49
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
54
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
50
             and r.subjectid=#{sparams.subjectid}
55
             and r.subjectid=#{sparams.subjectid}
51
         </if>
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
         group by r.createid
63
         group by r.createid
54
     </select>
64
     </select>
55
     <!--获取教师课堂统计-->
65
     <!--获取教师课堂统计-->
69
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
79
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
70
             and sb.subjectid=#{sparams.subjectid}
80
             and sb.subjectid=#{sparams.subjectid}
71
         </if>
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
         group by r.roomid
88
         group by r.roomid
74
     </select>
89
     </select>
75
     <!--获取教师预习统计-->
90
     <!--获取教师预习统计-->
84
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
99
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
85
             and g.subjectid=#{sparams.subjectid}
100
             and g.subjectid=#{sparams.subjectid}
86
         </if>
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
         group by g.createid
108
         group by g.createid
89
     </select>
109
     </select>
90
     <!--获取教师背诵统计-->
110
     <!--获取教师背诵统计-->
99
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
119
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
100
             and r.subjectid=#{sparams.subjectid}
120
             and r.subjectid=#{sparams.subjectid}
101
         </if>
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
         group by r.createid
128
         group by r.createid
104
     </select>
129
     </select>
105
     <!--获取错题辅导统计-->
130
     <!--获取错题辅导统计-->
110
         left join t_class c on c.classid=qc.classid and c.schoolid=qc.schoolid
135
         left join t_class c on c.classid=qc.classid and c.schoolid=qc.schoolid
111
         where qc.schoolid=#{sparams.schoolid}
136
         where qc.schoolid=#{sparams.schoolid}
112
         and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
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
         group by qe.qcpid,qe.createid)qe
144
         group by qe.qcpid,qe.createid)qe
115
         group by qe.createid
145
         group by qe.createid
116
     </select>
146
     </select>

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

25
         LEFT JOIN t_class c ON pg.classid=c.classid
25
         LEFT JOIN t_class c ON pg.classid=c.classid
26
         LEFT JOIN T_USER U ON p.createid=u.userid
26
         LEFT JOIN T_USER U ON p.createid=u.userid
27
         WHERE p.paperstate=22 AND p.schoolid=#{sparams.schoolid} AND c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} AND u.userstate=1
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
         GROUP BY p.subjectid ORDER BY s.subjectorder
34
         GROUP BY p.subjectid ORDER BY s.subjectorder
30
     </select>
35
     </select>
31
 
36
 
39
         left join t_paper_student ps1 on ps1.paperid=pg.paperid and ps1.classid=pg.classid
44
         left join t_paper_student ps1 on ps1.paperid=pg.paperid and ps1.classid=pg.classid
40
         left join t_class c on c.classid=pg.classid
45
         left join t_class c on c.classid=pg.classid
41
         where p.schoolid=#{sparams.schoolid} and p.paperstate=22 and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
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
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
53
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
44
             and p.subjectid=#{sparams.subjectid}
54
             and p.subjectid=#{sparams.subjectid}
45
         </if>
55
         </if>
56
          LEFT JOIN t_subject s ON g.subjectid=s.subjectid
66
          LEFT JOIN t_subject s ON g.subjectid=s.subjectid
57
          LEFT JOIN T_USER U ON g.createid=u.userid
67
          LEFT JOIN T_USER U ON g.createid=u.userid
58
          WHERE g.schoolid=#{sparams.schoolid} AND c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} and u.userstate=1
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
          GROUP BY g.subjectid ORDER BY s.subjectorder
75
          GROUP BY g.subjectid ORDER BY s.subjectorder
61
     </select>
76
     </select>
62
     <select id="listSchoolTaskGuideDetail" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
77
     <select id="listSchoolTaskGuideDetail" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
66
         from t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
81
         from t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
67
         left join t_class c on c.classid=ggs.classid
82
         left join t_class c on c.classid=ggs.classid
68
         where g.schoolid=#{sparams.schoolid} and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
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
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
90
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
71
             and g.subjectid=#{sparams.subjectid}
91
             and g.subjectid=#{sparams.subjectid}
72
         </if>
92
         </if>
84
          LEFT JOIN t_class c ON rs.classid=c.classid
104
          LEFT JOIN t_class c ON rs.classid=c.classid
85
          LEFT JOIN T_USER U ON r.createid=u.userid
105
          LEFT JOIN T_USER U ON r.createid=u.userid
86
          WHERE r.recitestate=22 AND r.schoolid=#{sparams.schoolid} AND c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year} AND u.userstate=1
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
          GROUP BY r.subjectid ORDER BY s.subjectorder
113
          GROUP BY r.subjectid ORDER BY s.subjectorder
89
     </select>
114
     </select>
90
 
115
 
96
         from t_recite r left join t_recite_student rs on rs.reciteid=r.reciteid
121
         from t_recite r left join t_recite_student rs on rs.reciteid=r.reciteid
97
         left join t_class c on c.classid=rs.classid
122
         left join t_class c on c.classid=rs.classid
98
         where r.schoolid=#{sparams.schoolid} and r.recitestate=22 and c.gradeid=#{sparams.gradeid} and c.year=#{sparams.year}
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
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
130
         <if test="sparams.subjectid!=null and sparams.subjectid!='0'.toString() and sparams.subjectid!=''">
101
             and r.subjectid=#{sparams.subjectid}
131
             and r.subjectid=#{sparams.subjectid}
102
         </if>
132
         </if>

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

104
     <select id="getLimiteNoLen" resultType="java.lang.Integer">
104
     <select id="getLimiteNoLen" resultType="java.lang.Integer">
105
         select limitenolen from t_school where schoolid=#{schoolid}
105
         select limitenolen from t_school where schoolid=#{schoolid}
106
     </select>
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
 </mapper>
111
 </mapper>

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

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

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

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

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

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

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

9
 import com.xhkjedu.sstudy.model.paper.TPaperAnalyze;
9
 import com.xhkjedu.sstudy.model.paper.TPaperAnalyze;
10
 import com.xhkjedu.sstudy.model.paper.TPaperFile;
10
 import com.xhkjedu.sstudy.model.paper.TPaperFile;
11
 import com.xhkjedu.sstudy.model.paperstudent.TPaperGroup;
11
 import com.xhkjedu.sstudy.model.paperstudent.TPaperGroup;
12
-import com.xhkjedu.sstudy.model.system.TSchool;
13
 import com.xhkjedu.sstudy.vo.gradeclass.CStudentVo;
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
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
14
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperTypeVo;
24
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
15
 import com.xhkjedu.sstudy.vo.paperstudent.StudentPaperVo;
25
 import com.xhkjedu.utils.N_Utils;
16
 import com.xhkjedu.utils.N_Utils;
27
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
28
 
19
 
29
 import javax.annotation.Resource;
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
 import java.util.stream.Collectors;
22
 import java.util.stream.Collectors;
37
 
23
 
38
 /**
24
 /**
245
      * @return java.util.List<com.xhkjedu.sstudy.vo.paper.PaperGAnalyzeVo>
231
      * @return java.util.List<com.xhkjedu.sstudy.vo.paper.PaperGAnalyzeVo>
246
      **/
232
      **/
247
     public List<PaperGAnalyzeVo> listPaperGrade(AnalyzeSearchVo paper) {
233
     public List<PaperGAnalyzeVo> listPaperGrade(AnalyzeSearchVo paper) {
248
-        setYear(paper);
234
+        //setYear(paper);
249
         setClassIds(paper);//设置教师权限班级
235
         setClassIds(paper);//设置教师权限班级
250
         List<PaperGAnalyzeVo> list = paperAnalyzeMapper.listUser(paper);
236
         List<PaperGAnalyzeVo> list = paperAnalyzeMapper.listUser(paper);
251
         List<PaperGAnalyzeVo> teapapers = paperAnalyzeMapper.getPaperGrade(paper);//发布作业的教师发布作业情况
237
         List<PaperGAnalyzeVo> teapapers = paperAnalyzeMapper.getPaperGrade(paper);//发布作业的教师发布作业情况
286
     //设置教师权限班级
272
     //设置教师权限班级
287
     public void setClassIds(AnalyzeSearchVo paper) {
273
     public void setClassIds(AnalyzeSearchVo paper) {
288
         if (paper.getUsertype() == 1 && N_Utils.isEmptyInteger(paper.getClassid())) {
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
             paper.setClassids(classIds);
276
             paper.setClassids(classIds);
291
         }
277
         }
292
     }
278
     }
380
     public Map listPaperStuExport(AnalyzeSearchVo paper) {
366
     public Map listPaperStuExport(AnalyzeSearchVo paper) {
381
         Map map = new HashMap();
367
         Map map = new HashMap();
382
         Integer schoolid = paper.getSchoolid();
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
         setClassIds(paper);//设置教师权限班级
371
         setClassIds(paper);//设置教师权限班级
386
         List<AStudentPaperVo> subjects = new ArrayList<>();
372
         List<AStudentPaperVo> subjects = new ArrayList<>();
387
         List<AStudentPaperVo> students = classMapper.listStu(paper);
373
         List<AStudentPaperVo> students = classMapper.listStu(paper);
388
         List<AStudentPaperVo> stupapers = paperAnalyzeMapper.listPaperAllClassStu(paper);//年级下所有学生关联的作业
374
         List<AStudentPaperVo> stupapers = paperAnalyzeMapper.listPaperAllClassStu(paper);//年级下所有学生关联的作业
389
         Map<String, String> subjectMap = new HashMap<>();//科目集合
375
         Map<String, String> subjectMap = new HashMap<>();//科目集合
390
         if (N_Utils.isListNotEmpty(stupapers)) {
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
             List<Map<String, String>> subjectNames = subjectMapper.listNameByIds(subjectids);//根据科目ids获取名称列表
379
             List<Map<String, String>> subjectNames = subjectMapper.listNameByIds(subjectids);//根据科目ids获取名称列表
393
             for (Map<String, String> subject : subjectNames) {
380
             for (Map<String, String> subject : subjectNames) {
394
                 subjectMap.put(subject.get("subjectid"), subject.get("subjectname"));
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
 import com.xhkjedu.sstudy.mapper.subjectbook.SubjectMapper;
6
 import com.xhkjedu.sstudy.mapper.subjectbook.SubjectMapper;
7
 import com.xhkjedu.sstudy.mapper.system.SchoolMapper;
7
 import com.xhkjedu.sstudy.mapper.system.SchoolMapper;
8
 import com.xhkjedu.sstudy.model.resource.*;
8
 import com.xhkjedu.sstudy.model.resource.*;
9
-import com.xhkjedu.sstudy.model.system.TSchool;
10
 import com.xhkjedu.sstudy.utils.ConvertUtil;
9
 import com.xhkjedu.sstudy.utils.ConvertUtil;
11
 import com.xhkjedu.sstudy.utils.StudyUtil;
10
 import com.xhkjedu.sstudy.utils.StudyUtil;
12
 import com.xhkjedu.sstudy.vo.paper.AStudentPaperVo;
11
 import com.xhkjedu.sstudy.vo.paper.AStudentPaperVo;
265
      * @return java.util.List<com.xhkjedu.vo.resource.GuideAnalyzeVo>
264
      * @return java.util.List<com.xhkjedu.vo.resource.GuideAnalyzeVo>
266
      **/
265
      **/
267
     public List<GuideAnalyzeVo> getPreviewAnalyze(AnalyzeSearchVo paper) {
266
     public List<GuideAnalyzeVo> getPreviewAnalyze(AnalyzeSearchVo paper) {
268
-        setYear(paper);
267
+        //setYear(paper);
269
         setClassIds(paper);//设置教师权限班级
268
         setClassIds(paper);//设置教师权限班级
270
         List<GuideAnalyzeVo> list = guideMapper.listUser(paper);
269
         List<GuideAnalyzeVo> list = guideMapper.listUser(paper);
271
         List<GuideAnalyzeVo> guidelist = guideMapper.getPreviewAnalyze(paper);//获取有预习教师的预习情况
270
         List<GuideAnalyzeVo> guidelist = guideMapper.getPreviewAnalyze(paper);//获取有预习教师的预习情况
305
     //设置教师权限班级
304
     //设置教师权限班级
306
     public void setClassIds(AnalyzeSearchVo paper) {
305
     public void setClassIds(AnalyzeSearchVo paper) {
307
         if (paper.getUsertype() == 1 && N_Utils.isEmptyInteger(paper.getClassid())) {
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
             paper.setClassids(classIds);
308
             paper.setClassids(classIds);
310
         }
309
         }
311
     }
310
     }
361
     public Map listPreviewStuExport(AnalyzeSearchVo paper) {
360
     public Map listPreviewStuExport(AnalyzeSearchVo paper) {
362
         Map map = new HashMap();
361
         Map map = new HashMap();
363
         Integer schoolid = paper.getSchoolid();
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
         setClassIds(paper);//设置教师权限班级
365
         setClassIds(paper);//设置教师权限班级
367
         Map slist = new HashMap();
366
         Map slist = new HashMap();
368
         List<AStudentPaperVo> subjects = new ArrayList<>();
367
         List<AStudentPaperVo> subjects = new ArrayList<>();

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

30
     <select id="getClassIds" resultType="java.lang.String">
30
     <select id="getClassIds" resultType="java.lang.String">
31
         select group_concat(distinct c.classid)
31
         select group_concat(distinct c.classid)
32
         from t_class_teacher ct left join  t_class c on ct.classid=c.classid
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
         and c.classtype in(1,2)
34
         and c.classtype in(1,2)
36
     </select>
35
     </select>
37
 
36
 

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

341
         left join t_paper_student ps on ps.paperid=pg.paperid and ps.classid=pg.classid
341
         left join t_paper_student ps on ps.paperid=pg.paperid and ps.classid=pg.classid
342
         left join t_class c on pg.classid=c.classid
342
         left join t_class c on pg.classid=c.classid
343
         where p.paperstate=22 and c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
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
         <if test="paper.classid!=null and paper.classid!=0">
350
         <if test="paper.classid!=null and paper.classid!=0">
347
             and c.classid=#{paper.classid}
351
             and c.classid=#{paper.classid}
348
         </if>
352
         </if>
377
         left join t_paper_student ps on ps.studentid=cs.studentid
381
         left join t_paper_student ps on ps.studentid=cs.studentid
378
         left join t_paper_group pg on pg.paperid=ps.paperid and pg.classid=ps.classid
382
         left join t_paper_group pg on pg.paperid=ps.paperid and pg.classid=ps.classid
379
         left join t_paper p on ps.paperid=p.paperid and p.paperstate=22
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
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
390
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
383
             and p.subjectid=#{paper.subjectid}
391
             and p.subjectid=#{paper.subjectid}
384
         </if>
392
         </if>
404
         left join t_subject s on p.subjectid=s.subjectid
412
         left join t_subject s on p.subjectid=s.subjectid
405
         where ps.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and
413
         where ps.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and
406
         p.paperstate=22
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
         <if test="paper.classid!=null and paper.classid!=0">
421
         <if test="paper.classid!=null and paper.classid!=0">
410
             and ps.classid=#{paper.classid}
422
             and ps.classid=#{paper.classid}
411
         </if>
423
         </if>
423
         from t_paper_student ps left join t_class c on ps.classid=c.classid
435
         from t_paper_student ps left join t_class c on ps.classid=c.classid
424
         left join t_paper p on ps.paperid=p.paperid
436
         left join t_paper p on ps.paperid=p.paperid
425
         where ps.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and p.paperstate=22
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
         <if test="paper.classid!=null and paper.classid!=0">
444
         <if test="paper.classid!=null and paper.classid!=0">
429
             and ps.classid=#{paper.classid}
445
             and ps.classid=#{paper.classid}
430
         </if>
446
         </if>
442
         from t_paper_student ps left join t_class c on ps.classid=c.classid
458
         from t_paper_student ps left join t_class c on ps.classid=c.classid
443
         left join t_paper p on ps.paperid=p.paperid
459
         left join t_paper p on ps.paperid=p.paperid
444
         where c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and p.paperstate=22
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
         <if test="paper.classid!=null and paper.classid!=0">
467
         <if test="paper.classid!=null and paper.classid!=0">
448
             and ps.classid=#{paper.classid}
468
             and ps.classid=#{paper.classid}
449
         </if>
469
         </if>

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

214
         from t_paper p left join t_paper_group pg on p.paperid=pg.paperid
214
         from t_paper p left join t_paper_group pg on p.paperid=pg.paperid
215
         left join t_class c on pg.classid=c.classid
215
         left join t_class c on pg.classid=c.classid
216
         where p.createid=#{paper.teacherid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
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
         <if test="paper.classid!=null and paper.classid!=0">
223
         <if test="paper.classid!=null and paper.classid!=0">
220
             and c.classid=#{paper.classid}
224
             and c.classid=#{paper.classid}
221
         </if>
225
         </if>

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

158
         from t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
158
         from t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
159
         left join t_class c on ggs.classid=c.classid
159
         left join t_class c on ggs.classid=c.classid
160
         where c.schoolid=#{paper.schoolid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
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
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
167
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
164
             and g.subjectid=#{paper.subjectid}
168
             and g.subjectid=#{paper.subjectid}
165
         </if>
169
         </if>
179
         left join t_class c on gg.classid=c.classid
183
         left join t_class c on gg.classid=c.classid
180
         left join t_guide_resource gr on g.guideid=gr.guideid
184
         left join t_guide_resource gr on g.guideid=gr.guideid
181
         where c.gradeid=#{paper.gradeid} and c.year=#{paper.year} and g.createid=#{paper.teacherid}
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
         <if test="paper.classid!=null and paper.classid!=0">
192
         <if test="paper.classid!=null and paper.classid!=0">
185
             and gg.classid=#{paper.classid}
193
             and gg.classid=#{paper.classid}
186
         </if>
194
         </if>
201
         from t_class_student cs left join t_class c on cs.classid=c.classid
209
         from t_class_student cs left join t_class c on cs.classid=c.classid
202
         left join t_guide_group_student ggs on c.classid=ggs.classid and ggs.studentid=cs.studentid
210
         left join t_guide_group_student ggs on c.classid=ggs.classid and ggs.studentid=cs.studentid
203
         left join t_guide g on ggs.guideid=g.guideid
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
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
218
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
207
             and g.subjectid=#{paper.subjectid}
219
             and g.subjectid=#{paper.subjectid}
208
         </if>
220
         </if>
236
         group by cs2.studentid)cs
248
         group by cs2.studentid)cs
237
         left join t_guide_group_student ggs on ggs.studentid=cs.studentid
249
         left join t_guide_group_student ggs on ggs.studentid=cs.studentid
238
         left join t_guide g on ggs.guideid=g.guideid
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
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
257
         <if test="paper.subjectid!='0'.toString() and paper.subjectid!=''">
242
             and g.subjectid=#{paper.subjectid}
258
             and g.subjectid=#{paper.subjectid}
243
         </if>
259
         </if>
259
         left join t_guide g on ggs.guideid=g.guideid
275
         left join t_guide g on ggs.guideid=g.guideid
260
         left join t_subject s on g.subjectid=s.subjectid
276
         left join t_subject s on g.subjectid=s.subjectid
261
         where ggs.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
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
         <if test="paper.classid!=0">
284
         <if test="paper.classid!=0">
265
             and ggs.classid=#{paper.classid}
285
             and ggs.classid=#{paper.classid}
266
         </if>
286
         </if>
278
         from t_guide_group_student ggs left join t_class c on ggs.classid=c.classid
298
         from t_guide_group_student ggs left join t_class c on ggs.classid=c.classid
279
         left join t_guide g on ggs.guideid=g.guideid
299
         left join t_guide g on ggs.guideid=g.guideid
280
         where ggs.studentid=#{paper.studentid} and c.gradeid=#{paper.gradeid} and c.year=#{paper.year}
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
         <if test="paper.classid!=0">
307
         <if test="paper.classid!=0">
284
             and ggs.classid=#{paper.classid}
308
             and ggs.classid=#{paper.classid}
285
         </if>
309
         </if>

+ 3
- 3
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassStudentService.java View File

218
                             throw new Exception("准考证号长度不符合要求");
218
                             throw new Exception("准考证号长度不符合要求");
219
                         }
219
                         }
220
                     }
220
                     }
221
-                    if (examno.equals("")) examno = null;
221
+                    if ("".equals(examno)) examno = null;
222
                     stu.setExamno(examno);
222
                     stu.setExamno(examno);
223
                     Integer userid = user.getUserid();
223
                     Integer userid = user.getUserid();
224
                     stu.setUserid(userid);
224
                     stu.setUserid(userid);
311
         user.setLoginpwd(N_Utils.getMD5Pwd("123456"));
311
         user.setLoginpwd(N_Utils.getMD5Pwd("123456"));
312
         user.setUsersex(model.getUsersex());
312
         user.setUsersex(model.getUsersex());
313
         user.setStudentno(model.getStudentno());
313
         user.setStudentno(model.getStudentno());
314
-        if (examno.equals("")) examno = null;
314
+        if ("".equals(examno)) examno = null;
315
         user.setExamno(examno);
315
         user.setExamno(examno);
316
         user.setCreateid(model.getCreateid());
316
         user.setCreateid(model.getCreateid());
317
         user.setSchoolid(schoolid);
317
         user.setSchoolid(schoolid);
410
         user.setUsersex(model.getUsersex());
410
         user.setUsersex(model.getUsersex());
411
         user.setUsername(model.getStudentname());
411
         user.setUsername(model.getStudentname());
412
         user.setStudentno(model.getStudentno());
412
         user.setStudentno(model.getStudentno());
413
-        if (examno.equals("")) examno = null;
413
+        if ("".equals(examno)) examno = null;
414
         user.setExamno(examno);
414
         user.setExamno(examno);
415
         user.setLoginname(model.getStudentno());
415
         user.setLoginname(model.getStudentno());
416
         user.setUserphone(model.getUserphone());
416
         user.setUserphone(model.getUserphone());

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

220
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.GradeVo>
220
      * @return java.util.List<com.xhkjedu.suser.vo.gradeclass.GradeVo>
221
      **/
221
      **/
222
     public List<GradeVo> listGradeClassesByUserid2(TeacherRoleParam role) {
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
         return classTeacherMapper.listGradeClassesByUserid2(role);
225
         return classTeacherMapper.listGradeClassesByUserid2(role);
226
     }
226
     }
227
 
227
 

Loading…
Cancel
Save