考核评估-考题自动生成
This commit is contained in:
parent
03e674249d
commit
4cde6327e9
@ -0,0 +1,39 @@
|
|||||||
|
package com.inspur.examine.domain;
|
||||||
|
|
||||||
|
import com.inspur.common.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷试题对象 exam_paper_question
|
||||||
|
*
|
||||||
|
* @author inspur
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ExamPaperQuestion {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷id
|
||||||
|
*/
|
||||||
|
@Excel(name = "试卷id")
|
||||||
|
private String paperId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试题id
|
||||||
|
*/
|
||||||
|
@Excel(name = "试题id")
|
||||||
|
private String questionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考生答案
|
||||||
|
*/
|
||||||
|
@Excel(name = "考生答案")
|
||||||
|
private String examineAnswer;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
package com.inspur.examine.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.inspur.examine.domain.ExamPaperQuestion;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷试题Mapper接口
|
||||||
|
*
|
||||||
|
* @author inspur
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
public interface ExamPaperQuestionMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询试卷试题
|
||||||
|
*
|
||||||
|
* @param id 试卷试题主键
|
||||||
|
* @return 试卷试题
|
||||||
|
*/
|
||||||
|
public ExamPaperQuestion selectExamPaperQuestionById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷试题列表
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 试卷试题集合
|
||||||
|
*/
|
||||||
|
public List<ExamPaperQuestion> selectExamPaperQuestionList(ExamPaperQuestion examPaperQuestion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增试卷试题
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertExamPaperQuestion(ExamPaperQuestion examPaperQuestion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改试卷试题
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateExamPaperQuestion(ExamPaperQuestion examPaperQuestion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除试卷试题
|
||||||
|
*
|
||||||
|
* @param id 试卷试题主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteExamPaperQuestionById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除试卷试题
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteExamPaperQuestionByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增试卷试题信息
|
||||||
|
*
|
||||||
|
* @Author xusd
|
||||||
|
* @Date 16:53 2024/5/9
|
||||||
|
* @param paperQuestionList 数据
|
||||||
|
*/
|
||||||
|
void batchInsertPaperQuestion(@Param("paperQuestionList") List<ExamPaperQuestion> paperQuestionList);
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.inspur.examine.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.inspur.examine.domain.ExamPaperQuestion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷试题Service接口
|
||||||
|
*
|
||||||
|
* @author inspur
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
public interface IExamPaperQuestionService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询试卷试题
|
||||||
|
*
|
||||||
|
* @param id 试卷试题主键
|
||||||
|
* @return 试卷试题
|
||||||
|
*/
|
||||||
|
public ExamPaperQuestion selectExamPaperQuestionById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷试题列表
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 试卷试题集合
|
||||||
|
*/
|
||||||
|
public List<ExamPaperQuestion> selectExamPaperQuestionList(ExamPaperQuestion examPaperQuestion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增试卷试题
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertExamPaperQuestion(ExamPaperQuestion examPaperQuestion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改试卷试题
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateExamPaperQuestion(ExamPaperQuestion examPaperQuestion);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除试卷试题
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的试卷试题主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteExamPaperQuestionByIds(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除试卷试题信息
|
||||||
|
*
|
||||||
|
* @param id 试卷试题主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteExamPaperQuestionById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增试卷试题信息
|
||||||
|
*
|
||||||
|
* @Author xusd
|
||||||
|
* @Date 16:53 2024/5/9
|
||||||
|
* @param paperQuestionList 数据
|
||||||
|
*/
|
||||||
|
void batchInsertPaperQuestion(List<ExamPaperQuestion> paperQuestionList);
|
||||||
|
}
|
@ -56,7 +56,6 @@ public class ExamPaperInfoServiceImpl implements IExamPaperInfoService
|
|||||||
@Override
|
@Override
|
||||||
public int insertExamPaperInfo(ExamPaperInfo examPaperInfo)
|
public int insertExamPaperInfo(ExamPaperInfo examPaperInfo)
|
||||||
{
|
{
|
||||||
examPaperInfo.setId(IdUtils.fastSimpleUUID());
|
|
||||||
examPaperInfo.setTenantId(SecurityUtils.getLoginUser().getTenantId());
|
examPaperInfo.setTenantId(SecurityUtils.getLoginUser().getTenantId());
|
||||||
return examPaperInfoMapper.insertExamPaperInfo(examPaperInfo);
|
return examPaperInfoMapper.insertExamPaperInfo(examPaperInfo);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,105 @@
|
|||||||
|
package com.inspur.examine.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.inspur.examine.mapper.ExamPaperQuestionMapper;
|
||||||
|
import com.inspur.examine.domain.ExamPaperQuestion;
|
||||||
|
import com.inspur.examine.service.IExamPaperQuestionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试卷试题Service业务层处理
|
||||||
|
*
|
||||||
|
* @author inspur
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ExamPaperQuestionServiceImpl implements IExamPaperQuestionService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ExamPaperQuestionMapper examPaperQuestionMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷试题
|
||||||
|
*
|
||||||
|
* @param id 试卷试题主键
|
||||||
|
* @return 试卷试题
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ExamPaperQuestion selectExamPaperQuestionById(String id)
|
||||||
|
{
|
||||||
|
return examPaperQuestionMapper.selectExamPaperQuestionById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询试卷试题列表
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 试卷试题
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ExamPaperQuestion> selectExamPaperQuestionList(ExamPaperQuestion examPaperQuestion)
|
||||||
|
{
|
||||||
|
return examPaperQuestionMapper.selectExamPaperQuestionList(examPaperQuestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增试卷试题
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertExamPaperQuestion(ExamPaperQuestion examPaperQuestion)
|
||||||
|
{
|
||||||
|
return examPaperQuestionMapper.insertExamPaperQuestion(examPaperQuestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改试卷试题
|
||||||
|
*
|
||||||
|
* @param examPaperQuestion 试卷试题
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateExamPaperQuestion(ExamPaperQuestion examPaperQuestion)
|
||||||
|
{
|
||||||
|
return examPaperQuestionMapper.updateExamPaperQuestion(examPaperQuestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除试卷试题
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的试卷试题主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteExamPaperQuestionByIds(String[] ids)
|
||||||
|
{
|
||||||
|
return examPaperQuestionMapper.deleteExamPaperQuestionByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除试卷试题信息
|
||||||
|
*
|
||||||
|
* @param id 试卷试题主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteExamPaperQuestionById(String id)
|
||||||
|
{
|
||||||
|
return examPaperQuestionMapper.deleteExamPaperQuestionById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增试卷试题信息
|
||||||
|
*
|
||||||
|
* @Author xusd
|
||||||
|
* @Date 16:53 2024/5/9
|
||||||
|
* @param paperQuestionList 数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void batchInsertPaperQuestion(List<ExamPaperQuestion> paperQuestionList) {
|
||||||
|
examPaperQuestionMapper.batchInsertPaperQuestion(paperQuestionList);
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +1,18 @@
|
|||||||
package com.inspur.examine.service.impl;
|
package com.inspur.examine.service.impl;
|
||||||
|
|
||||||
|
import com.inspur.common.exception.ServiceException;
|
||||||
import com.inspur.common.utils.SecurityUtils;
|
import com.inspur.common.utils.SecurityUtils;
|
||||||
import com.inspur.common.utils.StringUtils;
|
import com.inspur.common.utils.StringUtils;
|
||||||
import com.inspur.examine.domain.ExamAttestation;
|
import com.inspur.common.utils.uuid.IdUtils;
|
||||||
import com.inspur.examine.domain.ExamInfo;
|
import com.inspur.examine.domain.*;
|
||||||
import com.inspur.examine.domain.ExamPaperInfo;
|
|
||||||
import com.inspur.examine.mapper.MyExamineMapper;
|
import com.inspur.examine.mapper.MyExamineMapper;
|
||||||
import com.inspur.examine.service.IExamInfoService;
|
import com.inspur.examine.service.*;
|
||||||
import com.inspur.examine.service.IExamPaperInfoService;
|
|
||||||
import com.inspur.examine.service.IMyExamineService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.stream.Collectors;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的考试
|
* 我的考试
|
||||||
@ -32,6 +29,15 @@ public class MyExamineServiceImpl implements IMyExamineService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IExamPaperInfoService examPaperInfoService;
|
private IExamPaperInfoService examPaperInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IExamInfoService examInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IExamQuestionBankService examQuestionBankService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IExamPaperQuestionService examPaperQuestionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询考试信息列表
|
* 查询考试信息列表
|
||||||
*/
|
*/
|
||||||
@ -55,17 +61,115 @@ public class MyExamineServiceImpl implements IMyExamineService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int generateExam(String id) {
|
public int generateExam(String id) {
|
||||||
|
ExamInfo examInfo = examInfoService.selectExamInfoById(id);
|
||||||
|
if (Objects.isNull(examInfo)){
|
||||||
|
throw new ServiceException("未查询到考试信息");
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取所有该类型和等级的试题
|
||||||
|
ExamQuestionBank examQuestionBank = new ExamQuestionBank();
|
||||||
|
examQuestionBank.setExamType(examInfo.getExamType());
|
||||||
|
examQuestionBank.setExamLevel(examInfo.getExamLevel());
|
||||||
|
//启用的试题
|
||||||
|
examQuestionBank.setStatus("0");
|
||||||
|
List<ExamQuestionBank> examQuestionBanks = examQuestionBankService.selectExamQuestionBankList(examQuestionBank);
|
||||||
|
Map<String, List<ExamQuestionBank>> questionTypeMap = examQuestionBanks.stream().collect(Collectors.groupingBy(ExamQuestionBank::getQuestionType));
|
||||||
|
|
||||||
|
//判断考题数量是否充足
|
||||||
|
//单选题
|
||||||
|
if (examInfo.getSingleChoice() > 0){
|
||||||
|
if (StringUtils.isEmpty(questionTypeMap.get("0")) || examInfo.getSingleChoice() > questionTypeMap.get("0").size()){
|
||||||
|
throw new ServiceException("单选题数量不足");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//多选题
|
||||||
|
if (examInfo.getMultipleChoice() > 0){
|
||||||
|
if (StringUtils.isEmpty(questionTypeMap.get("1")) || examInfo.getMultipleChoice() > questionTypeMap.get("1").size()){
|
||||||
|
throw new ServiceException("多选题数量不足");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//判断题
|
||||||
|
if (examInfo.getJudge() > 0){
|
||||||
|
if (StringUtils.isEmpty(questionTypeMap.get("2")) || examInfo.getJudge() > questionTypeMap.get("2").size()){
|
||||||
|
throw new ServiceException("判断题数量不足");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增考生考试信息
|
||||||
ExamPaperInfo examPaperInfo = new ExamPaperInfo();
|
ExamPaperInfo examPaperInfo = new ExamPaperInfo();
|
||||||
|
String examPaperInfoId = IdUtils.fastSimpleUUID();
|
||||||
|
examPaperInfo.setId(examPaperInfoId);
|
||||||
examPaperInfo.setExamId(id);
|
examPaperInfo.setExamId(id);
|
||||||
examPaperInfo.setExamineId(SecurityUtils.getUserId());
|
examPaperInfo.setExamineId(SecurityUtils.getUserId());
|
||||||
examPaperInfo.setStatus("0");
|
examPaperInfo.setStatus("0");
|
||||||
int i = examPaperInfoService.insertExamPaperInfo(examPaperInfo);
|
int i = examPaperInfoService.insertExamPaperInfo(examPaperInfo);
|
||||||
if (i > 0){
|
if (i > 0){
|
||||||
//todo:生成考试试题等
|
//根据考试各类型试题条数出题
|
||||||
|
List<ExamQuestionBank> questionList = new ArrayList<>();
|
||||||
|
//单选题
|
||||||
|
if (examInfo.getSingleChoice() > 0){
|
||||||
|
List<ExamQuestionBank> singleChoiceList = questionTypeMap.get("0");
|
||||||
|
//随机题目
|
||||||
|
List<ExamQuestionBank> insertSingleChoiceList = createRandoms(singleChoiceList, examInfo.getSingleChoice());
|
||||||
|
questionList.addAll(insertSingleChoiceList);
|
||||||
|
}
|
||||||
|
//多选题
|
||||||
|
if (examInfo.getMultipleChoice() > 0){
|
||||||
|
List<ExamQuestionBank> multipleChoiceList = questionTypeMap.get("1");
|
||||||
|
//随机题目
|
||||||
|
List<ExamQuestionBank> insertMultipleChoiceListList = createRandoms(multipleChoiceList, examInfo.getMultipleChoice());
|
||||||
|
questionList.addAll(insertMultipleChoiceListList);
|
||||||
|
}
|
||||||
|
//判断题
|
||||||
|
if (examInfo.getJudge() > 0){
|
||||||
|
List<ExamQuestionBank> judgeList = questionTypeMap.get("2");
|
||||||
|
//随机题目
|
||||||
|
List<ExamQuestionBank> insertJudgeList = createRandoms(judgeList, examInfo.getJudge());
|
||||||
|
questionList.addAll(insertJudgeList);
|
||||||
|
}
|
||||||
|
//新增试卷试题关联
|
||||||
|
if (StringUtils.isNotEmpty(questionList)){
|
||||||
|
List<ExamPaperQuestion> paperQuestionList = new ArrayList<>();
|
||||||
|
questionList.forEach(item->{
|
||||||
|
ExamPaperQuestion paperQuestion = new ExamPaperQuestion();
|
||||||
|
paperQuestion.setId(IdUtils.fastSimpleUUID());
|
||||||
|
paperQuestion.setPaperId(examPaperInfoId);
|
||||||
|
paperQuestion.setQuestionId(item.getId());
|
||||||
|
paperQuestionList.add(paperQuestion);
|
||||||
|
});
|
||||||
|
//批量新增
|
||||||
|
examPaperQuestionService.batchInsertPaperQuestion(paperQuestionList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从源数据中取出随机数量的不重复数据
|
||||||
|
*
|
||||||
|
* @param source 源数据
|
||||||
|
* @param n 随机获取数量
|
||||||
|
* @return java.util.List<com.inspur.examine.domain.ExamQuestionBank>
|
||||||
|
* @Author xusd
|
||||||
|
* @Date 16:17 2024/5/9
|
||||||
|
*/
|
||||||
|
private List<ExamQuestionBank> createRandoms(List<ExamQuestionBank> source, int n) {
|
||||||
|
Map<Integer,String> map = new HashMap<>();
|
||||||
|
List<ExamQuestionBank> news = new ArrayList<>();
|
||||||
|
if (source.size() == n){
|
||||||
|
return source;
|
||||||
|
}else {
|
||||||
|
while (map.size() < n){
|
||||||
|
int random = (int) (Math.random() * source.size());
|
||||||
|
if (!map.containsKey(random)){
|
||||||
|
map.put(random,"");
|
||||||
|
news.add(source.get(random));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return news;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待考试列表
|
* 待考试列表
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,76 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.inspur.examine.mapper.ExamPaperQuestionMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.inspur.examine.domain.ExamPaperQuestion" id="ExamPaperQuestionResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="paperId" column="paper_id" />
|
||||||
|
<result property="questionId" column="question_id" />
|
||||||
|
<result property="examineAnswer" column="examine_answer" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectExamPaperQuestionVo">
|
||||||
|
select id, paper_id, question_id, examine_answer from exam_paper_question
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectExamPaperQuestionList" parameterType="com.inspur.examine.domain.ExamPaperQuestion" resultMap="ExamPaperQuestionResult">
|
||||||
|
<include refid="selectExamPaperQuestionVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="paperId != null and paperId != ''"> and paper_id = #{paperId}</if>
|
||||||
|
<if test="questionId != null and questionId != ''"> and question_id = #{questionId}</if>
|
||||||
|
<if test="examineAnswer != null and examineAnswer != ''"> and examine_answer = #{examineAnswer}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectExamPaperQuestionById" parameterType="String" resultMap="ExamPaperQuestionResult">
|
||||||
|
<include refid="selectExamPaperQuestionVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertExamPaperQuestion" parameterType="com.inspur.examine.domain.ExamPaperQuestion">
|
||||||
|
insert into exam_paper_question
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="paperId != null">paper_id,</if>
|
||||||
|
<if test="questionId != null">question_id,</if>
|
||||||
|
<if test="examineAnswer != null">examine_answer,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="paperId != null">#{paperId},</if>
|
||||||
|
<if test="questionId != null">#{questionId},</if>
|
||||||
|
<if test="examineAnswer != null">#{examineAnswer},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="batchInsertPaperQuestion">
|
||||||
|
insert into exam_paper_question(id,paper_id,question_id)
|
||||||
|
values
|
||||||
|
<foreach collection="paperQuestionList" index="index" item="item" separator=",">
|
||||||
|
(#{item.id},#{item.paperId},#{item.questionId})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateExamPaperQuestion" parameterType="com.inspur.examine.domain.ExamPaperQuestion">
|
||||||
|
update exam_paper_question
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="paperId != null">paper_id = #{paperId},</if>
|
||||||
|
<if test="questionId != null">question_id = #{questionId},</if>
|
||||||
|
<if test="examineAnswer != null">examine_answer = #{examineAnswer},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteExamPaperQuestionById" parameterType="String">
|
||||||
|
delete from exam_paper_question where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteExamPaperQuestionByIds" parameterType="String">
|
||||||
|
delete from exam_paper_question where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -332,10 +332,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
generateExam(row){
|
generateExam(row){
|
||||||
this.examLoading = true
|
|
||||||
generateExam(row.id).then(()=>{
|
generateExam(row.id).then(()=>{
|
||||||
this.$modal.msgSuccess("参与成功");
|
this.$modal.msgSuccess("参与成功");
|
||||||
this.examLoading = false;
|
|
||||||
this.getExamList();
|
this.getExamList();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user