Commit 368c6f5a by “Kongxiangkun”

工作台年度考试合格率统计修改

parent 81befc5a
......@@ -150,7 +150,7 @@ public interface ExamClient {
List<Exam> selectExamListByName(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO);
@GetMapping("/manage/exam/selectExamListBySta")
List<ExamDetailsMarkingVO> selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO);
ExamDetailsMarkingVO selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO);
/**
* 根据考试名称获取总数
......
......@@ -366,7 +366,7 @@ public class ExamController {
* 根据考试统计考试列表
*/
@GetMapping("/selectExamListBySta")
public List<ExamDetailsMarkingVO> selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO) {
public ExamDetailsMarkingVO selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO) {
LOG.info("***************************************************************查询考试统计阅卷列表*****************************************");
return iExamService.selectExamListBySta(contextAndPageSizeVO);
}
......
......@@ -205,4 +205,13 @@ public interface ExamMapper extends BaseMapper<Exam> {
* @param list
*/
void deleteExams(@Param("list") List<Long> list);
/**
* 工作台 考试合格率统计相关
* @param contextAndPageSizeVO
* @return
*/
int selectCommitTotalCnt(ContextAndPageSizeVO contextAndPageSizeVO);
int selectCommitPassCnt(ContextAndPageSizeVO contextAndPageSizeVO);
int selectCommitOncePassCnt(ContextAndPageSizeVO contextAndPageSizeVO);
}
......@@ -222,7 +222,7 @@ public interface IExamService extends IService<Exam> {
* */
List<com.yizhi.exam.application.vo.domain.Exam> selectExamListByName(ContextAndPageSizeVO contextAndPageSizeVO);
List<ExamDetailsMarkingVO> selectExamListBySta(ContextAndPageSizeVO contextAndPageSizeVO);
ExamDetailsMarkingVO selectExamListBySta(ContextAndPageSizeVO contextAndPageSizeVO);
/**
* 根据考试名称关键字查询总数
......
......@@ -1317,11 +1317,12 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, com.yizhi.applicati
}
@Override
public List<ExamDetailsMarkingVO> selectExamListBySta(ContextAndPageSizeVO contextAndPageSizeVO) {
List<ExamDetailsMarkingVO> examList = examMapper.selectExamListBySta(contextAndPageSizeVO);
return examList;
public ExamDetailsMarkingVO selectExamListBySta(ContextAndPageSizeVO contextAndPageSizeVO) {
ExamDetailsMarkingVO examDetailsMarkingVO = new ExamDetailsMarkingVO();
examDetailsMarkingVO.setCommitExamNum(examMapper.selectCommitTotalCnt(contextAndPageSizeVO));
examDetailsMarkingVO.setQualifidNum(examMapper.selectCommitPassCnt(contextAndPageSizeVO));
examDetailsMarkingVO.setQualifiedNumFrist(examMapper.selectCommitOncePassCnt(contextAndPageSizeVO));
return examDetailsMarkingVO;
}
@Override
......
......@@ -325,6 +325,29 @@
ORDER BY ex.create_time desc
</select>
<select id="selectCommitTotalCnt" resultType="Integer">
select count(*) as commitExamNum from tr_exam_answer a left join exam ex on a.exam_id = ex.id
WHERE ex.state > 1 and ex.company_id = #{companyId} and ex.site_id = #{siteId}
and DATE_FORMAT(ex.create_time,'%Y') = #{year} and a.state in(1,2)
</select>
<select id="selectCommitPassCnt" resultType="Integer">
select count(*) as qualifidNum from tr_exam_answer a left join exam ex on a.exam_id = ex.id
WHERE ex.state > 1 and ex.company_id = #{companyId} and ex.site_id = #{siteId}
and DATE_FORMAT(ex.create_time,'%Y') = #{year} and a.state = 2 and a.score >= ex.qualified_score
</select>
<select id="selectCommitOncePassCnt" resultType="Integer">
select sum(cnt) as qualifiedNumFrist from (
select a.exam_id, a.account_id ,count(*) as cnt from tr_exam_answer a left join exam ex on a.exam_id = ex.id
WHERE ex.state > 1 and ex.company_id = #{companyId} and ex.site_id = #{siteId}
and DATE_FORMAT(ex.create_time,'%Y') = #{year} group by a.exam_id, a.account_id ) n
left join tr_exam_answer a2 on n.exam_id = a2.exam_id and n.account_id = a2.account_id
left join exam ex2 on n.exam_id = ex2.id
where n.cnt = 1 and a2.score >= ex2.qualified_score
and ex2.state > 1 and ex2.company_id = #{companyId} and ex2.site_id = #{siteId}
</select>
<select id="selectExamListByNameCount" resultType="java.lang.Integer">
SELECT COUNT(ex.id)
FROM exam ex
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment