查询考试记录
This commit is contained in:
parent
8cad6c0587
commit
0116c8f9a7
|
|
@ -192,6 +192,14 @@ public class ApiExaminationController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 交卷
|
||||
* @param examUserExaminationQuestion
|
||||
* @param examUserExaminationId
|
||||
* @param examinationId
|
||||
* @param paperId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/v1/examination/finish/{examUserExaminationId}/{examinationId}/{paperId}")
|
||||
public AjaxResult finish(@RequestBody List<ExamUserExaminationQuestion> examUserExaminationQuestion,
|
||||
@PathVariable Integer examUserExaminationId ,@PathVariable Integer examinationId,@PathVariable Integer paperId) {
|
||||
|
|
@ -263,6 +271,22 @@ public class ApiExaminationController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 考试记录列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/v1/examination/userexamination/list")
|
||||
public AjaxResult userexamination(ExamUserExaminationVO bean) {
|
||||
SysUser sysUser = sysUserService.selectUserByLoginName( JwtUtil.getLoginName() );
|
||||
bean.setVipUserId(Integer.parseInt(sysUser.getUserId().toString()));
|
||||
List<ExamUserExaminationVO> data = examUserExaminationService.selectMyExamUserExamination(bean);
|
||||
AjaxResult success = success("考试完成");
|
||||
success.put("data", data);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.ruoyi.exam.domain;
|
||||
|
||||
/**
|
||||
* Created by flower on 2019/1/14.
|
||||
*/
|
||||
public class ExamUserExaminationVO extends ExamUserExamination{
|
||||
|
||||
private ExamExaminationVO examExaminationVO;
|
||||
|
||||
public ExamExaminationVO getExamExaminationVO() {
|
||||
return examExaminationVO;
|
||||
}
|
||||
|
||||
public void setExamExaminationVO(ExamExaminationVO examExaminationVO) {
|
||||
this.examExaminationVO = examExaminationVO;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.exam.mapper;
|
|||
|
||||
import com.ruoyi.exam.domain.ExamUserExamination;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.exam.domain.ExamUserExaminationVO;
|
||||
import com.ruoyi.framework.web.base.MyMapper;
|
||||
|
||||
/**
|
||||
|
|
@ -22,4 +24,11 @@ public interface ExamUserExaminationMapper extends MyMapper<ExamUserExamination
|
|||
public List<ExamUserExamination> selectExamUserExaminationList(ExamUserExamination examUserExamination);
|
||||
|
||||
List<ExamUserExamination> selectLastOne(ExamUserExamination examUserExamination);
|
||||
|
||||
/**
|
||||
* 查询我的考试记录
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<ExamUserExaminationVO> selectMyExamUserExamination(ExamUserExaminationVO bean);
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.exam.service;
|
|||
|
||||
import com.ruoyi.exam.domain.ExamUserExamination;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.exam.domain.ExamUserExaminationVO;
|
||||
import com.ruoyi.framework.web.base.AbstractBaseService;
|
||||
/**
|
||||
* 我的考试记录 服务层
|
||||
|
|
@ -36,4 +38,6 @@ public interface IExamUserExaminationService extends AbstractBaseService<ExamUse
|
|||
void insertOne(ExamUserExamination insert);
|
||||
|
||||
int updateOneSelectiveById(ExamUserExamination examUserExamination);
|
||||
|
||||
List<ExamUserExaminationVO> selectMyExamUserExamination(ExamUserExaminationVO bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.exam.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.exam.domain.ExamUserExaminationVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.exam.mapper.ExamUserExaminationMapper;
|
||||
|
|
@ -48,6 +50,12 @@ public class ExamUserExaminationServiceImpl extends AbstractBaseServiceImpl<Exam
|
|||
return examUserExaminationMapper.updateByPrimaryKeySelective(examUserExamination);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExamUserExaminationVO> selectMyExamUserExamination(ExamUserExaminationVO bean) {
|
||||
startPage();
|
||||
return examUserExaminationMapper.selectMyExamUserExamination(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的考试记录分页列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,9 +17,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="remarks" column="remarks" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="ExamUserExaminationVO" id="ExamUserExaminationResultVO">
|
||||
<result property="id" column="id" />
|
||||
<result property="vipUserId" column="vip_user_id" />
|
||||
<result property="examExaminationId" column="exam_examination_id" />
|
||||
<result property="examPaperId" column="exam_paper_id" />
|
||||
<result property="score" column="score" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateDate" column="update_date" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<association property="examExaminationVO" javaType="com.ruoyi.exam.domain.ExamExaminationVO">
|
||||
<result property="id" column="v_id" />
|
||||
<result property="deptId" column="v_dept_id" />
|
||||
<result property="examPaperId" column="v_exam_paper_id" />
|
||||
<result property="trainCourseId" column="v_train_course_id" />
|
||||
<result property="trainCourseName" column="v_traincourse_name" />
|
||||
<result property="name" column="v_name" />
|
||||
<result property="type" column="v_type" />
|
||||
<result property="enableControlTime" column="v_enable_control_time" />
|
||||
<result property="startTime" column="v_start_time" />
|
||||
<result property="endTime" column="v_end_time" />
|
||||
<result property="timeLength" column="v_time_length" />
|
||||
<result property="examNumber" column="v_exam_number" />
|
||||
<result property="passMark" column="v_pass_mark" />
|
||||
<result property="questionDisorder" column="v_question_disorder" />
|
||||
<result property="finishedPaper" column="v_finished_paper" />
|
||||
<result property="examEnd" column="v_exam_end" />
|
||||
<result property="examinationUserLimit" column="v_examination_user_limit" />
|
||||
<result property="createBy" column="v_create_by" />
|
||||
<result property="createDate" column="v_create_date" />
|
||||
<result property="updateBy" column="v_update_by" />
|
||||
<result property="updateDate" column="v_update_date" />
|
||||
<result property="remarks" column="v_remarks" />
|
||||
<result property="delFlag" column="v_del_flag" />
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectExamUserExaminationVo">
|
||||
id, vip_user_id, exam_examination_id, exam_paper_id, score, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
|
||||
exam_user_examination.id,
|
||||
exam_user_examination.vip_user_id,
|
||||
exam_user_examination.exam_examination_id,
|
||||
exam_user_examination.exam_paper_id, score,
|
||||
exam_user_examination.create_by,
|
||||
exam_user_examination.create_date,
|
||||
exam_user_examination.update_by,
|
||||
exam_user_examination.update_date,
|
||||
exam_user_examination.remarks,
|
||||
exam_user_examination.del_flag </sql>
|
||||
|
||||
<select id="selectExamUserExaminationList" parameterType="ExamUserExamination" resultMap="ExamUserExaminationResult">
|
||||
select
|
||||
|
|
@ -60,5 +110,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by create_date desc;
|
||||
</select>
|
||||
|
||||
<select id="selectMyExamUserExamination" resultMap="ExamUserExaminationResultVO">
|
||||
select
|
||||
<include refid="selectExamUserExaminationVo"/>,
|
||||
tc.name as v_traincourse_name,
|
||||
ee.name as v_name,
|
||||
ee.type as v_type,
|
||||
ee.enable_control_time as v_enable_control_time,
|
||||
ee.start_time as v_start_time,
|
||||
ee.end_time as v_end_time
|
||||
from exam_user_examination exam_user_examination
|
||||
INNER JOIN exam_examination ee ON exam_user_examination.exam_examination_id = ee.id
|
||||
INNER JOIN train_course tc ON ee.train_course_id = tc.id
|
||||
<where>
|
||||
<if test="id != null "> and id = #{id}</if>
|
||||
<if test="vipUserId != null "> and vip_user_id = #{vipUserId}</if>
|
||||
<if test="examExaminationId != null "> and exam_examination_id = #{examExaminationId}</if>
|
||||
<if test="examPaperId != null "> and exam_paper_id = #{examPaperId}</if>
|
||||
<if test="score != null "> and score = #{score}</if>
|
||||
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
|
||||
<if test="createDate != null "> and create_date = #{createDate}</if>
|
||||
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
|
||||
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
||||
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
|
||||
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue