wangliang 4 anni fa
parent
commit
89994c54b3

+ 291 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TAExamCourseTeacherResult.java

@@ -0,0 +1,291 @@
+package com.qmth.teachcloud.report.business.bean.result;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Description: TAExamCourseTeacherResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/10
+ */
+public class TAExamCourseTeacherResult implements Serializable {
+
+    @ApiModelProperty(value = "老师姓名")
+    private String teacherName;
+
+    @ApiModelProperty(value = "学院参考人数")
+    private Integer colRealityCount;
+
+    @ApiModelProperty(value = "学院总人数")
+    private Integer colTotalCount;
+
+    @ApiModelProperty(value = "学院缺考人数")
+    private Integer colAbsentCount;
+
+    @ApiModelProperty(value = "学院最低分")
+    private BigDecimal colMinScore;
+
+    @ApiModelProperty(value = "学院最高分")
+    private BigDecimal colMaxScore;
+
+    @ApiModelProperty(value = "学院平均分")
+    private BigDecimal colAvgScore;
+
+    @ApiModelProperty(value = "学院上四分位数")
+    private BigDecimal colUpperQuartile;
+
+    @ApiModelProperty(value = "学院中位数")
+    private BigDecimal colMedian;
+
+    @ApiModelProperty(value = "学院下四分位数")
+    private BigDecimal colLowerQuartile;
+
+    @ApiModelProperty(value = "学院授课学生分数众数")
+    private String colMode;
+
+    @ApiModelProperty(value = "学院授课学生分数标准差")
+    private BigDecimal colStandardDeviation;
+
+    @ApiModelProperty(value = "学院相对位置")
+    private BigDecimal colRelativePosition;
+
+    @ApiModelProperty(value = "学校参考人数")
+    private Integer schRealityCount;
+
+    @ApiModelProperty(value = "学校总人数")
+    private Integer schTotalCount;
+
+    @ApiModelProperty(value = "学校缺考人数")
+    private Integer schAbsentCount;
+
+    @ApiModelProperty(value = "学校最低分")
+    private BigDecimal schMinScore;
+
+    @ApiModelProperty(value = "学校最高分")
+    private BigDecimal schMaxScore;
+
+    @ApiModelProperty(value = "学校平均分")
+    private BigDecimal schAvgScore;
+
+    @ApiModelProperty(value = "学校上四分位数")
+    private BigDecimal schUpperQuartile;
+
+    @ApiModelProperty(value = "学校中位数")
+    private BigDecimal schMedian;
+
+    @ApiModelProperty(value = "学校下四分位数")
+    private BigDecimal schLowerQuartile;
+
+    @ApiModelProperty(value = "学校授课学生分数众数")
+    private String schMode;
+
+    @ApiModelProperty(value = "学校授课学生分数标准差")
+    private BigDecimal schStandardDeviation;
+
+    @ApiModelProperty(value = "学校相对位置")
+    private BigDecimal schRelativePosition;
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Integer getColRealityCount() {
+        return colRealityCount;
+    }
+
+    public void setColRealityCount(Integer colRealityCount) {
+        this.colRealityCount = colRealityCount;
+    }
+
+    public Integer getColTotalCount() {
+        return colTotalCount;
+    }
+
+    public void setColTotalCount(Integer colTotalCount) {
+        this.colTotalCount = colTotalCount;
+    }
+
+    public Integer getColAbsentCount() {
+        return colAbsentCount;
+    }
+
+    public void setColAbsentCount(Integer colAbsentCount) {
+        this.colAbsentCount = colAbsentCount;
+    }
+
+    public BigDecimal getColMinScore() {
+        return colMinScore;
+    }
+
+    public void setColMinScore(BigDecimal colMinScore) {
+        this.colMinScore = colMinScore;
+    }
+
+    public BigDecimal getColMaxScore() {
+        return colMaxScore;
+    }
+
+    public void setColMaxScore(BigDecimal colMaxScore) {
+        this.colMaxScore = colMaxScore;
+    }
+
+    public BigDecimal getColAvgScore() {
+        return colAvgScore;
+    }
+
+    public void setColAvgScore(BigDecimal colAvgScore) {
+        this.colAvgScore = colAvgScore;
+    }
+
+    public BigDecimal getColUpperQuartile() {
+        return colUpperQuartile;
+    }
+
+    public void setColUpperQuartile(BigDecimal colUpperQuartile) {
+        this.colUpperQuartile = colUpperQuartile;
+    }
+
+    public BigDecimal getColMedian() {
+        return colMedian;
+    }
+
+    public void setColMedian(BigDecimal colMedian) {
+        this.colMedian = colMedian;
+    }
+
+    public BigDecimal getColLowerQuartile() {
+        return colLowerQuartile;
+    }
+
+    public void setColLowerQuartile(BigDecimal colLowerQuartile) {
+        this.colLowerQuartile = colLowerQuartile;
+    }
+
+    public String getColMode() {
+        return colMode;
+    }
+
+    public void setColMode(String colMode) {
+        this.colMode = colMode;
+    }
+
+    public BigDecimal getColStandardDeviation() {
+        return colStandardDeviation;
+    }
+
+    public void setColStandardDeviation(BigDecimal colStandardDeviation) {
+        this.colStandardDeviation = colStandardDeviation;
+    }
+
+    public BigDecimal getColRelativePosition() {
+        return colRelativePosition;
+    }
+
+    public void setColRelativePosition(BigDecimal colRelativePosition) {
+        this.colRelativePosition = colRelativePosition;
+    }
+
+    public Integer getSchRealityCount() {
+        return schRealityCount;
+    }
+
+    public void setSchRealityCount(Integer schRealityCount) {
+        this.schRealityCount = schRealityCount;
+    }
+
+    public Integer getSchTotalCount() {
+        return schTotalCount;
+    }
+
+    public void setSchTotalCount(Integer schTotalCount) {
+        this.schTotalCount = schTotalCount;
+    }
+
+    public Integer getSchAbsentCount() {
+        return schAbsentCount;
+    }
+
+    public void setSchAbsentCount(Integer schAbsentCount) {
+        this.schAbsentCount = schAbsentCount;
+    }
+
+    public BigDecimal getSchMinScore() {
+        return schMinScore;
+    }
+
+    public void setSchMinScore(BigDecimal schMinScore) {
+        this.schMinScore = schMinScore;
+    }
+
+    public BigDecimal getSchMaxScore() {
+        return schMaxScore;
+    }
+
+    public void setSchMaxScore(BigDecimal schMaxScore) {
+        this.schMaxScore = schMaxScore;
+    }
+
+    public BigDecimal getSchAvgScore() {
+        return schAvgScore;
+    }
+
+    public void setSchAvgScore(BigDecimal schAvgScore) {
+        this.schAvgScore = schAvgScore;
+    }
+
+    public BigDecimal getSchUpperQuartile() {
+        return schUpperQuartile;
+    }
+
+    public void setSchUpperQuartile(BigDecimal schUpperQuartile) {
+        this.schUpperQuartile = schUpperQuartile;
+    }
+
+    public BigDecimal getSchMedian() {
+        return schMedian;
+    }
+
+    public void setSchMedian(BigDecimal schMedian) {
+        this.schMedian = schMedian;
+    }
+
+    public BigDecimal getSchLowerQuartile() {
+        return schLowerQuartile;
+    }
+
+    public void setSchLowerQuartile(BigDecimal schLowerQuartile) {
+        this.schLowerQuartile = schLowerQuartile;
+    }
+
+    public String getSchMode() {
+        return schMode;
+    }
+
+    public void setSchMode(String schMode) {
+        this.schMode = schMode;
+    }
+
+    public BigDecimal getSchStandardDeviation() {
+        return schStandardDeviation;
+    }
+
+    public void setSchStandardDeviation(BigDecimal schStandardDeviation) {
+        this.schStandardDeviation = schStandardDeviation;
+    }
+
+    public BigDecimal getSchRelativePosition() {
+        return schRelativePosition;
+    }
+
+    public void setSchRelativePosition(BigDecimal schRelativePosition) {
+        this.schRelativePosition = schRelativePosition;
+    }
+}

+ 60 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TBAnswerResult.java

@@ -0,0 +1,60 @@
+package com.qmth.teachcloud.report.business.bean.result;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Description: TBAnswerResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/10
+ */
+public class TBAnswerResult implements Serializable {
+
+    @ApiModelProperty(value = "试卷类型")
+    private String paperType;
+
+    @ApiModelProperty(value = "得分率")
+    private BigDecimal scoreRate;
+
+    @ApiModelProperty(value = "难度")
+    private String difficult;
+
+    @ApiModelProperty(value = "学院名称")
+    private String collegeName;
+
+    public String getPaperType() {
+        return paperType;
+    }
+
+    public void setPaperType(String paperType) {
+        this.paperType = paperType;
+    }
+
+    public BigDecimal getScoreRate() {
+        return scoreRate;
+    }
+
+    public void setScoreRate(BigDecimal scoreRate) {
+        this.scoreRate = scoreRate;
+    }
+
+    public String getDifficult() {
+        return difficult;
+    }
+
+    public void setDifficult(String difficult) {
+        this.difficult = difficult;
+    }
+
+    public String getCollegeName() {
+        return collegeName;
+    }
+
+    public void setCollegeName(String collegeName) {
+        this.collegeName = collegeName;
+    }
+}

+ 13 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TAExamCourseCollegeTeacherMapper.java

@@ -3,11 +3,14 @@ package com.qmth.teachcloud.report.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.teachcloud.report.business.bean.result.TAExamCourseTeacherResult;
 import com.qmth.teachcloud.report.business.bean.result.TeacherClassRankResult;
 import com.qmth.teachcloud.report.business.bean.result.TeacherMyClassRankResult;
 import com.qmth.teachcloud.report.business.entity.TAExamCourseCollegeTeacher;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 参考课程学院下授课教师维度分析表 Mapper 接口
@@ -23,4 +26,14 @@ public interface TAExamCourseCollegeTeacherMapper extends BaseMapper<TAExamCours
     IPage<TeacherMyClassRankResult> listMyClassRank(@Param("page") Page<TeacherMyClassRankResult> page, @Param("schoolId") Long schoolId, @Param("semester") String semester, @Param("examId") Long examId, @Param("teacherId") Long teacherId, @Param("courseCode") String courseCode, @Param("inspectCollegeId") Long inspectCollegeId);
 
     IPage<TAExamCourseCollegeTeacher> listAllTeacherClassRank(@Param("page") Page<TAExamCourseCollegeTeacher> page, @Param("schoolId") Long schoolId, @Param("semester") String semester, @Param("examId") Long examId, @Param("teachCollegeId") Long teachCollegeId, @Param("courseCode") String courseCode, @Param("teacherId") Long teacherId);
+
+    /**
+     * 查询老师得分
+     *
+     * @param examId
+     * @param courseCode
+     * @param collegeId
+     * @return
+     */
+    List<TAExamCourseTeacherResult> findTeacherInfo(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("collegeId") Long collegeId);
 }

+ 14 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TBAnswerMapper.java

@@ -3,6 +3,7 @@ package com.qmth.teachcloud.report.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qmth.teachcloud.report.business.bean.dto.query.BasicAnswerDto;
 import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto;
+import com.qmth.teachcloud.report.business.bean.result.TBAnswerResult;
 import com.qmth.teachcloud.report.business.entity.TBAnswer;
 import org.apache.ibatis.annotations.Param;
 
@@ -17,8 +18,10 @@ import java.util.List;
  * @since 2021-06-01
  */
 public interface TBAnswerMapper extends BaseMapper<TBAnswer> {
+
     /**
      * 根据试卷id查找考该试卷的所有考生作答记录详情
+     *
      * @param paperId 试卷id
      * @return 作答记录数据
      */
@@ -26,9 +29,19 @@ public interface TBAnswerMapper extends BaseMapper<TBAnswer> {
 
     /**
      * 查找试卷结构效度数据
-     * @param examId 考试id
+     *
+     * @param examId     考试id
      * @param courseCode 课程编号
      * @return 结果
      */
     List<ValidAnswerDetailDto> findValid(@Param("examId") Long examId, @Param("courseCode") String courseCode);
+
+    /**
+     * 查找有效答案
+     *
+     * @param examId
+     * @param courseCode
+     * @return
+     */
+    List<TBAnswerResult> findValidAnswerDetail(@Param("examId") Long examId, @Param("courseCode") String courseCode);
 }

+ 13 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TAExamCourseCollegeTeacherService.java

@@ -2,10 +2,13 @@ package com.qmth.teachcloud.report.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.teachcloud.report.business.bean.result.TAExamCourseTeacherResult;
 import com.qmth.teachcloud.report.business.bean.result.TeacherClassRankResult;
 import com.qmth.teachcloud.report.business.bean.result.TeacherMyClassRankResult;
 import com.qmth.teachcloud.report.business.entity.TAExamCourseCollegeTeacher;
 
+import java.util.List;
+
 /**
  * <p>
  * 参考课程学院下授课教师维度分析表 服务类
@@ -21,4 +24,14 @@ public interface TAExamCourseCollegeTeacherService extends IService<TAExamCourse
     IPage<TeacherMyClassRankResult> listMyClassRank(String semester, Long examId, Long teacherId, String courseCode, Long inspectCollegeId, Integer pageNumber, Integer pageSize);
 
     IPage<TAExamCourseCollegeTeacher> listAllTeacherClassRank(String semester, Long examId, Long teachCollegeId, String courseCode, Long teacherId, Integer pageNumber, Integer pageSize);
+
+    /**
+     * 查询老师得分
+     *
+     * @param examId
+     * @param courseCode
+     * @param collegeId
+     * @return
+     */
+    List<TAExamCourseTeacherResult> findTeacherInfo(Long examId, String courseCode, Long collegeId);
 }

+ 13 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBAnswerService.java

@@ -3,6 +3,7 @@ package com.qmth.teachcloud.report.business.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.teachcloud.report.business.bean.dto.query.BasicAnswerDto;
 import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto;
+import com.qmth.teachcloud.report.business.bean.result.TBAnswerResult;
 import com.qmth.teachcloud.report.business.entity.TBAnswer;
 
 import java.util.List;
@@ -19,6 +20,7 @@ public interface TBAnswerService extends IService<TBAnswer> {
 
     /**
      * 根据试卷id查询参与该试卷的考生详细作答记录
+     *
      * @param paperId 试卷id
      * @return 考生作答记录
      */
@@ -26,9 +28,19 @@ public interface TBAnswerService extends IService<TBAnswer> {
 
     /**
      * 查找试卷结构效度数据
-     * @param examId 考试id
+     *
+     * @param examId     考试id
      * @param courseCode 课程编号
      * @return 结果
      */
     List<ValidAnswerDetailDto> findValid(Long examId, String courseCode);
+
+    /**
+     * 查找有效答案
+     *
+     * @param examId
+     * @param courseCode
+     * @return
+     */
+    List<TBAnswerResult> findValidAnswerDetail(Long examId, String courseCode);
 }

+ 15 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseCollegeTeacherServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.teachcloud.common.util.ServletUtil;
+import com.qmth.teachcloud.report.business.bean.result.TAExamCourseTeacherResult;
 import com.qmth.teachcloud.report.business.bean.result.TeacherClassRankResult;
 import com.qmth.teachcloud.report.business.bean.result.TeacherMyClassRankResult;
 import com.qmth.teachcloud.report.business.entity.TAExamCourseCollegeTeacher;
@@ -12,6 +13,7 @@ import com.qmth.teachcloud.report.business.service.TAExamCourseCollegeTeacherSer
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * <p>
@@ -50,4 +52,17 @@ public class TAExamCourseCollegeTeacherServiceImpl extends ServiceImpl<TAExamCou
         IPage<TAExamCourseCollegeTeacher> listPage = taExamCourseCollegeTeacherMapper.listAllTeacherClassRank(page, schoolId, semester, examId, teachCollegeId, courseCode, teacherId);
         return listPage;
     }
+
+    /**
+     * 查询老师得分
+     *
+     * @param examId
+     * @param courseCode
+     * @param collegeId
+     * @return
+     */
+    @Override
+    public List<TAExamCourseTeacherResult> findTeacherInfo(Long examId, String courseCode, Long collegeId) {
+        return taExamCourseCollegeTeacherMapper.findTeacherInfo(examId, courseCode, collegeId);
+    }
 }

+ 28 - 9
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseServiceImpl.java

@@ -3,11 +3,10 @@ package com.qmth.teachcloud.report.business.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.util.ServletUtil;
-import com.qmth.teachcloud.report.business.bean.result.CourseDimensionResult;
-import com.qmth.teachcloud.report.business.bean.result.TAExamCourseCollegeInspectResult;
-import com.qmth.teachcloud.report.business.bean.result.TAExamCourseResult;
-import com.qmth.teachcloud.report.business.bean.result.TBPaperStructResult;
+import com.qmth.teachcloud.report.business.bean.result.*;
 import com.qmth.teachcloud.report.business.entity.*;
 import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
 import com.qmth.teachcloud.report.business.enums.SemesterEnum;
@@ -19,10 +18,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * <p>
@@ -56,6 +52,12 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
     @Resource
     TBPaperStructService tbPaperStructService;
 
