新增考试案例题查询接口、实训案例记录等

newBigdata
yz 11 months ago
parent c89bd59bd3
commit b27c25847d

@ -33,6 +33,4 @@ public class Constant {
public static final String THEORY = "理论考试模块";
public static final String RESOURCE = "资源中心模块";
private String aaa="aaa";
private String aadadwada="cccaaa";
}

@ -4,12 +4,12 @@ package com.sztzjy.financial_bigdata.controller.stu;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.entity.StuTheoryExam;
import com.sztzjy.financial_bigdata.entity.StuTheoryRecord;
import com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion;
import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryExamDetailDto;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryTestDto;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryTestRecordDto;
import com.sztzjy.financial_bigdata.mapper.StuTheoryRecordMapper;
import com.sztzjy.financial_bigdata.mapper.StuUserMapper;
import com.sztzjy.financial_bigdata.service.stu.ITheoryTestService;
import com.sztzjy.financial_bigdata.util.ResultEntity;
import io.swagger.annotations.Api;
@ -30,6 +30,8 @@ public class TheoryTestController {
ITheoryTestService theoryTestService;
@Autowired
StuTheoryRecordMapper recordMapper;
@Autowired
StuUserMapper userMapper;
//开始考试 选择 35道单选每题2分5道多选每题4分10道判断每题1分
@GetMapping("startTheoryTest")
@ -124,9 +126,31 @@ public class TheoryTestController {
@GetMapping("getTheoryRecord")
@ApiOperation("获取理论考试记录数据")
@AnonymousAccess
public ResultEntity<StuTheoryRecord> getTheoryRecord(String userId){
public ResultEntity<StuTheoryTestRecordDto> getTheoryRecord(String userId){
StuUser stuUser = userMapper.selectByPrimaryKey(userId);
String schoolId = stuUser.getSchoolId();
//查询该学校下的所有平均分 按高低排序
StuTheoryRecordExample example = new StuTheoryRecordExample();
example.createCriteria().andSchoolIdEqualTo(schoolId);
example.setOrderByClause("average_score desc");
List<StuTheoryRecord> stuTheoryRecords = recordMapper.selectByExample(example);
Integer paiming=null;
if(stuTheoryRecords==null){
return null;
}else {
for (int i = 0; i < stuTheoryRecords.size(); i++) {
if(stuTheoryRecords.get(i).getUserId().equals(userId)){
paiming= i+1;
}
}
}
StuTheoryRecord stuTheoryRecord = recordMapper.selectByPrimaryKey(userId);
return new ResultEntity<>(HttpStatus.OK, "获取理论考试记录数据成功",stuTheoryRecord);
StuTheoryTestRecordDto stuTheoryRecordDto = new StuTheoryTestRecordDto();
stuTheoryRecordDto.setExamCount(stuTheoryRecord.getExamCount());
stuTheoryRecordDto.setAverageScore(stuTheoryRecord.getAverageScore());
stuTheoryRecordDto.setRank(paiming);
return new ResultEntity<>(HttpStatus.OK, "获取理论考试记录数据成功",stuTheoryRecordDto);
}
}

@ -0,0 +1,64 @@
package com.sztzjy.financial_bigdata.entity;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author xcj
* stu_training_step_record
*/
public class StuTrainingStepRecord {
@ApiModelProperty("学生实训 案例题步骤记录id")
private String recordId;
@ApiModelProperty("用户id")
private String userId;
@ApiModelProperty("案例题id")
private String caseId;
@ApiModelProperty("案例题步骤id")
private String caseStepId;
@ApiModelProperty("学生答案")
private String stuAnswer;
public String getRecordId() {
return recordId;
}
public void setRecordId(String recordId) {
this.recordId = recordId == null ? null : recordId.trim();
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId == null ? null : caseId.trim();
}
public String getCaseStepId() {
return caseStepId;
}
public void setCaseStepId(String caseStepId) {
this.caseStepId = caseStepId == null ? null : caseStepId.trim();
}
public String getStuAnswer() {
return stuAnswer;
}
public void setStuAnswer(String stuAnswer) {
this.stuAnswer = stuAnswer == null ? null : stuAnswer.trim();
}
}

@ -0,0 +1,479 @@
package com.sztzjy.financial_bigdata.entity;
import java.util.ArrayList;
import java.util.List;
public class StuTrainingStepRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuTrainingStepRecordExample() {
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 andRecordIdIsNull() {
addCriterion("record_id is null");
return (Criteria) this;
}
public Criteria andRecordIdIsNotNull() {
addCriterion("record_id is not null");
return (Criteria) this;
}
public Criteria andRecordIdEqualTo(String value) {
addCriterion("record_id =", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotEqualTo(String value) {
addCriterion("record_id <>", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdGreaterThan(String value) {
addCriterion("record_id >", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdGreaterThanOrEqualTo(String value) {
addCriterion("record_id >=", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLessThan(String value) {
addCriterion("record_id <", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLessThanOrEqualTo(String value) {
addCriterion("record_id <=", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLike(String value) {
addCriterion("record_id like", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotLike(String value) {
addCriterion("record_id not like", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdIn(List<String> values) {
addCriterion("record_id in", values, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotIn(List<String> values) {
addCriterion("record_id not in", values, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdBetween(String value1, String value2) {
addCriterion("record_id between", value1, value2, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotBetween(String value1, String value2) {
addCriterion("record_id not between", value1, value2, "recordId");
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 andCaseIdIsNull() {
addCriterion("case_id is null");
return (Criteria) this;
}
public Criteria andCaseIdIsNotNull() {
addCriterion("case_id is not null");
return (Criteria) this;
}
public Criteria andCaseIdEqualTo(String value) {
addCriterion("case_id =", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdNotEqualTo(String value) {
addCriterion("case_id <>", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdGreaterThan(String value) {
addCriterion("case_id >", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdGreaterThanOrEqualTo(String value) {
addCriterion("case_id >=", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdLessThan(String value) {
addCriterion("case_id <", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdLessThanOrEqualTo(String value) {
addCriterion("case_id <=", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdLike(String value) {
addCriterion("case_id like", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdNotLike(String value) {
addCriterion("case_id not like", value, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdIn(List<String> values) {
addCriterion("case_id in", values, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdNotIn(List<String> values) {
addCriterion("case_id not in", values, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdBetween(String value1, String value2) {
addCriterion("case_id between", value1, value2, "caseId");
return (Criteria) this;
}
public Criteria andCaseIdNotBetween(String value1, String value2) {
addCriterion("case_id not between", value1, value2, "caseId");
return (Criteria) this;
}
public Criteria andCaseStepIdIsNull() {
addCriterion("case_step_id is null");
return (Criteria) this;
}
public Criteria andCaseStepIdIsNotNull() {
addCriterion("case_step_id is not null");
return (Criteria) this;
}
public Criteria andCaseStepIdEqualTo(String value) {
addCriterion("case_step_id =", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdNotEqualTo(String value) {
addCriterion("case_step_id <>", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdGreaterThan(String value) {
addCriterion("case_step_id >", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdGreaterThanOrEqualTo(String value) {
addCriterion("case_step_id >=", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdLessThan(String value) {
addCriterion("case_step_id <", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdLessThanOrEqualTo(String value) {
addCriterion("case_step_id <=", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdLike(String value) {
addCriterion("case_step_id like", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdNotLike(String value) {
addCriterion("case_step_id not like", value, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdIn(List<String> values) {
addCriterion("case_step_id in", values, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdNotIn(List<String> values) {
addCriterion("case_step_id not in", values, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdBetween(String value1, String value2) {
addCriterion("case_step_id between", value1, value2, "caseStepId");
return (Criteria) this;
}
public Criteria andCaseStepIdNotBetween(String value1, String value2) {
addCriterion("case_step_id not between", value1, value2, "caseStepId");
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,26 @@
package com.sztzjy.financial_bigdata.entity.stu_dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
public class StuCommitCaseDto {
@ApiModelProperty("用户id")
private String userId;
@ApiModelProperty("学生实训id")
private String stuTrainingId;
@ApiModelProperty("案例题id")
private String caseId;
@ApiModelProperty("案例题步骤id")
private String caseStepId;
@ApiModelProperty("学生答案")
private String stuAnswer;
}

@ -0,0 +1,20 @@
package com.sztzjy.financial_bigdata.entity.stu_dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@NoArgsConstructor
public class StuTheoryTestRecordDto {
@ApiModelProperty("考试次数")
private Integer examCount;
@ApiModelProperty("平均分")
private BigDecimal averageScore;
@ApiModelProperty("排名")
private Integer rank;
}

@ -0,0 +1,38 @@
package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord;
import com.sztzjy.financial_bigdata.entity.StuTrainingStepRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuTrainingStepRecordMapper {
long countByExample(StuTrainingStepRecordExample example);
int deleteByExample(StuTrainingStepRecordExample example);
int deleteByPrimaryKey(String recordId);
int insert(StuTrainingStepRecord record);
int insertSelective(StuTrainingStepRecord record);
List<StuTrainingStepRecord> selectByExampleWithBLOBs(StuTrainingStepRecordExample example);
List<StuTrainingStepRecord> selectByExample(StuTrainingStepRecordExample example);
StuTrainingStepRecord selectByPrimaryKey(String recordId);
int updateByExampleSelective(@Param("record") StuTrainingStepRecord record, @Param("example") StuTrainingStepRecordExample example);
int updateByExampleWithBLOBs(@Param("record") StuTrainingStepRecord record, @Param("example") StuTrainingStepRecordExample example);
int updateByExample(@Param("record") StuTrainingStepRecord record, @Param("example") StuTrainingStepRecordExample example);
int updateByPrimaryKeySelective(StuTrainingStepRecord record);
int updateByPrimaryKeyWithBLOBs(StuTrainingStepRecord record);
int updateByPrimaryKey(StuTrainingStepRecord record);
}

@ -47,6 +47,10 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
StuTheoryExamWithBLOBs stuTheoryExam = stuTheoryExams.get(0);
Date currentTime = new Date();
Date twoHoursAgo = new Date(currentTime.getTime() - (2 * 60 * 60 * 1000)); // 当前时间减去两个小时
if(stuTheoryExam.getAnswered()){
List<SysObjectiveQuestion> objectiveQuestionList = GenerateTest(userId);
return objectiveQuestionList;
}
if (stuTheoryExam.getExamTime().before(twoHoursAgo)) { //已超出两个小时 从新生成新试卷
List<SysObjectiveQuestion> objectiveQuestionList = GenerateTest(userId);
return objectiveQuestionList;
@ -199,7 +203,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
errorMapper.insert(stuError);
} else {
StuErrorWithBLOBs stuError = stuErrors.get(0);
if (!stuError.getSingleIds().isEmpty()) {
if (stuError.getSingleIds()!=null) {
List<String> stringList = Arrays.asList(stuError.getSingleIds().substring(1, stuError.getSingleIds().length() - 1).split(", "));
List<String> singleErrorIds = theoryTestDto.getSingleErrorIds();
@ -211,7 +215,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
} else {
stuError.setSingleIds(String.valueOf(theoryTestDto.getSingleErrorIds()));
}
if (!stuError.getMultipleIds().isEmpty()) {
if (stuError.getMultipleIds()!=null) {
List<String> stringList = Arrays.asList(stuError.getMultipleIds().substring(1, stuError.getMultipleIds().length() - 1).split(", "));
List<String> multipleErrorIds = theoryTestDto.getMultipleErrorIds();
@ -223,7 +227,7 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
} else {
stuError.setMultipleIds(String.valueOf(theoryTestDto.getMultipleErrorIds()));
}
if (!stuError.getJudgeIds().isEmpty()) {
if (stuError.getJudgeIds()!=null) {
List<String> stringList = Arrays.asList(stuError.getJudgeIds().substring(1, stuError.getJudgeIds().length() - 1).split(", "));
List<String> judgeErrorIds = theoryTestDto.getJudgeErrorIds();
List<String> combinedList = new ArrayList<>(stringList);
@ -388,6 +392,9 @@ public class TheoryTestServiceImpl implements ITheoryTestService {
return null;
} else { //根据考试时间排序 查询最近的一条
StuTheoryExamWithBLOBs stuTheoryExam = stuTheoryExams.get(0);
if(stuTheoryExam.getAnswered()){
return null;
}
Date currentTime = new Date();
Date twoHoursAgo = new Date(currentTime.getTime() - (2 * 60 * 60 * 1000)); // 当前时间减去两个小时
if (stuTheoryExam.getExamTime().before(twoHoursAgo)) { //已超出两个小时 从新生成新试卷

@ -80,6 +80,6 @@ spring:
mybatis:
type-aliases-package: com.sztzjy.financial_bigdata.entity
mapper-locations: classpath*:/mappers/*.xml
mapper-locations: classpath*:/mapper/*.xml

@ -0,0 +1,251 @@
<?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.financial_bigdata.mapper.StuTrainingStepRecordMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord">
<id column="record_id" jdbcType="VARCHAR" property="recordId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="case_id" jdbcType="VARCHAR" property="caseId" />
<result column="case_step_id" jdbcType="VARCHAR" property="caseStepId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord">
<result column="stu_answer" jdbcType="LONGVARCHAR" property="stuAnswer" />
</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">
record_id, user_id, case_id, case_step_id
</sql>
<sql id="Blob_Column_List">
stu_answer
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecordExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_training_step_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_training_step_record
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_training_step_record
where record_id = #{recordId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_training_step_record
where record_id = #{recordId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecordExample">
delete from stu_training_step_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord">
insert into stu_training_step_record (record_id, user_id, case_id,
case_step_id, stu_answer)
values (#{recordId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR},
#{caseStepId,jdbcType=VARCHAR}, #{stuAnswer,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord">
insert into stu_training_step_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">
record_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="caseId != null">
case_id,
</if>
<if test="caseStepId != null">
case_step_id,
</if>
<if test="stuAnswer != null">
stu_answer,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">
#{recordId,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="caseStepId != null">
#{caseStepId,jdbcType=VARCHAR},
</if>
<if test="stuAnswer != null">
#{stuAnswer,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecordExample" resultType="java.lang.Long">
select count(*) from stu_training_step_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_training_step_record
<set>
<if test="record.recordId != null">
record_id = #{record.recordId,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.caseStepId != null">
case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
</if>
<if test="record.stuAnswer != null">
stu_answer = #{record.stuAnswer,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_training_step_record
set record_id = #{record.recordId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR},
case_step_id = #{record.caseStepId,jdbcType=VARCHAR},
stu_answer = #{record.stuAnswer,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_training_step_record
set record_id = #{record.recordId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
case_id = #{record.caseId,jdbcType=VARCHAR},
case_step_id = #{record.caseStepId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord">
update stu_training_step_record
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="caseId != null">
case_id = #{caseId,jdbcType=VARCHAR},
</if>
<if test="caseStepId != null">
case_step_id = #{caseStepId,jdbcType=VARCHAR},
</if>
<if test="stuAnswer != null">
stu_answer = #{stuAnswer,jdbcType=LONGVARCHAR},
</if>
</set>
where record_id = #{recordId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord">
update stu_training_step_record
set user_id = #{userId,jdbcType=VARCHAR},
case_id = #{caseId,jdbcType=VARCHAR},
case_step_id = #{caseStepId,jdbcType=VARCHAR},
stu_answer = #{stuAnswer,jdbcType=LONGVARCHAR}
where record_id = #{recordId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingStepRecord">
update stu_training_step_record
set user_id = #{userId,jdbcType=VARCHAR},
case_id = #{caseId,jdbcType=VARCHAR},
case_step_id = #{caseStepId,jdbcType=VARCHAR}
where record_id = #{recordId,jdbcType=VARCHAR}
</update>
</mapper>
Loading…
Cancel
Save