瀏覽代碼

添加学生考试名称分组,学生历史成绩统计

liu 2 年之前
父節點
當前提交
648b6318fe

+ 10 - 17
.idea/workspace.xml

@@ -5,19 +5,17 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="981dbcd1-a700-4015-8567-2ccff8e76f0a" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/HistoricalExamVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/StudentExamNameVo.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/SmartScoreControllerAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/SmartScoreControllerAPI.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/DriverStockController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/DriverStockController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/HikvisionController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/HikvisionController.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartScoreController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartScoreController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/mapper/SmartScoreMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/mapper/SmartScoreMapper.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/tongji/userPage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/tongji/userPage.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/SmartEvaluateStudentService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/SmartEvaluateStudentService.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/SmartUserService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/SmartUserService.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartEvaluateStudentServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartEvaluateStudentServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartUserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartUserServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/SmartScoreService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/SmartScoreService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartScoreServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/SmartScoreServiceImpl.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/resources/mapper/template/DriverStockMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/template/DriverStockMapper.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/mapper/template/SmartScoreMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/template/SmartScoreMapper.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" beforeDir="false" afterPath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -333,14 +331,14 @@
       <recent name="D:\Bingo\Desktop\工作内容\万载三中\backend_code\src\main\resources" />
       <recent name="D:\Bingo\Desktop\工作内容\万载三中\backend_code\src\main\java\com\template\model\seewo" />
     </key>
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="D:\Bingo\Desktop\工作内容\万载三中\backend_code\src\main\resources\mapper\template" />
+    </key>
     <key name="CopyClassDialog.RECENTS_KEY">
       <recent name="com.template.model.enumModel" />
       <recent name="com.template.model.request" />
       <recent name="com.template.model.vo" />
     </key>
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="D:\Bingo\Desktop\工作内容\万载三中\backend_code\src\main\resources\mapper\template" />
-    </key>
   </component>
   <component name="RunManager" selected="Spring Boot.MybatisPlusApplication">
     <configuration name="AutoCode" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
@@ -424,7 +422,7 @@
       <workItem from="1715410926468" duration="801000" />
       <workItem from="1715412104079" duration="1298000" />
       <workItem from="1715415419191" duration="619000" />
-      <workItem from="1715567741475" duration="21293000" />
+      <workItem from="1715567741475" duration="28743000" />
     </task>
     <servers />
   </component>
@@ -549,11 +547,6 @@
           <line>216</line>
           <option name="timeStamp" value="15" />
         </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartScoreController.java</url>
-          <line>669</line>
-          <option name="timeStamp" value="17" />
-        </line-breakpoint>
       </breakpoints>
     </breakpoint-manager>
   </component>

+ 9 - 0
src/main/java/com/template/api/SmartScoreControllerAPI.java

@@ -115,5 +115,14 @@ public interface SmartScoreControllerAPI {
     @ApiOperation(value = "老师寄语", notes = "老师寄语", httpMethod = "GET")
     CommonResult teacherMessage(@RequestParam String cardNo);
 
+    @GetMapping(value = "/studentExamName")
+    @ApiOperation(value = "学生考试名称分组", notes = "学生考试名称分组", httpMethod = "GET")
+    CommonResult studentExamName();
+
+
+    @GetMapping(value = "/historicalExam")
+    @ApiOperation(value = "历史成绩统计", notes = "历史成绩统计", httpMethod = "GET")
+    CommonResult historicalExam(@RequestParam int userId,@RequestParam int semesterId,@RequestParam int examTypeId);
+
 
 }

+ 14 - 1
src/main/java/com/template/controller/SmartScoreController.java

@@ -656,11 +656,11 @@ public class SmartScoreController implements SmartScoreControllerAPI {
 
             averageScoreVos.add(averageScoreVo);
         }
-        System.out.println("averageScoreVos = " + averageScoreVos);
         return CommonResult.ok(averageScoreVos);
     }
 
     @Override