+    @Resource
+    TBAnswerService tbAnswerService;
+
+    @Resource
+    TAExamCourseCollegeTeacherService taExamCourseCollegeTeacherService;
+
     /**
      * 开课课程考试总览列表接口
      *
@@ -138,6 +140,10 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
      */
     @Override
     public List<Object> surveyInspectAnalyseView(Long examId, SemesterEnum semester, String courseCode, Long schoolId) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        if (Objects.isNull(sysUser)) {
+            throw ExceptionResultEnum.NOT_LOGIN.exception();
+        }
         //查找试卷
         QueryWrapper<TBPaper> tbPaperQueryWrapper = new QueryWrapper<>();
         tbPaperQueryWrapper.lambda().eq(TBPaper::getExamId, examId)
@@ -148,7 +154,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
         List<TAExamCourseCollegeInspectResult> taExamCourseCollegeInspectResultList = taExamCourseCollegeInspectService.findCourseDescriptiveStatisticsForCollege(examId, courseCode);
 
         //查找维度
-        List<CourseDimensionResult> courseDimensionResultList = tbDimensionService.findDimensionInfo(examId, courseCode, 1L);
+        List<CourseDimensionResult> courseDimensionResultList = tbDimensionService.findDimensionInfo(examId, courseCode, sysUser.getOrgId());
 
         //查找难易度
         QueryWrapper<TBCommonLevelConfig> tbCommonLevelConfigQueryWrapper = new QueryWrapper<>();
@@ -157,7 +163,20 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
                 .eq(TBCommonLevelConfig::getLevelType, "难度等级");
         List<TBCommonLevelConfig> tbCommonLevelConfigList = tbCommonLevelConfigService.list(tbCommonLevelConfigQueryWrapper);
 
+        //查找试卷结构
         List<TBPaperStructResult> tbPaperStructList = tbPaperStructService.findQuestionInfo(examId, courseCode);
+
+        //查找答题记录
+        List<TBAnswerResult> tbAnswerResultList = tbAnswerService.findValidAnswerDetail(examId, courseCode);
+
+        //查找老师得分
+        List<TAExamCourseTeacherResult> taExamCourseTeacherResultList = taExamCourseCollegeTeacherService.findTeacherInfo(examId, courseCode, sysUser.getOrgId());
+
+        //查找维度
+        QueryWrapper<TBDimension> tbDimensionQueryWrapper = new QueryWrapper<>();
+        tbDimensionQueryWrapper.lambda().eq(TBDimension::getExamId, examId)
+                .eq(TBDimension::getCourseCode, courseCode);
+        List<TBDimension> tbDimensionList = tbDimensionService.list(tbDimensionQueryWrapper);
         return null;
     }
 }

+ 15 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBAnswerServiceImpl.java

@@ -3,6 +3,7 @@ package com.qmth.teachcloud.report.business.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.teachcloud.report.business.bean.dto.query.BasicAnswerDto;
 import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto;
+import com.qmth.teachcloud.report.business.bean.result.TBAnswerResult;
 import com.qmth.teachcloud.report.business.entity.TBAnswer;
 import com.qmth.teachcloud.report.business.mapper.TBAnswerMapper;
 import com.qmth.teachcloud.report.business.service.TBAnswerService;
@@ -21,6 +22,7 @@ import java.util.List;
  */
 @Service
 public class TBAnswerServiceImpl extends ServiceImpl<TBAnswerMapper, TBAnswer> implements TBAnswerService {
+
     @Resource
     private TBAnswerMapper tbAnswerMapper;
 
@@ -31,6 +33,18 @@ public class TBAnswerServiceImpl extends ServiceImpl<TBAnswerMapper, TBAnswer> i
 
     @Override
     public List<ValidAnswerDetailDto> findValid(Long examId, String courseCode) {
-        return tbAnswerMapper.findValid(examId,courseCode);
+        return tbAnswerMapper.findValid(examId, courseCode);
+    }
+
+    /**
+     * 查找有效答案
+     *
+     * @param examId
+     * @param courseCode
+     * @return
+     */
+    @Override
+    public List<TBAnswerResult> findValidAnswerDetail(Long examId, String courseCode) {
+        return tbAnswerMapper.findValidAnswerDetail(examId, courseCode);
     }
 }

+ 48 - 0
teachcloud-report-business/src/main/resources/mapper/TAExamCourseCollegeTeacherMapper.xml

@@ -33,6 +33,7 @@
             </if>
         </where>
     </select>
+
     <select id="listMyClassRank"
             resultType="com.qmth.teachcloud.report.business.bean.result.TeacherMyClassRankResult">
         SELECT
@@ -65,6 +66,7 @@
             </if>
         </where>
     </select>
+
     <select id="listAllTeacherClassRank"
             resultType="com.qmth.teachcloud.report.business.entity.TAExamCourseCollegeTeacher">
         SELECT
@@ -98,4 +100,50 @@
             </if>
         </where>
     </select>
+
+    <select id="findTeacherInfo" resultType="com.qmth.teachcloud.report.business.bean.result.TAExamCourseTeacherResult">
+        SELECT
+            col.teacher_name AS teacherName,
+            col.reality_count AS colRealityCount,
+            col.total_count AS colTotalCount,
+            col.absent_count AS colAbsentCount,
+            round(convert(col.min_score_assign , decimal(10, 4)), 2) AS colMinScore,
+            round(convert(col.max_score_assign , decimal(10, 4)), 2) AS colMaxScore,
+            round(convert(col.avg_score_assign , decimal(10, 4)), 2) AS colAvgScore,
+            round(convert(col.upper_quartile, decimal(10, 4)), 2) AS colUpperQuartile,
+            round(convert(col.median, decimal(10, 4)), 2) AS colMedian,
+            round(convert(col.lower_quartile, decimal(10, 4)), 2) AS colLowerQuartile,
+            col.mode AS colMode,
+            round(convert(col.standard_deviation, decimal(10, 4)), 2) AS colStandardDeviation,
+            round(convert(col.relative_position, decimal(10, 4)), 2) AS colRelativePosition,
+            sch.reality_count AS schRealityCount,
+            sch.total_count AS schTotalCount,
+            sch.absent_count AS schAbsentCount,
+            round(convert(sch.min_score, decimal(10, 4)), 2) AS schMinScore,
+            round(convert(sch.max_score, decimal(10, 4)), 2) AS schMaxScore,
+            round(convert(sch.avg_score, decimal(10, 4)), 2) AS schAvgScore,
+            round(convert(sch.upper_quartile, decimal(10, 4)), 2) AS schUpperQuartile,
+            round(convert(sch.median, decimal(10, 4)), 2) AS schMedian,
+            round(convert(sch.lower_quartile, decimal(10, 4)), 2) AS schLowerQuartile,
+            sch.mode AS schMode,
+            round(convert(sch.standard_deviation, decimal(10, 4)), 2) AS schStandardDeviation,
+            round(convert(sch.relative_position, decimal(10, 4)), 2) AS schRelativePosition
+        FROM
+             t_a_exam_course_college_teacher col
+        INNER JOIN  t_a_exam_course_teacher sch ON
+            col.exam_id = sch.exam_id
+            AND col.course_code = sch.course_code
+            AND col.teacher_name = sch.teacher_name
+        <where>
+            <if test="examId != null and examId != ''">
+                and col.exam_id = #{examId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and col.course_code = #{courseCode}
+            </if>
+            <if test="collegeId != null and collegeId != ''">
+                and col.inspect_college_id = #{collegeId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 28 - 0
teachcloud-report-business/src/main/resources/mapper/TBAnswerMapper.xml

@@ -27,6 +27,7 @@
         WHERE
             t1.paper_id = #{paperId}
     </select>
+
     <select id="findValid"
             resultType="com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto">
         SELECT
@@ -49,4 +50,31 @@
           AND record.exam_id = #{examId}
           AND record.course_code = #{courseCode};
     </select>
+
+    <select id="findValidAnswerDetail" resultType="com.qmth.teachcloud.report.business.bean.result.TBAnswerResult">
+        SELECT
+            tik.paper_type AS paperType,
+            det.score / tbps.full_score AS scoreRate,
+            pap.difficult AS difficult,
+            (select so.name from sys_org so where so.id = tik.inspect_college_id) AS collegeName
+        FROM
+            t_b_answer det
+        INNER JOIN t_a_exam_course_record tik ON
+            det.exam_record_id = tik.exam_record_id
+        INNER JOIN t_a_paper_struct pap ON
+            tik.exam_id = pap.exam_id
+            AND tik.course_code = pap.course_code
+        JOIN t_b_paper_struct tbps on
+            tbps.id = pap.paper_struct_id
+            AND det.sub_number = tbps.small_question_number
+        <where>
+            <if test="examId != null and examId != ''">
+                and tik.exam_id = #{examId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and tik.course_code = #{courseCode}
+            </if>
+            and tik.absent = 0
+        </where>
+    </select>
 </mapper>