修复测试bug

master
whb 8 months ago
parent fb19497842
commit eadafa395f

@ -53,6 +53,23 @@ public class Constant {
public static final String YHPLB = "用户评论表";
public static final String CONTEXT_OCR = "文章图片如下2024年我国发展改革领域\n" +
"明确5大重点任务\n" +
"全国发展和改革工作会议12月17日至18日召开会议为2024年我国发展和改革领域”划重点”\n" +
"1.进一步加强经济分析和政策研究,巩固和增强经济回升向好态势。\n" +
"加强经济监测预测预警和政策预研储备,加强政策工具创新和协调配合,加大宏观调控力度,强化政策统筹协调,加强评估和督导,做好经济形势和政策宣传解读\n" +
"2.进一步发挥中长期规划和年度计划的导向作用,切实推动国家重大战略部署有效落地。\n" +
"结合中期评估推进“十四五”规划落实,研究提出“十五五”经济社会发展基本思路。编制实施好年度计划,积极推动新型城镇化、乡村振兴、区域协调发展等重大战略年度重点工作。把农业转移人口市民化摆到更加突出位置,促进新型工业化城镇化协同发展,以城市群、都市圈为依托构建大中小城市协调发展格局,着力解决城市发展中最迫切最突出的安全韧性问题。";
;
public static final String CONTEXT_OCR_ONE = "2024年我国发展改革领域\n" +
"明确5大重点任务\n" +
"全国发展和改革工作会议12月17日至18日召开会议为2024年我国发展和改革领域”划重点”\n" +
"1.进一步加强经济分析和政策研究,巩固和增强经济回升向好态势。\n" +
"加强经济监测预测预警和政策预研储备,加强政策工具创新和协调配合,加大宏观调控力度,强化政策统筹协调,加强评估和督导,做好经济形势和政策宣传解读\n" +
"2.进一步发挥中长期规划和年度计划的导向作用,切实推动国家重大战略部署有效落地。\n" +
"结合中期评估推进“十四五”规划落实,研究提出“十五五”经济社会发展基本思路。编制实施好年度计划,积极推动新型城镇化、乡村振兴、区域协调发展等重大战略年度重点工作。把农业转移人口市民化摆到更加突出位置,促进新型工业化城镇化协同发展,以城市群、都市圈为依托构建大中小城市协调发展格局,着力解决城市发展中最迫切最突出的安全韧性问题。";

@ -0,0 +1,358 @@
package com.sztzjy.marketing.controller.stu;
import cn.hutool.core.util.IdUtil;
import com.sztzjy.marketing.annotation.AnonymousAccess;
import com.sztzjy.marketing.config.Constant;
import com.sztzjy.marketing.config.exception.handler.InvoceTException;
import com.sztzjy.marketing.config.exception.handler.ServiceException;
import com.sztzjy.marketing.config.security.TokenProvider;
import com.sztzjy.marketing.entity.*;
import com.sztzjy.marketing.entity.dto.*;
import com.sztzjy.marketing.mapper.StuAssessmentQuestionDetailsMapper;
import com.sztzjy.marketing.mapper.StuImageRecognitionTrainingMapper;
import com.sztzjy.marketing.mapper.StuLearningAssessmentMapper;
import com.sztzjy.marketing.service.StuFiveGTrainingService;
import com.sztzjy.marketing.util.ConvertUtil;
import com.sztzjy.marketing.util.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author tz
* @date 2023/8/31 16:39
*/
@RestController
@RequestMapping("api/stu/experimental")
@Api(tags = "数字经济实验实训")
public class StuExperimentalTrainingController {
@Autowired
private StuAssessmentQuestionDetailsMapper stuAssessmentQuestionDetailsMapper;
@Autowired
private StuLearningAssessmentMapper stuLearningAssessmentMapper;
@Autowired
private ConvertUtil convertUtil;
@Autowired
private StuFiveGTrainingService stuFiveGTrainingService;
@Autowired
private StuImageRecognitionTrainingMapper stuImageRecognitionTrainingMapper;
@ApiOperation("什么是大数据/获取题目")
@GetMapping("/bigDataTopic")
@AnonymousAccess
public ResultEntity<List<StubigDataTopicDTOS>> bigDataTopic(@ApiParam("模块:什么是大数据") String module, String userId) {
//首先查询有没有做过题如果做过就返回做题结果
StuAssessmentQuestionDetailsExample stuAssessmentQuestionDetailsExample = new StuAssessmentQuestionDetailsExample();
stuAssessmentQuestionDetailsExample.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module);
List<StuAssessmentQuestionDetails> stuAssessmentQuestionDetails = stuAssessmentQuestionDetailsMapper.selectByExample(stuAssessmentQuestionDetailsExample);
List<String> collect = stuAssessmentQuestionDetails.stream().map(item -> item.getTopicId()).collect(Collectors.toList());
//查询题目答案
StuLearningAssessmentExample example3 = new StuLearningAssessmentExample();
example3.createCriteria().andModuleEqualTo(module);
List<StuLearningAssessment> assessmentList = stuLearningAssessmentMapper.selectByExample(example3);
List<String> collectList = assessmentList.stream().map(item -> item.getTopicId()).collect(Collectors.toList());
if (stuAssessmentQuestionDetails.size() > 0) {
List<StubigDataTopicDTOS> stuLearningAssessmentDTOS = new ArrayList<>();
for (int i = 0; i < assessmentList.size(); i++) {
for (int j = 0; j < stuAssessmentQuestionDetails.size(); j++) {
if (assessmentList.get(i).getTopicId().equals(stuAssessmentQuestionDetails.get(j).getTopicId())) {
StubigDataTopicDTOS stuLearningAssessmentDTO = new StubigDataTopicDTOS();
stuLearningAssessmentDTO.setTopicId(assessmentList.get(i).getTopicId());
stuLearningAssessmentDTO.setTopicName(assessmentList.get(i).getTopicName());
stuLearningAssessmentDTO.setTopicType(assessmentList.get(i).getTopicType());
stuLearningAssessmentDTO.setTopicNumber(assessmentList.get(i).getTopicNumber());
stuLearningAssessmentDTO.setOptionA(assessmentList.get(i).getOptionA());
stuLearningAssessmentDTO.setOptionB(assessmentList.get(i).getOptionB());
stuLearningAssessmentDTO.setOptionC(assessmentList.get(i).getOptionC());
stuLearningAssessmentDTO.setOptionD(assessmentList.get(i).getOptionD());
stuLearningAssessmentDTO.setOptionE(assessmentList.get(i).getOptionE());
stuLearningAssessmentDTO.setOptionF(assessmentList.get(i).getOptionF());
stuLearningAssessmentDTO.setOptionG(assessmentList.get(i).getOptionG());
stuLearningAssessmentDTO.setRightOrWrong(stuAssessmentQuestionDetails.get(j).getRightOrWrong());
stuLearningAssessmentDTO.setStudentAnswer(stuAssessmentQuestionDetails.get(j).getStudentAnswer());
stuLearningAssessmentDTO.setQuestionAnswer(assessmentList.get(i).getQuestionAnswer());
stuLearningAssessmentDTO.setState(2);
stuLearningAssessmentDTO.setReason(assessmentList.get(i).getReason());
stuLearningAssessmentDTOS.add(stuLearningAssessmentDTO);
continue;
}
}
}
collectList.removeAll(collect);
for (int i = 0; i < assessmentList.size(); i++) {
for (int j = 0; j < collectList.size(); j++) {
if (assessmentList.get(i).getTopicId().equals(collectList.get(j))) {
StubigDataTopicDTOS stuLearningAssessmentDTO = new StubigDataTopicDTOS();
stuLearningAssessmentDTO.setTopicId(assessmentList.get(i).getTopicId());
stuLearningAssessmentDTO.setTopicName(assessmentList.get(i).getTopicName());
stuLearningAssessmentDTO.setTopicType(assessmentList.get(i).getTopicType());
stuLearningAssessmentDTO.setTopicNumber(assessmentList.get(i).getTopicNumber());
stuLearningAssessmentDTO.setOptionA(assessmentList.get(i).getOptionA());
stuLearningAssessmentDTO.setOptionB(assessmentList.get(i).getOptionB());
stuLearningAssessmentDTO.setOptionC(assessmentList.get(i).getOptionC());
stuLearningAssessmentDTO.setOptionD(assessmentList.get(i).getOptionD());
stuLearningAssessmentDTO.setOptionE(assessmentList.get(i).getOptionE());
stuLearningAssessmentDTO.setOptionF(assessmentList.get(i).getOptionF());
stuLearningAssessmentDTO.setOptionG(assessmentList.get(i).getOptionG());
stuLearningAssessmentDTO.setQuestionAnswer(assessmentList.get(i).getQuestionAnswer());
stuLearningAssessmentDTO.setReason(assessmentList.get(i).getReason());
stuLearningAssessmentDTOS.add(stuLearningAssessmentDTO);
}
}
}
Collections.sort(stuLearningAssessmentDTOS, Comparator.comparing(StubigDataTopicDTOS::getTopicId));
return new ResultEntity<>(HttpStatus.OK, stuLearningAssessmentDTOS);
} else {
StuLearningAssessmentExample example = new StuLearningAssessmentExample();
example.createCriteria().andModuleEqualTo(module);
List<StuLearningAssessment> assessmentList3 = stuLearningAssessmentMapper.selectByExample(example);
assessmentList3.stream().forEach(item -> item.setQuestionAnswer(null));
List<StubigDataTopicDTOS> stuLearningAssessmentDTOS = convertUtil.DTOListToEntity(assessmentList3, StubigDataTopicDTOS.class);
return new ResultEntity<>(HttpStatus.OK, stuLearningAssessmentDTOS);
}
}
@ApiOperation("什么是大数据/提交判断结果")
@PostMapping("/bigDataTopicScore")
@AnonymousAccess
public ResultEntity bigDataTopic(@RequestBody List<StuAnswerDto> answers) {
//判断是否已经做过题
StuAssessmentQuestionDetailsExample stuAssessmentQuestionDetailsExample = new StuAssessmentQuestionDetailsExample();
stuAssessmentQuestionDetailsExample.createCriteria().andUserIdEqualTo(answers.get(0).getUserId()).andModuleEqualTo(answers.get(0).getModule());
List<StuAssessmentQuestionDetails> stuAssessmentQuestionDetails111 = stuAssessmentQuestionDetailsMapper.selectByExample(stuAssessmentQuestionDetailsExample);
if (stuAssessmentQuestionDetails111.size() > 0) {
return new ResultEntity<>(HttpStatus.OK, "提交成功!");
}
//查询题目答案
StuLearningAssessmentExample example = new StuLearningAssessmentExample();
example.createCriteria().andModuleEqualTo(answers.get(0).getModule());
List<StuLearningAssessment> assessmentList = stuLearningAssessmentMapper.selectByExample(example);
// 根据Number字段进行排序
Collections.sort(assessmentList, Comparator.comparingInt(StuLearningAssessment::getTopicNumber));
//遍历所有题目答案和传参答案进行对比错误存储,
for (int i = 0; i < assessmentList.size(); i++) {
for (int j = 0; j < answers.size(); j++) {
//根据题目ID进行判断
if (assessmentList.get(i).getTopicId().equals(answers.get(j).getTopicId())) {
//题目ID相同获取两个答案进行对比
String[] questionAnswer = assessmentList.get(i).getQuestionAnswer().split(",");
String[] stuAnswer = answers.get(j).getAnswer().split(",");
Arrays.sort(questionAnswer);
Arrays.sort(stuAnswer);
boolean equals = Arrays.equals(questionAnswer, stuAnswer);
StuAssessmentQuestionDetails stuAssessmentQuestionDetails = new StuAssessmentQuestionDetails();
stuAssessmentQuestionDetails.setTopicId(answers.get(j).getTopicId());
stuAssessmentQuestionDetails.setModule(answers.get(j).getModule());
stuAssessmentQuestionDetails.setUserId(answers.get(j).getUserId());
stuAssessmentQuestionDetails.setStudentAnswer(answers.get(j).getAnswer());
stuAssessmentQuestionDetails.setDetailsId((int) IdUtil.getSnowflakeNextId());
if (!equals) {
stuAssessmentQuestionDetails.setRightOrWrong("错误");
} else {
stuAssessmentQuestionDetails.setRightOrWrong("正确");
}
stuAssessmentQuestionDetailsMapper.insertSelective(stuAssessmentQuestionDetails);
}
}
}
StuAssessmentQuestionDetailsExample example23 = new StuAssessmentQuestionDetailsExample();
example23.createCriteria().andUserIdEqualTo(answers.get(0).getUserId()).andModuleEqualTo(answers.get(0).getModule());
List<StuAssessmentQuestionDetails> stuAssessmentQuestionDetailsList = stuAssessmentQuestionDetailsMapper.selectByExample(example23);
int count = 0;
if (!stuAssessmentQuestionDetailsList.isEmpty()){
List<StuAssessmentQuestionDetails> countList = stuAssessmentQuestionDetailsList.stream().filter(item -> item.getRightOrWrong().equals("错误")).collect(Collectors.toList());
count= countList.size();
}else {
count = 0;
}
// stuDigitalIndustrializationService.practicalTrainingSubmission(answers.get(0).getUserId(),"大数据","什么是大数据",count);
return new ResultEntity<>(HttpStatus.OK, "提交成功");
}
@GetMapping("/ocrTitle")
@ApiOperation("获取文字识别OCR题目")
@AnonymousAccess
public ResultEntity ocrTitle(@RequestParam String userId, String model) {
List<StuImageRecognitionTraining> stuImageRecognitionTraining = stuFiveGTrainingService.ocrTitle(userId, model);
return new ResultEntity<>(HttpStatus.OK, stuImageRecognitionTraining);
}
@GetMapping("/ocrTitleOneSub")
@ApiOperation("文字识别OCR题目一提交")
@AnonymousAccess
public ResultEntity ocrTitleOneSub(@RequestParam String userId, @ApiParam("用户答案") String answer) {
String info = stuFiveGTrainingService.ocrTitleOneSub(userId, answer);
return new ResultEntity<>(HttpStatus.OK, info);
}
@GetMapping("/ocrTitleTwoSub")
@ApiOperation("文字识别OCR题目二提交")
@AnonymousAccess
public ResultEntity ocrTitleTwoSub(@RequestParam String userId, @ApiParam("用户答案") String answer) {
String info = stuFiveGTrainingService.ocrTitleTwoSub(userId, answer);
return new ResultEntity<>(HttpStatus.OK, info);
}
@GetMapping("/downloadImg")
@ApiOperation("文字识别下载文档")
@AnonymousAccess
// public void downloadImg(@RequestParam String userId, HttpServletResponse response) {
public void downloadImg(@RequestParam String userId, String TOKEN, HttpServletResponse response) {
TokenProvider.getJWTUser(TOKEN);
stuFiveGTrainingService.downloadImg(userId, response);
}
@PostMapping("/ocr")
@ApiOperation("文字识别")
@AnonymousAccess
public ResultEntity ocr(@RequestBody StuOcrDto info) {
if (info.getContext().isEmpty())
{
throw new ServiceException(HttpStatus.ACCEPTED,"数据为空!");
}
// info.getContext().contains()
//定义两个相比较的字符长度
int minLength = 0;
//去除空格和回车
//String stuIn = info.getContext().replaceAll("\\s", "").trim().replaceAll("\\s+", " ").replaceAll("[\\p{Punct}\\p{Zs}]", "").replaceAll("\"", "").replaceAll("[\"。]", "");
String stuIn = info.getContext().replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]+", "");
//设置正确答案
String answer = null;
if (info.getContext().contains("文章图片如下")) {
//去重字符空格和换行字符,用来格式判断
answer = Constant.CONTEXT_OCR.replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]+", "");
minLength = Math.min(stuIn.length(), answer.length());
}
else {
answer = Constant.CONTEXT_OCR_ONE.replaceAll("[^a-zA-Z0-9\\u4e00-\\u9fa5]+", "");
minLength = Math.min(stuIn.length(), answer.length());
}
// 找到第一个不同的字符的索引
for (int i = 0; i < minLength; i++) {
if (stuIn.charAt(i) != answer.charAt(i)) {
throw new InvoceTException(HttpStatus.ACCEPTED, "请输入正确的文字内容");
}
}
//判断是否做过题
StuImageRecognitionTrainingExample stuExample = new StuImageRecognitionTrainingExample();
stuExample.createCriteria().andModelEqualTo("文字识别OCR").andUserIdEqualTo(info.getUserId());
List<StuImageRecognitionTraining> stuImageRecognitionList = stuImageRecognitionTrainingMapper.selectByExample(stuExample);
if (stuImageRecognitionList.size() > 0) {
List<StuImageRecognitionTraining> collect = stuImageRecognitionList.stream().filter(item -> item.getStemContent().equals("请选择一种最优的方法先获得文章的图片。")).collect(Collectors.toList());
if (collect.size() > 0 ) {
collect.get(0).setOptionF(info.getContext());
stuImageRecognitionTrainingMapper.updateByPrimaryKeySelective(collect.get(0));
}else {
return new ResultEntity<>(HttpStatus.ACCEPTED, "请先完成步骤一");
}
}
return new ResultEntity<>(HttpStatus.OK, "提交成功");
}
// 构建词频向量
private static Map<CharSequence, Integer> buildVector(String text) {
Map<CharSequence, Integer> vector = new HashMap<>();
String[] words = text.split("\\s+"); // 使用空格分割文本成单词
for (String word : words) {
CharSequence charSeq = word; // 将单词转换成CharSequence类型
vector.put(charSeq, vector.getOrDefault(charSeq, 0) + 1); // 统计词频
}
return vector;
}
}

@ -0,0 +1,63 @@
package com.sztzjy.marketing.entity;
public class StuAssessmentQuestionDetails {
private Integer detailsId;
private String topicId;
private String studentAnswer;
private String userId;
private String rightOrWrong;
private String module;
public Integer getDetailsId() {
return detailsId;
}
public void setDetailsId(Integer detailsId) {
this.detailsId = detailsId;
}
public String getTopicId() {
return topicId;
}
public void setTopicId(String topicId) {
this.topicId = topicId == null ? null : topicId.trim();
}
public String getStudentAnswer() {
return studentAnswer;
}
public void setStudentAnswer(String studentAnswer) {
this.studentAnswer = studentAnswer == null ? null : studentAnswer.trim();
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public String getRightOrWrong() {
return rightOrWrong;
}
public void setRightOrWrong(String rightOrWrong) {
this.rightOrWrong = rightOrWrong == null ? null : rightOrWrong.trim();
}
public String getModule() {
return module;
}
public void setModule(String module) {
this.module = module == null ? null : module.trim();
}
}

@ -0,0 +1,609 @@
package com.sztzjy.marketing.entity;
import java.util.ArrayList;
import java.util.List;
public class StuAssessmentQuestionDetailsExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuAssessmentQuestionDetailsExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andDetailsIdIsNull() {
addCriterion("details_id is null");
return (Criteria) this;
}
public Criteria andDetailsIdIsNotNull() {
addCriterion("details_id is not null");
return (Criteria) this;
}
public Criteria andDetailsIdEqualTo(Integer value) {
addCriterion("details_id =", value, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdNotEqualTo(Integer value) {
addCriterion("details_id <>", value, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdGreaterThan(Integer value) {
addCriterion("details_id >", value, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdGreaterThanOrEqualTo(Integer value) {
addCriterion("details_id >=", value, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdLessThan(Integer value) {
addCriterion("details_id <", value, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdLessThanOrEqualTo(Integer value) {
addCriterion("details_id <=", value, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdIn(List<Integer> values) {
addCriterion("details_id in", values, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdNotIn(List<Integer> values) {
addCriterion("details_id not in", values, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdBetween(Integer value1, Integer value2) {
addCriterion("details_id between", value1, value2, "detailsId");
return (Criteria) this;
}
public Criteria andDetailsIdNotBetween(Integer value1, Integer value2) {
addCriterion("details_id not between", value1, value2, "detailsId");
return (Criteria) this;
}
public Criteria andTopicIdIsNull() {
addCriterion("topic_id is null");
return (Criteria) this;
}
public Criteria andTopicIdIsNotNull() {
addCriterion("topic_id is not null");
return (Criteria) this;
}
public Criteria andTopicIdEqualTo(String value) {
addCriterion("topic_id =", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdNotEqualTo(String value) {
addCriterion("topic_id <>", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdGreaterThan(String value) {
addCriterion("topic_id >", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdGreaterThanOrEqualTo(String value) {
addCriterion("topic_id >=", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdLessThan(String value) {
addCriterion("topic_id <", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdLessThanOrEqualTo(String value) {
addCriterion("topic_id <=", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdLike(String value) {
addCriterion("topic_id like", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdNotLike(String value) {
addCriterion("topic_id not like", value, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdIn(List<String> values) {
addCriterion("topic_id in", values, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdNotIn(List<String> values) {
addCriterion("topic_id not in", values, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdBetween(String value1, String value2) {
addCriterion("topic_id between", value1, value2, "topicId");
return (Criteria) this;
}
public Criteria andTopicIdNotBetween(String value1, String value2) {
addCriterion("topic_id not between", value1, value2, "topicId");
return (Criteria) this;
}
public Criteria andStudentAnswerIsNull() {
addCriterion("student_answer is null");
return (Criteria) this;
}
public Criteria andStudentAnswerIsNotNull() {
addCriterion("student_answer is not null");
return (Criteria) this;
}
public Criteria andStudentAnswerEqualTo(String value) {
addCriterion("student_answer =", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerNotEqualTo(String value) {
addCriterion("student_answer <>", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerGreaterThan(String value) {
addCriterion("student_answer >", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerGreaterThanOrEqualTo(String value) {
addCriterion("student_answer >=", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerLessThan(String value) {
addCriterion("student_answer <", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerLessThanOrEqualTo(String value) {
addCriterion("student_answer <=", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerLike(String value) {
addCriterion("student_answer like", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerNotLike(String value) {
addCriterion("student_answer not like", value, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerIn(List<String> values) {
addCriterion("student_answer in", values, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerNotIn(List<String> values) {
addCriterion("student_answer not in", values, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerBetween(String value1, String value2) {
addCriterion("student_answer between", value1, value2, "studentAnswer");
return (Criteria) this;
}
public Criteria andStudentAnswerNotBetween(String value1, String value2) {
addCriterion("student_answer not between", value1, value2, "studentAnswer");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(String value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(String value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(String value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(String value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(String value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLike(String value) {
addCriterion("user_id like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotLike(String value) {
addCriterion("user_id not like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<String> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<String> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(String value1, String value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(String value1, String value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andRightOrWrongIsNull() {
addCriterion("right_or_wrong is null");
return (Criteria) this;
}
public Criteria andRightOrWrongIsNotNull() {
addCriterion("right_or_wrong is not null");
return (Criteria) this;
}
public Criteria andRightOrWrongEqualTo(String value) {
addCriterion("right_or_wrong =", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongNotEqualTo(String value) {
addCriterion("right_or_wrong <>", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongGreaterThan(String value) {
addCriterion("right_or_wrong >", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongGreaterThanOrEqualTo(String value) {
addCriterion("right_or_wrong >=", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongLessThan(String value) {
addCriterion("right_or_wrong <", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongLessThanOrEqualTo(String value) {
addCriterion("right_or_wrong <=", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongLike(String value) {
addCriterion("right_or_wrong like", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongNotLike(String value) {
addCriterion("right_or_wrong not like", value, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongIn(List<String> values) {
addCriterion("right_or_wrong in", values, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongNotIn(List<String> values) {
addCriterion("right_or_wrong not in", values, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongBetween(String value1, String value2) {
addCriterion("right_or_wrong between", value1, value2, "rightOrWrong");
return (Criteria) this;
}
public Criteria andRightOrWrongNotBetween(String value1, String value2) {
addCriterion("right_or_wrong not between", value1, value2, "rightOrWrong");
return (Criteria) this;
}
public Criteria andModuleIsNull() {
addCriterion("module is null");
return (Criteria) this;
}
public Criteria andModuleIsNotNull() {
addCriterion("module is not null");
return (Criteria) this;
}
public Criteria andModuleEqualTo(String value) {
addCriterion("module =", value, "module");
return (Criteria) this;
}
public Criteria andModuleNotEqualTo(String value) {
addCriterion("module <>", value, "module");
return (Criteria) this;
}
public Criteria andModuleGreaterThan(String value) {
addCriterion("module >", value, "module");
return (Criteria) this;
}
public Criteria andModuleGreaterThanOrEqualTo(String value) {
addCriterion("module >=", value, "module");
return (Criteria) this;
}
public Criteria andModuleLessThan(String value) {
addCriterion("module <", value, "module");
return (Criteria) this;
}
public Criteria andModuleLessThanOrEqualTo(String value) {
addCriterion("module <=", value, "module");
return (Criteria) this;
}
public Criteria andModuleLike(String value) {
addCriterion("module like", value, "module");
return (Criteria) this;
}
public Criteria andModuleNotLike(String value) {
addCriterion("module not like", value, "module");
return (Criteria) this;
}
public Criteria andModuleIn(List<String> values) {
addCriterion("module in", values, "module");
return (Criteria) this;
}
public Criteria andModuleNotIn(List<String> values) {
addCriterion("module not in", values, "module");
return (Criteria) this;
}
public Criteria andModuleBetween(String value1, String value2) {
addCriterion("module between", value1, value2, "module");
return (Criteria) this;
}
public Criteria andModuleNotBetween(String value1, String value2) {
addCriterion("module not between", value1, value2, "module");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,215 @@
package com.sztzjy.marketing.entity;
import java.math.BigDecimal;
public class StuLearningAssessment {
private String topicId;
private String topicName;
private String topicType;
private String topicDifficultyLevel;
private BigDecimal topicScore;
private Integer topicNumber;
private String optionA;
private String optionB;
private String optionC;
private String optionD;
private String optionE;
private String optionF;
private String optionG;
private String answer;
private String studentAnswer;
private String questionAnswer;
private String module;
private Integer logic;
private Integer state;
private String reason;
private String optionImg;
public String getTopicId() {
return topicId;
}
public void setTopicId(String topicId) {
this.topicId = topicId == null ? null : topicId.trim();
}
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName == null ? null : topicName.trim();
}
public String getTopicType() {
return topicType;
}
public void setTopicType(String topicType) {
this.topicType = topicType == null ? null : topicType.trim();
}
public String getTopicDifficultyLevel() {
return topicDifficultyLevel;
}
public void setTopicDifficultyLevel(String topicDifficultyLevel) {
this.topicDifficultyLevel = topicDifficultyLevel == null ? null : topicDifficultyLevel.trim();
}
public BigDecimal getTopicScore() {
return topicScore;
}
public void setTopicScore(BigDecimal topicScore) {
this.topicScore = topicScore;
}
public Integer getTopicNumber() {
return topicNumber;
}
public void setTopicNumber(Integer topicNumber) {
this.topicNumber = topicNumber;
}
public String getOptionA() {
return optionA;
}
public void setOptionA(String optionA) {
this.optionA = optionA == null ? null : optionA.trim();
}
public String getOptionB() {
return optionB;
}
public void setOptionB(String optionB) {
this.optionB = optionB == null ? null : optionB.trim();
}
public String getOptionC() {
return optionC;
}
public void setOptionC(String optionC) {
this.optionC = optionC == null ? null : optionC.trim();
}
public String getOptionD() {
return optionD;
}
public void setOptionD(String optionD) {
this.optionD = optionD == null ? null : optionD.trim();
}
public String getOptionE() {
return optionE;
}
public void setOptionE(String optionE) {
this.optionE = optionE == null ? null : optionE.trim();
}
public String getOptionF() {
return optionF;
}
public void setOptionF(String optionF) {
this.optionF = optionF == null ? null : optionF.trim();
}
public String getOptionG() {
return optionG;
}
public void setOptionG(String optionG) {
this.optionG = optionG == null ? null : optionG.trim();
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer == null ? null : answer.trim();
}
public String getStudentAnswer() {
return studentAnswer;
}
public void setStudentAnswer(String studentAnswer) {
this.studentAnswer = studentAnswer == null ? null : studentAnswer.trim();
}
public String getQuestionAnswer() {
return questionAnswer;
}
public void setQuestionAnswer(String questionAnswer) {
this.questionAnswer = questionAnswer == null ? null : questionAnswer.trim();
}
public String getModule() {
return module;
}
public void setModule(String module) {
this.module = module == null ? null : module.trim();
}
public Integer getLogic() {
return logic;
}
public void setLogic(Integer logic) {
this.logic = logic;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason == null ? null : reason.trim();
}
public String getOptionImg() {
return optionImg;
}
public void setOptionImg(String optionImg) {
this.optionImg = optionImg == null ? null : optionImg.trim();
}
}

@ -0,0 +1,50 @@
package com.sztzjy.marketing.entity.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 17803
* @date 2023-12-25 16:53
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StuAnswerDto {
//
// [
// {
// "answer": "A,B,C,D",
// "module": "什么是大数据",
// "topicId": "1",
// "type": "多选题",
// "userId": "492"
// },
// {
// "answer": "A,B,E,G",
// "module": "什么是大数据",
// "topicId": "2",
// "type": "多选题",
// "userId": "492"
// },
// {
// "answer": "A,B,E,G",
// "module": "什么是大数据",
// "topicId": "3",
// "type": "多选题",
// "userId": "492"
// }
//]
private String topicId;
private String type;
private String answer;
private String userId;
private String module;
}

@ -0,0 +1,15 @@
package com.sztzjy.marketing.entity.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class StuOcrDto {
private String context;
private String userId;
}

@ -0,0 +1,58 @@
package com.sztzjy.marketing.entity.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author 17803
* @date 2024-03-12 14:15
*/
@Data
public class StubigDataTopicDTOS {
private String topicId;
private String topicName;
private String topicType;
private String topicDifficultyLevel;
private BigDecimal topicScore;
private Integer topicNumber;
private String optionA;
private String optionB;
private String optionC;
private String optionD;
private String optionE;
private String optionF;
private String optionG;
private String answer;
private String studentAnswer;
private String questionAnswer;
private String module;
private Integer logic;
private Integer state;
private String reason;
private String optionImg;
private String rightOrWrong;
}

@ -0,0 +1,33 @@
package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuAssessmentQuestionDetails;
import com.sztzjy.marketing.entity.StuAssessmentQuestionDetailsExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface StuAssessmentQuestionDetailsMapper {
long countByExample(StuAssessmentQuestionDetailsExample example);
int deleteByExample(StuAssessmentQuestionDetailsExample example);
int deleteByPrimaryKey(Integer detailsId);
int insert(StuAssessmentQuestionDetails record);
int insertSelective(StuAssessmentQuestionDetails record);
List<StuAssessmentQuestionDetails> selectByExample(StuAssessmentQuestionDetailsExample example);
StuAssessmentQuestionDetails selectByPrimaryKey(Integer detailsId);
int updateByExampleSelective(@Param("record") StuAssessmentQuestionDetails record, @Param("example") StuAssessmentQuestionDetailsExample example);
int updateByExample(@Param("record") StuAssessmentQuestionDetails record, @Param("example") StuAssessmentQuestionDetailsExample example);
int updateByPrimaryKeySelective(StuAssessmentQuestionDetails record);
int updateByPrimaryKey(StuAssessmentQuestionDetails record);
}

@ -0,0 +1,37 @@
package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuLearningAssessment;
import com.sztzjy.marketing.entity.StuLearningAssessmentExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface StuLearningAssessmentMapper {
long countByExample(StuLearningAssessmentExample example);
int deleteByExample(StuLearningAssessmentExample example);
int deleteByPrimaryKey(String topicId);
int insert(StuLearningAssessment record);
int insertSelective(StuLearningAssessment record);
List<StuLearningAssessment> selectByExample(StuLearningAssessmentExample example);
StuLearningAssessment selectByPrimaryKey(String topicId);
int updateByExampleSelective(@Param("record") StuLearningAssessment record, @Param("example") StuLearningAssessmentExample example);
int updateByExample(@Param("record") StuLearningAssessment record, @Param("example") StuLearningAssessmentExample example);
int updateByPrimaryKeySelective(StuLearningAssessment record);
int updateByPrimaryKey(StuLearningAssessment record);
}

@ -816,6 +816,19 @@ public class StuFiveGTrainingServiceImpl implements StuFiveGTrainingService {
}
// //自然语言处理:获取题目
// @Override
// public List<StuImageRecognitionTraining> getTitles(String userId) {

@ -0,0 +1,228 @@
<?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.sztzjy.marketing.mapper.StuAssessmentQuestionDetailsMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.marketing.entity.StuAssessmentQuestionDetails">
<id column="details_id" jdbcType="INTEGER" property="detailsId" />
<result column="topic_id" jdbcType="VARCHAR" property="topicId" />
<result column="student_answer" jdbcType="VARCHAR" property="studentAnswer" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="right_or_wrong" jdbcType="VARCHAR" property="rightOrWrong" />
<result column="module" jdbcType="VARCHAR" property="module" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
details_id, topic_id, student_answer, user_id, right_or_wrong, module
</sql>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuAssessmentQuestionDetailsExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_assessment_question_details
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_assessment_question_details
where details_id = #{detailsId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from stu_assessment_question_details
where details_id = #{detailsId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.marketing.entity.StuAssessmentQuestionDetailsExample">
delete from stu_assessment_question_details
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.marketing.entity.StuAssessmentQuestionDetails">
insert into stu_assessment_question_details (details_id, topic_id, student_answer,
user_id, right_or_wrong, module
)
values (#{detailsId,jdbcType=INTEGER}, #{topicId,jdbcType=VARCHAR}, #{studentAnswer,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{rightOrWrong,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuAssessmentQuestionDetails">
insert into stu_assessment_question_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="detailsId != null">
details_id,
</if>
<if test="topicId != null">
topic_id,
</if>
<if test="studentAnswer != null">
student_answer,
</if>
<if test="userId != null">
user_id,
</if>
<if test="rightOrWrong != null">
right_or_wrong,
</if>
<if test="module != null">
module,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="detailsId != null">
#{detailsId,jdbcType=INTEGER},
</if>
<if test="topicId != null">
#{topicId,jdbcType=VARCHAR},
</if>
<if test="studentAnswer != null">
#{studentAnswer,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="rightOrWrong != null">
#{rightOrWrong,jdbcType=VARCHAR},
</if>
<if test="module != null">
#{module,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuAssessmentQuestionDetailsExample" resultType="java.lang.Long">
select count(*) from stu_assessment_question_details
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_assessment_question_details
<set>
<if test="record.detailsId != null">
details_id = #{record.detailsId,jdbcType=INTEGER},
</if>
<if test="record.topicId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR},
</if>
<if test="record.studentAnswer != null">
student_answer = #{record.studentAnswer,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.rightOrWrong != null">
right_or_wrong = #{record.rightOrWrong,jdbcType=VARCHAR},
</if>
<if test="record.module != null">
module = #{record.module,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_assessment_question_details
set details_id = #{record.detailsId,jdbcType=INTEGER},
topic_id = #{record.topicId,jdbcType=VARCHAR},
student_answer = #{record.studentAnswer,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
right_or_wrong = #{record.rightOrWrong,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.marketing.entity.StuAssessmentQuestionDetails">
update stu_assessment_question_details
<set>
<if test="topicId != null">
topic_id = #{topicId,jdbcType=VARCHAR},
</if>
<if test="studentAnswer != null">
student_answer = #{studentAnswer,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="rightOrWrong != null">
right_or_wrong = #{rightOrWrong,jdbcType=VARCHAR},
</if>
<if test="module != null">
module = #{module,jdbcType=VARCHAR},
</if>
</set>
where details_id = #{detailsId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuAssessmentQuestionDetails">
update stu_assessment_question_details
set topic_id = #{topicId,jdbcType=VARCHAR},
student_answer = #{studentAnswer,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
right_or_wrong = #{rightOrWrong,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR}
where details_id = #{detailsId,jdbcType=INTEGER}
</update>
</mapper>

@ -0,0 +1,465 @@
<?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.sztzjy.marketing.mapper.StuLearningAssessmentMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.marketing.entity.StuLearningAssessment">
<id column="topic_id" jdbcType="VARCHAR" property="topicId" />
<result column="topic_name" jdbcType="VARCHAR" property="topicName" />
<result column="topic_type" jdbcType="VARCHAR" property="topicType" />
<result column="topic_difficulty_level" jdbcType="VARCHAR" property="topicDifficultyLevel" />
<result column="topic_score" jdbcType="DECIMAL" property="topicScore" />
<result column="topic_number" jdbcType="INTEGER" property="topicNumber" />
<result column="option_a" jdbcType="VARCHAR" property="optionA" />
<result column="option_b" jdbcType="VARCHAR" property="optionB" />
<result column="option_c" jdbcType="VARCHAR" property="optionC" />
<result column="option_d" jdbcType="VARCHAR" property="optionD" />
<result column="option_e" jdbcType="VARCHAR" property="optionE" />
<result column="option_f" jdbcType="VARCHAR" property="optionF" />
<result column="option_g" jdbcType="VARCHAR" property="optionG" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="student_answer" jdbcType="VARCHAR" property="studentAnswer" />
<result column="question_answer" jdbcType="VARCHAR" property="questionAnswer" />
<result column="module" jdbcType="VARCHAR" property="module" />
<result column="logic" jdbcType="INTEGER" property="logic" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="option_img" jdbcType="VARCHAR" property="optionImg" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
topic_id, topic_name, topic_type, topic_difficulty_level, topic_score, topic_number,
option_a, option_b, option_c, option_d, option_e, option_f, option_g, answer, student_answer,
question_answer, module, logic, state, reason, option_img
</sql>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuLearningAssessmentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_learning_assessment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_learning_assessment
where topic_id = #{topicId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_learning_assessment
where topic_id = #{topicId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.marketing.entity.StuLearningAssessmentExample">
delete from stu_learning_assessment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.marketing.entity.StuLearningAssessment">
insert into stu_learning_assessment (topic_id, topic_name, topic_type,
topic_difficulty_level, topic_score, topic_number,
option_a, option_b, option_c,
option_d, option_e, option_f,
option_g, answer, student_answer,
question_answer, module, logic,
state, reason, option_img
)
values (#{topicId,jdbcType=VARCHAR}, #{topicName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR},
#{topicDifficultyLevel,jdbcType=VARCHAR}, #{topicScore,jdbcType=DECIMAL}, #{topicNumber,jdbcType=INTEGER},
#{optionA,jdbcType=VARCHAR}, #{optionB,jdbcType=VARCHAR}, #{optionC,jdbcType=VARCHAR},
#{optionD,jdbcType=VARCHAR}, #{optionE,jdbcType=VARCHAR}, #{optionF,jdbcType=VARCHAR},
#{optionG,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR}, #{studentAnswer,jdbcType=VARCHAR},
#{questionAnswer,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, #{logic,jdbcType=INTEGER},
#{state,jdbcType=INTEGER}, #{reason,jdbcType=VARCHAR}, #{optionImg,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuLearningAssessment">
insert into stu_learning_assessment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="topicId != null">
topic_id,
</if>
<if test="topicName != null">
topic_name,
</if>
<if test="topicType != null">
topic_type,
</if>
<if test="topicDifficultyLevel != null">
topic_difficulty_level,
</if>
<if test="topicScore != null">
topic_score,
</if>
<if test="topicNumber != null">
topic_number,
</if>
<if test="optionA != null">
option_a,
</if>
<if test="optionB != null">
option_b,
</if>
<if test="optionC != null">
option_c,
</if>
<if test="optionD != null">
option_d,
</if>
<if test="optionE != null">
option_e,
</if>
<if test="optionF != null">
option_f,
</if>
<if test="optionG != null">
option_g,
</if>
<if test="answer != null">
answer,
</if>
<if test="studentAnswer != null">
student_answer,
</if>
<if test="questionAnswer != null">
question_answer,
</if>
<if test="module != null">
module,
</if>
<if test="logic != null">
logic,
</if>
<if test="state != null">
state,
</if>
<if test="reason != null">
reason,
</if>
<if test="optionImg != null">
option_img,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="topicId != null">
#{topicId,jdbcType=VARCHAR},
</if>
<if test="topicName != null">
#{topicName,jdbcType=VARCHAR},
</if>
<if test="topicType != null">
#{topicType,jdbcType=VARCHAR},
</if>
<if test="topicDifficultyLevel != null">
#{topicDifficultyLevel,jdbcType=VARCHAR},
</if>
<if test="topicScore != null">
#{topicScore,jdbcType=DECIMAL},
</if>
<if test="topicNumber != null">
#{topicNumber,jdbcType=INTEGER},
</if>
<if test="optionA != null">
#{optionA,jdbcType=VARCHAR},
</if>
<if test="optionB != null">
#{optionB,jdbcType=VARCHAR},
</if>
<if test="optionC != null">
#{optionC,jdbcType=VARCHAR},
</if>
<if test="optionD != null">
#{optionD,jdbcType=VARCHAR},
</if>
<if test="optionE != null">
#{optionE,jdbcType=VARCHAR},
</if>
<if test="optionF != null">
#{optionF,jdbcType=VARCHAR},
</if>
<if test="optionG != null">
#{optionG,jdbcType=VARCHAR},
</if>
<if test="answer != null">
#{answer,jdbcType=VARCHAR},
</if>
<if test="studentAnswer != null">
#{studentAnswer,jdbcType=VARCHAR},
</if>
<if test="questionAnswer != null">
#{questionAnswer,jdbcType=VARCHAR},
</if>
<if test="module != null">
#{module,jdbcType=VARCHAR},
</if>
<if test="logic != null">
#{logic,jdbcType=INTEGER},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
<if test="optionImg != null">
#{optionImg,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuLearningAssessmentExample" resultType="java.lang.Long">
select count(*) from stu_learning_assessment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_learning_assessment
<set>
<if test="record.topicId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR},
</if>
<if test="record.topicName != null">
topic_name = #{record.topicName,jdbcType=VARCHAR},
</if>
<if test="record.topicType != null">
topic_type = #{record.topicType,jdbcType=VARCHAR},
</if>
<if test="record.topicDifficultyLevel != null">
topic_difficulty_level = #{record.topicDifficultyLevel,jdbcType=VARCHAR},
</if>
<if test="record.topicScore != null">
topic_score = #{record.topicScore,jdbcType=DECIMAL},
</if>
<if test="record.topicNumber != null">
topic_number = #{record.topicNumber,jdbcType=INTEGER},
</if>
<if test="record.optionA != null">
option_a = #{record.optionA,jdbcType=VARCHAR},
</if>
<if test="record.optionB != null">
option_b = #{record.optionB,jdbcType=VARCHAR},
</if>
<if test="record.optionC != null">
option_c = #{record.optionC,jdbcType=VARCHAR},
</if>
<if test="record.optionD != null">
option_d = #{record.optionD,jdbcType=VARCHAR},
</if>
<if test="record.optionE != null">
option_e = #{record.optionE,jdbcType=VARCHAR},
</if>
<if test="record.optionF != null">
option_f = #{record.optionF,jdbcType=VARCHAR},
</if>
<if test="record.optionG != null">
option_g = #{record.optionG,jdbcType=VARCHAR},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=VARCHAR},
</if>
<if test="record.studentAnswer != null">
student_answer = #{record.studentAnswer,jdbcType=VARCHAR},
</if>
<if test="record.questionAnswer != null">
question_answer = #{record.questionAnswer,jdbcType=VARCHAR},
</if>
<if test="record.module != null">
module = #{record.module,jdbcType=VARCHAR},
</if>
<if test="record.logic != null">
logic = #{record.logic,jdbcType=INTEGER},
</if>
<if test="record.state != null">
state = #{record.state,jdbcType=INTEGER},
</if>
<if test="record.reason != null">
reason = #{record.reason,jdbcType=VARCHAR},
</if>
<if test="record.optionImg != null">
option_img = #{record.optionImg,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_learning_assessment
set topic_id = #{record.topicId,jdbcType=VARCHAR},
topic_name = #{record.topicName,jdbcType=VARCHAR},
topic_type = #{record.topicType,jdbcType=VARCHAR},
topic_difficulty_level = #{record.topicDifficultyLevel,jdbcType=VARCHAR},
topic_score = #{record.topicScore,jdbcType=DECIMAL},
topic_number = #{record.topicNumber,jdbcType=INTEGER},
option_a = #{record.optionA,jdbcType=VARCHAR},
option_b = #{record.optionB,jdbcType=VARCHAR},
option_c = #{record.optionC,jdbcType=VARCHAR},
option_d = #{record.optionD,jdbcType=VARCHAR},
option_e = #{record.optionE,jdbcType=VARCHAR},
option_f = #{record.optionF,jdbcType=VARCHAR},
option_g = #{record.optionG,jdbcType=VARCHAR},
answer = #{record.answer,jdbcType=VARCHAR},
student_answer = #{record.studentAnswer,jdbcType=VARCHAR},
question_answer = #{record.questionAnswer,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
logic = #{record.logic,jdbcType=INTEGER},
state = #{record.state,jdbcType=INTEGER},
reason = #{record.reason,jdbcType=VARCHAR},
option_img = #{record.optionImg,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.marketing.entity.StuLearningAssessment">
update stu_learning_assessment
<set>
<if test="topicName != null">
topic_name = #{topicName,jdbcType=VARCHAR},
</if>
<if test="topicType != null">
topic_type = #{topicType,jdbcType=VARCHAR},
</if>
<if test="topicDifficultyLevel != null">
topic_difficulty_level = #{topicDifficultyLevel,jdbcType=VARCHAR},
</if>
<if test="topicScore != null">
topic_score = #{topicScore,jdbcType=DECIMAL},
</if>
<if test="topicNumber != null">
topic_number = #{topicNumber,jdbcType=INTEGER},
</if>
<if test="optionA != null">
option_a = #{optionA,jdbcType=VARCHAR},
</if>
<if test="optionB != null">
option_b = #{optionB,jdbcType=VARCHAR},
</if>
<if test="optionC != null">
option_c = #{optionC,jdbcType=VARCHAR},
</if>
<if test="optionD != null">
option_d = #{optionD,jdbcType=VARCHAR},
</if>
<if test="optionE != null">
option_e = #{optionE,jdbcType=VARCHAR},
</if>
<if test="optionF != null">
option_f = #{optionF,jdbcType=VARCHAR},
</if>
<if test="optionG != null">
option_g = #{optionG,jdbcType=VARCHAR},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="studentAnswer != null">
student_answer = #{studentAnswer,jdbcType=VARCHAR},
</if>
<if test="questionAnswer != null">
question_answer = #{questionAnswer,jdbcType=VARCHAR},
</if>
<if test="module != null">
module = #{module,jdbcType=VARCHAR},
</if>
<if test="logic != null">
logic = #{logic,jdbcType=INTEGER},
</if>
<if test="state != null">
state = #{state,jdbcType=INTEGER},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="optionImg != null">
option_img = #{optionImg,jdbcType=VARCHAR},
</if>
</set>
where topic_id = #{topicId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuLearningAssessment">
update stu_learning_assessment
set topic_name = #{topicName,jdbcType=VARCHAR},
topic_type = #{topicType,jdbcType=VARCHAR},
topic_difficulty_level = #{topicDifficultyLevel,jdbcType=VARCHAR},
topic_score = #{topicScore,jdbcType=DECIMAL},
topic_number = #{topicNumber,jdbcType=INTEGER},
option_a = #{optionA,jdbcType=VARCHAR},
option_b = #{optionB,jdbcType=VARCHAR},
option_c = #{optionC,jdbcType=VARCHAR},
option_d = #{optionD,jdbcType=VARCHAR},
option_e = #{optionE,jdbcType=VARCHAR},
option_f = #{optionF,jdbcType=VARCHAR},
option_g = #{optionG,jdbcType=VARCHAR},
answer = #{answer,jdbcType=VARCHAR},
student_answer = #{studentAnswer,jdbcType=VARCHAR},
question_answer = #{questionAnswer,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
logic = #{logic,jdbcType=INTEGER},
state = #{state,jdbcType=INTEGER},
reason = #{reason,jdbcType=VARCHAR},
option_img = #{optionImg,jdbcType=VARCHAR}
where topic_id = #{topicId,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save