+    @DESRespondSecret(validated = true)
     public CommonResult teacherMessage(String cardNo) {
         LocalDateTime now = LocalDateTime.now();
         SmartSemester smartSemester = smartSemesterService.getSemester(now);
@@ -679,6 +679,19 @@ public class SmartScoreController implements SmartScoreControllerAPI {
         return CommonResult.ok(map);
     }
 
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult studentExamName() {
+       List<StudentExamNameVo> vos =smartScoreService.getstudentExamName();
+       return CommonResult.ok(vos);
+    }
+
+    @Override
+    public CommonResult historicalExam(int userId, int semesterId, int examTypeId) {
+        List<HistoricalExamVo> list = smartScoreService.getHistoricalExam(userId,semesterId,examTypeId);
+        return CommonResult.ok(list);
+    }
+
     /**
      * 导入Xls文件方法
      *

+ 6 - 0
src/main/java/com/template/mapper/SmartScoreMapper.java

@@ -3,7 +3,9 @@ package com.template.mapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.template.model.pojo.SmartScore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.HistoricalExamVo;
 import com.template.model.vo.ScorePageVo;
+import com.template.model.vo.StudentExamNameVo;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
@@ -24,4 +26,8 @@ public interface SmartScoreMapper extends BaseMapper<SmartScore> {
     List<ScorePageVo> querySmartScores(@Param("name") String name,@Param("semester") String semester, @Param("grade") String grade,@Param("schoolClass") String schoolClass,@Param("subject") Integer subject,@Param("examType") Integer examType,@Param("MinScore") Double MinScore,@Param("MaxScore") Double MaxScore);
 
     Double getAverageScore(@Param("userId") int userId,@Param("semesterId") Integer semesterId,@Param("smartSemesterId") Integer smartSemesterId);
+
+    List<StudentExamNameVo> getStudentExamName();
+
+    List<HistoricalExamVo> getHistoricalExam(@Param("userId") int userId,@Param("semesterId") int semesterId,@Param("examTypeId") int examTypeId);
 }

+ 31 - 0
src/main/java/com/template/model/tongji/userPage.java

@@ -1,11 +1,18 @@
 package com.template.model.tongji;
 
+import lombok.Data;
+
+@Data
 public class userPage {
     public Integer id;
     public String name;
     public String cardNo;
     public String departMent;
 
+    public Integer sexId;
+
+    public String headImage;
+
     public String getName() {
         return name;
     }
@@ -29,4 +36,28 @@ public class userPage {
     public void setDepartMent(String departMent) {
         this.departMent = departMent;
     }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getSexId() {
+        return sexId;
+    }
+
+    public void setSexId(Integer sexId) {
+        this.sexId = sexId;
+    }
+
+    public String getHeadImage() {
+        return headImage;
+    }
+
+    public void setHeadImage(String headImage) {
+        this.headImage = headImage;
+    }
 }

+ 12 - 0
src/main/java/com/template/model/vo/HistoricalExamVo.java

@@ -0,0 +1,12 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+@Data
+public class HistoricalExamVo {
+//    学科名称
+    private  String subjectName;
+//    分数
+    private Double score;
+
+}

+ 17 - 0
src/main/java/com/template/model/vo/StudentExamNameVo.java

@@ -0,0 +1,17 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+@Data
+public class StudentExamNameVo {
+//    学期ID
+    private Integer semesterId;
+//      学期
+    private String semester;
+//      考试类型Id
+    private Integer examTypeId;
+//    考试类型名称
+    private String examTypeName;
+//    总名称——学期+考试名称
+    private String totalName;
+}

+ 5 - 0
src/main/java/com/template/services/SmartScoreService.java

@@ -4,7 +4,9 @@ import com.template.model.pojo.SmartScore;
 import com.template.model.pojo.SmartScore;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.HistoricalExamVo;
 import com.template.model.vo.ScorePageVo;
+import com.template.model.vo.StudentExamNameVo;
 
 import java.util.List;
 
@@ -42,4 +44,7 @@ public interface SmartScoreService extends IService<SmartScore> {
      */
     Double getAverageScore(int userId, Integer semesterId, Integer smartSemesterId);
 
+    List<StudentExamNameVo> getstudentExamName();
+
+    List<HistoricalExamVo> getHistoricalExam(int userId, int semesterId, int examTypeId);
 }

+ 15 - 0
src/main/java/com/template/services/impl/SmartScoreServiceImpl.java

@@ -1,5 +1,7 @@
 package com.template.services.impl;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,7 +10,9 @@ import com.template.model.pojo.SmartScore;
 import com.template.model.pojo.SmartScore;
 import com.template.mapper.SmartScoreMapper;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.HistoricalExamVo;
 import com.template.model.vo.ScorePageVo;
+import com.template.model.vo.StudentExamNameVo;
 import com.template.services.SmartScoreService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -87,4 +91,15 @@ public class SmartScoreServiceImpl extends ServiceImpl<SmartScoreMapper, SmartSc
         return smartScoreMapper.getAverageScore(userId,semesterId,smartSemesterId);
     }
 
+    @Override
+    public List<StudentExamNameVo> getstudentExamName() {
+        return smartScoreMapper.getStudentExamName();
+    }
+
+    @Override
+    public  List<HistoricalExamVo> getHistoricalExam(int userId, int semesterId, int examTypeId) {
+        List<HistoricalExamVo> list = smartScoreMapper.getHistoricalExam(userId,semesterId,examTypeId);
+        return list;
+    }
+
 }

+ 1 - 1
src/main/resources/mapper/template/DriverStockMapper.xml

@@ -83,7 +83,7 @@
 
     <!--用户汇总学生-->
     <select id="getUserPage" resultMap="userPage">
-        select a.id, a.name,a.`card_no`,b.`name` as depart_ment from `smart_user` a
+        select a.id,a.sex_id as sexId,a.head_image as headImage,  a.name,a.`card_no`,b.`name`  as depart_ment from `smart_user` a
              left join `smart_department` b on a.`department_id`=b.id
              where a.`deleted`=0 and a.identity_id=#{identityId}
         <if test="key != null and key != ''">

+ 29 - 0
src/main/resources/mapper/template/SmartScoreMapper.xml

@@ -96,5 +96,34 @@
 
     </select>
 
+    <select id="getStudentExamName" resultType="com.template.model.vo.StudentExamNameVo">
+        SELECT
+            ss.semester_id as semesterId,
+            ss.semester as semester,
+            ss.exam_type as examTypeId,
+            me.`name` as examTypeName ,
+            CONCAT(ss.semester,me.`name`) as totalName
+        FROM
+            `smart_score` ss
+                LEFT JOIN smart_examtype me ON ss.exam_type = me.id
+        where  ss.deleted=0
+        GROUP BY
+            ss.semester_id,
+            ss.exam_type
+    </select>
+    <select id="getHistoricalExam" resultType="com.template.model.vo.HistoricalExamVo">
+        SELECT
+            ss.score,
+            s.`name` as subjectName
+        FROM
+            `smart_score` ss
+                LEFT JOIN smart_subject s ON ss.subject_id = s.id
+        WHERE
+            user_id = #{userId}
+          AND semester_id = #{semesterId}
+          AND exam_type = #{examTypeId}
+          AND deleted=0
+    </select>
+
 
 </mapper>

二進制
target/mybatis_plus-0.0.1-SNAPSHOT.jar.original