diff --git a/src/main/java/com/sztzjy/linkCommerce/controller/stu/IndustryDemandAnalysisController.java b/src/main/java/com/sztzjy/linkCommerce/controller/stu/IndustryDemandAnalysisController.java index e5ee1ba..08b9f3d 100644 --- a/src/main/java/com/sztzjy/linkCommerce/controller/stu/IndustryDemandAnalysisController.java +++ b/src/main/java/com/sztzjy/linkCommerce/controller/stu/IndustryDemandAnalysisController.java @@ -261,6 +261,7 @@ public class IndustryDemandAnalysisController { jzhyfxStuAnswer.setUserId(competitiveEnvDTO.getUserId()); jzhyfxStuAnswer.setAnswer(stuAnswer.toString()); jzhyfxStuAnswer.setId(IdUtil.randomUUID()); + jzhyfxStuAnswer.setContext(competitiveEnvDTO.getContext()); jzhyfxStuAnswerMapper.insertSelective(jzhyfxStuAnswer); @@ -284,7 +285,7 @@ public class IndustryDemandAnalysisController { //查询数据库 是否已经答过题 JzhyfxStuAnswerExample example = new JzhyfxStuAnswerExample(); example.createCriteria().andUserIdEqualTo(userId); - List stuAnswerList = jzhyfxStuAnswerMapper.selectByExample(example); + List stuAnswerList = jzhyfxStuAnswerMapper.selectByExampleWithBLOBs(example); if (CollectionUtils.isEmpty(stuAnswerList)) { return new ResultEntity<>(HttpStatus.OK); } else { diff --git a/src/main/java/com/sztzjy/linkCommerce/entity/JzhyfxStuAnswer.java b/src/main/java/com/sztzjy/linkCommerce/entity/JzhyfxStuAnswer.java index 226e377..d129d7c 100644 --- a/src/main/java/com/sztzjy/linkCommerce/entity/JzhyfxStuAnswer.java +++ b/src/main/java/com/sztzjy/linkCommerce/entity/JzhyfxStuAnswer.java @@ -20,6 +20,9 @@ public class JzhyfxStuAnswer { @ApiModelProperty(notes = "学生答案内容(富文本格式)") private String answer; + @ApiModelProperty(notes = "主观题") + private String context; + public String getId() { return id; } @@ -51,4 +54,12 @@ public class JzhyfxStuAnswer { public void setAnswer(String answer) { this.answer = answer == null ? null : answer.trim(); } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context == null ? null : context.trim(); + } } \ No newline at end of file diff --git a/src/main/resources/mappers/JzhyfxStuAnswerMapper.xml b/src/main/resources/mappers/JzhyfxStuAnswerMapper.xml index d7fe5be..9e75549 100644 --- a/src/main/resources/mappers/JzhyfxStuAnswerMapper.xml +++ b/src/main/resources/mappers/JzhyfxStuAnswerMapper.xml @@ -8,6 +8,7 @@ + @@ -71,7 +72,7 @@ id, time, user_id - answer + answer, context @@ -179,6 +186,9 @@ answer = #{record.answer,jdbcType=LONGVARCHAR}, + + context = #{record.context,jdbcType=LONGVARCHAR}, + @@ -189,7 +199,8 @@ set id = #{record.id,jdbcType=VARCHAR}, time = #{record.time,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR}, - answer = #{record.answer,jdbcType=LONGVARCHAR} + answer = #{record.answer,jdbcType=LONGVARCHAR}, + context = #{record.context,jdbcType=LONGVARCHAR} @@ -215,6 +226,9 @@ answer = #{answer,jdbcType=LONGVARCHAR}, + + context = #{context,jdbcType=LONGVARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -222,7 +236,8 @@ update jzhyfx_stu_answer set time = #{time,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR}, - answer = #{answer,jdbcType=LONGVARCHAR} + answer = #{answer,jdbcType=LONGVARCHAR}, + context = #{context,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR}