Commit 368c6f5a by “Kongxiangkun”

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

parent 81befc5a
...@@ -150,7 +150,7 @@ public interface ExamClient { ...@@ -150,7 +150,7 @@ public interface ExamClient {
List<Exam> selectExamListByName(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO); List<Exam> selectExamListByName(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO);
@GetMapping("/manage/exam/selectExamListBySta") @GetMapping("/manage/exam/selectExamListBySta")
List<ExamDetailsMarkingVO> selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO); ExamDetailsMarkingVO selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO);
/** /**
* 根据考试名称获取总数 * 根据考试名称获取总数
......
...@@ -366,7 +366,7 @@ public class ExamController { ...@@ -366,7 +366,7 @@ public class ExamController {
* 根据考试统计考试列表 * 根据考试统计考试列表
*/ */
@GetMapping("/selectExamListBySta") @GetMapping("/selectExamListBySta")
public List<ExamDetailsMarkingVO> selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO) { public ExamDetailsMarkingVO selectExamListBySta(@RequestBody ContextAndPageSizeVO contextAndPageSizeVO) {
LOG.info("***************************************************************查询考试统计阅卷列表*****************************************"); LOG.info("***************************************************************查询考试统计阅卷列表*****************************************");
return iExamService.selectExamListBySta(contextAndPageSizeVO); return iExamService.selectExamListBySta(contextAndPageSizeVO);
} }
......
...@@ -205,4 +205,13 @@ public interface ExamMapper extends BaseMapper<Exam> { ...@@ -205,4 +205,13 @@ public interface ExamMapper extends BaseMapper<Exam> {
* @param list * @param list
*/ */
void deleteExams(@Param("list") List<Long> 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> { ...@@ -222,7 +222,7 @@ public interface IExamService extends IService<Exam> {
* */ * */
List<com.yizhi.exam.application.vo.domain.Exam> selectExamListByName(ContextAndPageSizeVO contextAndPageSizeVO); 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 ...@@ -1317,11 +1317,12 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, com.yizhi.applicati
} }
@Override @Override
public List<ExamDetailsMarkingVO> selectExamListBySta(ContextAndPageSizeVO contextAndPageSizeVO) { public ExamDetailsMarkingVO selectExamListBySta(ContextAndPageSizeVO contextAndPageSizeVO) {
ExamDetailsMarkingVO examDetailsMarkingVO = new ExamDetailsMarkingVO();
List<ExamDetailsMarkingVO> examList = examMapper.selectExamListBySta(contextAndPageSizeVO); examDetailsMarkingVO.setCommitExamNum(examMapper.selectCommitTotalCnt(contextAndPageSizeVO));
examDetailsMarkingVO.setQualifidNum(examMapper.selectCommitPassCnt(contextAndPageSizeVO));
return examList; examDetailsMarkingVO.setQualifiedNumFrist(examMapper.selectCommitOncePassCnt(contextAndPageSizeVO));
return examDetailsMarkingVO;
} }
@Override @Override
......
...@@ -325,6 +325,29 @@ ...@@ -325,6 +325,29 @@
ORDER BY ex.create_time desc ORDER BY ex.create_time desc
</select> </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 id="selectExamListByNameCount" resultType="java.lang.Integer">
SELECT COUNT(ex.id) SELECT COUNT(ex.id)
FROM exam ex 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