学习成绩模块权重设置
parent
36af9b101f
commit
6ec9efafa3
@ -0,0 +1,55 @@
|
||||
package com.sztzjy.trade.controller.stu;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sztzjy.trade.annotation.AnonymousAccess;
|
||||
import com.sztzjy.trade.entity.StuAssessmentQuestionDetailsDTO;
|
||||
import com.sztzjy.trade.entity.StuScoreDetails;
|
||||
import com.sztzjy.trade.entity.dto.StuLearningAssessmentScoreDTO;
|
||||
import com.sztzjy.trade.service.StuCommonModuleService;
|
||||
import com.sztzjy.trade.util.ResultDataEntity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/12/17 17:22
|
||||
*/
|
||||
@RequestMapping("api/stu/commonModule")
|
||||
@RestController
|
||||
@Api(tags = "公共模块")
|
||||
public class StuCommonModuleController {
|
||||
@Resource
|
||||
StuCommonModuleService stuCommonModuleService;
|
||||
|
||||
|
||||
|
||||
@PostMapping("/hashLearningAssessmentScore")
|
||||
// @AnonymousAccess
|
||||
@ApiOperation("哈希函数学习测评计分")
|
||||
public ResultDataEntity<StuScoreDetails> hashLearningAssessmentScore(@RequestBody JSONObject jsonObject){
|
||||
StuLearningAssessmentScoreDTO stuLearningAssessmentScoreDTO = jsonObject.getObject("stuLearningAssessmentScoreDTO", StuLearningAssessmentScoreDTO.class);
|
||||
stuCommonModuleService.hashLearningAssessmentScore(stuLearningAssessmentScoreDTO);
|
||||
return new ResultDataEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getLearningAssessment")
|
||||
@AnonymousAccess
|
||||
@ApiOperation("学习测评查看")
|
||||
public ResultDataEntity<List<StuAssessmentQuestionDetailsDTO>> getLearningAssessment(@ApiParam("归属模块") String module, @ApiParam("用户ID") String userId) {
|
||||
if (module.isEmpty()) {
|
||||
return new ResultDataEntity<>(HttpStatus.NO_CONTENT, "参数为空");
|
||||
}
|
||||
List<StuAssessmentQuestionDetailsDTO> list = stuCommonModuleService.getLearningAssessment(module,userId);
|
||||
return new ResultDataEntity<>(HttpStatus.OK, list);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
/**
|
||||
*
|
||||
* @author whb
|
||||
* stu_assessment_question_details
|
||||
*/
|
||||
public class StuAssessmentQuestionDetails {
|
||||
@ApiModelProperty(notes = "详情ID")
|
||||
private Integer detailsId;
|
||||
|
||||
@ApiModelProperty(notes = "题目ID")
|
||||
private String topicId;
|
||||
|
||||
@ApiModelProperty(notes = "学生选择答案")
|
||||
private String studentAnswer;
|
||||
|
||||
@ApiModelProperty(notes = "学生ID")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(notes = "是否正确")
|
||||
private String rightOrWrong;
|
||||
|
||||
@ApiModelProperty(notes = "归属模块")
|
||||
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,54 @@
|
||||
package com.sztzjy.trade.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2023/10/26 10:46
|
||||
*/
|
||||
@Data
|
||||
public class StuAssessmentQuestionDetailsDTO {
|
||||
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 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,609 @@
|
||||
package com.sztzjy.trade.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,52 @@
|
||||
package com.sztzjy.trade.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2023/9/4 11:52
|
||||
*/
|
||||
@Data
|
||||
public class StuLearningAssessmentDTO {
|
||||
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 answer;
|
||||
|
||||
private String[] studentAnswer;
|
||||
|
||||
private String questionAnswer;
|
||||
|
||||
private String module;
|
||||
|
||||
private Integer logic;
|
||||
|
||||
private Integer state;
|
||||
|
||||
private String reason;
|
||||
|
||||
private String optionImg;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.sztzjy.trade.entity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2023/9/4 14:50
|
||||
*/
|
||||
@Data
|
||||
public class StuLearningAssessmentScoreDTO {
|
||||
private String module;
|
||||
private String userId;
|
||||
private String learningProjects;
|
||||
private String assessmentItems;
|
||||
private List<StuLearningAssessmentDTO> stuLearningAssessmentDTOS;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.sztzjy.trade.mapper;
|
||||
|
||||
import com.sztzjy.trade.entity.StuAssessmentQuestionDetails;
|
||||
import com.sztzjy.trade.entity.StuAssessmentQuestionDetailsExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
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,17 @@
|
||||
package com.sztzjy.trade.service;
|
||||
|
||||
import com.sztzjy.trade.entity.StuAssessmentQuestionDetailsDTO;
|
||||
import com.sztzjy.trade.entity.dto.StuLearningAssessmentScoreDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/12/17 17:24
|
||||
*/
|
||||
public interface StuCommonModuleService {
|
||||
|
||||
List<StuAssessmentQuestionDetailsDTO> getLearningAssessment(String module, String userId);
|
||||
|
||||
void hashLearningAssessmentScore(StuLearningAssessmentScoreDTO stuLearningAssessmentScoreDTO);
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
package com.sztzjy.trade.service.impl;
|
||||
|
||||
import com.sztzjy.trade.config.exception.handler.ServiceException;
|
||||
import com.sztzjy.trade.entity.*;
|
||||
import com.sztzjy.trade.entity.dto.StuLearningAssessmentDTO;
|
||||
import com.sztzjy.trade.entity.dto.StuLearningAssessmentScoreDTO;
|
||||
import com.sztzjy.trade.mapper.*;
|
||||
import com.sztzjy.trade.service.StuCommonModuleService;
|
||||
import com.sztzjy.trade.util.ConvertUtil;
|
||||
import com.sztzjy.trade.util.compute.ScoringUtil;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author tz
|
||||
* @date 2024/12/17 17:24
|
||||
*/
|
||||
@Service
|
||||
public class StuCommonModuleServiceImpl implements StuCommonModuleService {
|
||||
|
||||
@Resource
|
||||
StuAssessmentQuestionDetailsMapper stuAssessmentQuestionDetailsMapper;
|
||||
@Resource
|
||||
StuLearningAssessmentMapper stuLearningAssessmentMapper;
|
||||
@Resource
|
||||
ConvertUtil convertUtil;
|
||||
@Resource
|
||||
StuUserMapper stuUserMapper;
|
||||
@Resource
|
||||
TchDigitalTradeWeightMapper digitalTradeWeightMapper;
|
||||
@Resource
|
||||
ScoringUtil scoringUtil;
|
||||
@Resource
|
||||
StuScoreDetailsMapper stuScoreDetailsMapper;
|
||||
|
||||
/**
|
||||
* 学习测评查看
|
||||
*
|
||||
* @param module 所属模块
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<StuAssessmentQuestionDetailsDTO> getLearningAssessment(String module, String userId) {
|
||||
StuAssessmentQuestionDetailsExample detailsExample=new StuAssessmentQuestionDetailsExample();
|
||||
detailsExample.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module);
|
||||
List<StuAssessmentQuestionDetails> stuAssessmentQuestionDetails = stuAssessmentQuestionDetailsMapper.selectByExample(detailsExample);
|
||||
|
||||
StuLearningAssessmentExample example = new StuLearningAssessmentExample();
|
||||
StuLearningAssessmentExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andAttributionChapterEqualTo(module).andLogicEqualTo(1);
|
||||
List<StuLearningAssessment> stuLearningAssessments = stuLearningAssessmentMapper.selectByExample(example);
|
||||
List<StuAssessmentQuestionDetailsDTO> stuAssessmentQuestionDetailsDTOS = convertUtil.entityToDTOList(stuLearningAssessments, StuAssessmentQuestionDetailsDTO.class);
|
||||
if(stuAssessmentQuestionDetails.size()!=0){
|
||||
for (int i = 0; i < stuAssessmentQuestionDetails.size(); i++) {
|
||||
for (int j = 0; j < stuAssessmentQuestionDetailsDTOS.size(); j++) {
|
||||
if(stuAssessmentQuestionDetails.get(i).getTopicId().equals(stuLearningAssessments.get(j).getTopicId())){
|
||||
String rightOrWrong = stuAssessmentQuestionDetails.get(i).getRightOrWrong();
|
||||
String studentAnswer = stuAssessmentQuestionDetails.get(i).getStudentAnswer();
|
||||
stuAssessmentQuestionDetailsDTOS.get(j).setRightOrWrong(rightOrWrong);
|
||||
stuAssessmentQuestionDetailsDTOS.get(j).setStudentAnswer(studentAnswer);
|
||||
}
|
||||
}
|
||||
}
|
||||
return stuAssessmentQuestionDetailsDTOS;
|
||||
}
|
||||
for (int i = 0; i < stuAssessmentQuestionDetailsDTOS.size(); i++) {
|
||||
stuAssessmentQuestionDetailsDTOS.get(i).setAnswer(null);
|
||||
}
|
||||
return stuAssessmentQuestionDetailsDTOS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 学习测评计分
|
||||
*
|
||||
* @param stuLearningAssessmentScoreDTO 学习测评DTO
|
||||
*/
|
||||
@Override
|
||||
public void hashLearningAssessmentScore(StuLearningAssessmentScoreDTO stuLearningAssessmentScoreDTO) {
|
||||
StuAssessmentQuestionDetailsExample detailsExample = new StuAssessmentQuestionDetailsExample();
|
||||
detailsExample.createCriteria().andUserIdEqualTo(stuLearningAssessmentScoreDTO.getUserId()).andModuleEqualTo(stuLearningAssessmentScoreDTO.getModule());
|
||||
List<StuAssessmentQuestionDetails> stuAssessmentQuestionDetails = stuAssessmentQuestionDetailsMapper.selectByExample(detailsExample);
|
||||
if (stuAssessmentQuestionDetails.size() != 0) {
|
||||
StuLearningAssessmentExample example1 = new StuLearningAssessmentExample();
|
||||
StuLearningAssessmentExample.Criteria criteria1 = example1.createCriteria();
|
||||
criteria1.andAttributionChapterEqualTo(stuLearningAssessmentScoreDTO.getModule());
|
||||
List<StuLearningAssessment> stuLearningAssessments = stuLearningAssessmentMapper.selectByExample(example1);
|
||||
|
||||
List<StuLearningAssessmentDTO> stuLearningAssessmentDTOS = stuLearningAssessmentScoreDTO.getStuLearningAssessmentDTOS();
|
||||
for (int i = 0; i < stuLearningAssessmentDTOS.size(); i++) {
|
||||
for (int j = 0; j < stuLearningAssessments.size(); j++) {
|
||||
if (stuLearningAssessmentDTOS.get(i).getTopicId().equals(stuLearningAssessments.get(j).getTopicId())) {
|
||||
String[] studentAnswer = stuLearningAssessmentDTOS.get(i).getStudentAnswer();
|
||||
String saw = "";
|
||||
for (int k = 0; k < studentAnswer.length; k++) {
|
||||
if (studentAnswer.length - 1 == k) {
|
||||
saw += studentAnswer[k];
|
||||
} else {
|
||||
saw += studentAnswer[k] + ",";
|
||||
}
|
||||
}
|
||||
String string = stuLearningAssessments.get(j).getAnswer();
|
||||
for (int k = 0; k < stuAssessmentQuestionDetails.size(); k++) {
|
||||
if (stuAssessmentQuestionDetails.get(k).getTopicId().equals(stuLearningAssessmentDTOS.get(i).getTopicId())) {
|
||||
StuAssessmentQuestionDetails assessmentQuestionDetails = stuAssessmentQuestionDetails.get(k);
|
||||
assessmentQuestionDetails.setStudentAnswer(saw);
|
||||
assessmentQuestionDetails.setUserId(stuLearningAssessmentScoreDTO.getUserId());
|
||||
if (saw.equals(string)) {
|
||||
assessmentQuestionDetails.setRightOrWrong("正确");
|
||||
} else {
|
||||
assessmentQuestionDetails.setRightOrWrong("错误");
|
||||
}
|
||||
stuAssessmentQuestionDetailsMapper.updateByPrimaryKey(assessmentQuestionDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
StuUserExample stuUserExample = new StuUserExample();
|
||||
stuUserExample.createCriteria().andUserIdEqualTo(stuLearningAssessmentScoreDTO.getUserId());
|
||||
List<StuUser> stuUsers = stuUserMapper.selectByExample(stuUserExample);
|
||||
StuUser stuUser = stuUsers.get(0);
|
||||
|
||||
TchDigitalTradeWeight tchDigitalTradeWeight = digitalTradeWeightMapper.selectByPrimaryKey(stuUser.getSchoolId());
|
||||
if(tchDigitalTradeWeight==null){
|
||||
TchDigitalTradeWeight tchDigitalTradeWeight1=new TchDigitalTradeWeight(stuUser.getSchoolId());
|
||||
tchDigitalTradeWeight=tchDigitalTradeWeight1;
|
||||
}
|
||||
|
||||
BigDecimal learningAssessmentScore = tchDigitalTradeWeight.getScoringCriteriaForStudyEvaluation();
|
||||
|
||||
StuLearningAssessmentExample example1 = new StuLearningAssessmentExample();
|
||||
StuLearningAssessmentExample.Criteria criteria1 = example1.createCriteria();
|
||||
criteria1.andAttributionChapterEqualTo(stuLearningAssessmentScoreDTO.getModule());
|
||||
List<StuLearningAssessment> stuLearningAssessments = stuLearningAssessmentMapper.selectByExample(example1);
|
||||
|
||||
List<StuLearningAssessmentDTO> stuLearningAssessmentDTOS = stuLearningAssessmentScoreDTO.getStuLearningAssessmentDTOS();
|
||||
int count = 0;
|
||||
for (int i = 0; i < stuLearningAssessmentDTOS.size(); i++) {
|
||||
for (int j = 0; j < stuLearningAssessments.size(); j++) {
|
||||
if (stuLearningAssessmentDTOS.get(i).getTopicId().equals(stuLearningAssessments.get(j).getTopicId())) {
|
||||
String[] studentAnswer = stuLearningAssessmentDTOS.get(i).getStudentAnswer();
|
||||
String saw = "";
|
||||
for (int k = 0; k < studentAnswer.length; k++) {
|
||||
if (studentAnswer.length - 1 == k) {
|
||||
saw += studentAnswer[k];
|
||||
} else {
|
||||
saw += studentAnswer[k] + ",";
|
||||
}
|
||||
}
|
||||
String string = stuLearningAssessments.get(j).getAnswer();
|
||||
StuAssessmentQuestionDetails details = new StuAssessmentQuestionDetails();
|
||||
int uuid = UUID.randomUUID().hashCode();
|
||||
if (uuid < 0) {
|
||||
uuid = -uuid;
|
||||
}
|
||||
details.setDetailsId(uuid);
|
||||
details.setStudentAnswer(saw);
|
||||
details.setTopicId(stuLearningAssessmentDTOS.get(i).getTopicId());
|
||||
details.setUserId(stuLearningAssessmentScoreDTO.getUserId());
|
||||
details.setModule(stuLearningAssessmentScoreDTO.getModule());
|
||||
if (saw.equals(string)) {
|
||||
details.setRightOrWrong("正确");
|
||||
} else {
|
||||
details.setRightOrWrong("错误");
|
||||
count++;
|
||||
}
|
||||
stuAssessmentQuestionDetailsMapper.insert(details);
|
||||
}
|
||||
}
|
||||
}
|
||||
double stuLearningAssessmentScoring = scoringUtil.getStuLearningAssessmentScoring(count, Double.parseDouble(String.valueOf(learningAssessmentScore)));
|
||||
StuScoreDetails stuScoreDetails = convertUtil.DTOToEntity(stuLearningAssessmentScoreDTO, StuScoreDetails.class);
|
||||
stuScoreDetails.setScoreProject(stuLearningAssessmentScoring);
|
||||
stuScoreDetails.setScoringCriteria(String.valueOf(learningAssessmentScore));
|
||||
stuScoreDetails.setScoreWeight(Double.parseDouble(String.valueOf(tchDigitalTradeWeight.getWeightStudyEvaluation())));
|
||||
stuScoreDetails.setSerialNumber(3);
|
||||
stuScoreDetails.setSchedule(1.0);
|
||||
stuScoreDetails.setCompletionStatus(String.valueOf(count));
|
||||
|
||||
|
||||
StuScoreDetailsExample stuScoreDetailsExample = new StuScoreDetailsExample();
|
||||
stuScoreDetailsExample.createCriteria().andUserIdEqualTo(stuLearningAssessmentScoreDTO.getUserId()).
|
||||
andModuleEqualTo(stuLearningAssessmentScoreDTO.getModule()).
|
||||
andLearningProjectsEqualTo(stuLearningAssessmentScoreDTO.getLearningProjects());
|
||||
List<StuScoreDetails> scoreDetailsList = stuScoreDetailsMapper.selectByExample(stuScoreDetailsExample);
|
||||
|
||||
if (scoreDetailsList.size() != 0) {
|
||||
throw new ServiceException(HttpStatus.SEE_OTHER, "已完成过答题");
|
||||
} else {
|
||||
stuScoreDetails.setId(UUID.randomUUID().toString());
|
||||
stuScoreDetailsMapper.insert(stuScoreDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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.trade.mapper.StuAssessmentQuestionDetailsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.trade.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.trade.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.trade.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.trade.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.trade.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.trade.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.trade.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.trade.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>
|
Loading…
Reference in New Issue