修改主观题回显问题

main
whb 1 year ago
parent b167feb400
commit 1325d739bd

@ -261,6 +261,7 @@ public class IndustryDemandAnalysisController {
jzhyfxStuAnswer.setUserId(competitiveEnvDTO.getUserId()); jzhyfxStuAnswer.setUserId(competitiveEnvDTO.getUserId());
jzhyfxStuAnswer.setAnswer(stuAnswer.toString()); jzhyfxStuAnswer.setAnswer(stuAnswer.toString());
jzhyfxStuAnswer.setId(IdUtil.randomUUID()); jzhyfxStuAnswer.setId(IdUtil.randomUUID());
jzhyfxStuAnswer.setContext(competitiveEnvDTO.getContext());
jzhyfxStuAnswerMapper.insertSelective(jzhyfxStuAnswer); jzhyfxStuAnswerMapper.insertSelective(jzhyfxStuAnswer);
@ -284,7 +285,7 @@ public class IndustryDemandAnalysisController {
//查询数据库 是否已经答过题 //查询数据库 是否已经答过题
JzhyfxStuAnswerExample example = new JzhyfxStuAnswerExample(); JzhyfxStuAnswerExample example = new JzhyfxStuAnswerExample();
example.createCriteria().andUserIdEqualTo(userId); example.createCriteria().andUserIdEqualTo(userId);
List<JzhyfxStuAnswer> stuAnswerList = jzhyfxStuAnswerMapper.selectByExample(example); List<JzhyfxStuAnswer> stuAnswerList = jzhyfxStuAnswerMapper.selectByExampleWithBLOBs(example);
if (CollectionUtils.isEmpty(stuAnswerList)) { if (CollectionUtils.isEmpty(stuAnswerList)) {
return new ResultEntity<>(HttpStatus.OK); return new ResultEntity<>(HttpStatus.OK);
} else { } else {

@ -20,6 +20,9 @@ public class JzhyfxStuAnswer {
@ApiModelProperty(notes = "学生答案内容(富文本格式)") @ApiModelProperty(notes = "学生答案内容(富文本格式)")
private String answer; private String answer;
@ApiModelProperty(notes = "主观题")
private String context;
public String getId() { public String getId() {
return id; return id;
} }
@ -51,4 +54,12 @@ public class JzhyfxStuAnswer {
public void setAnswer(String answer) { public void setAnswer(String answer) {
this.answer = answer == null ? null : answer.trim(); this.answer = answer == null ? null : answer.trim();
} }
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context == null ? null : context.trim();
}
} }

@ -8,6 +8,7 @@
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer">
<result column="answer" jdbcType="LONGVARCHAR" property="answer" /> <result column="answer" jdbcType="LONGVARCHAR" property="answer" />
<result column="context" jdbcType="LONGVARCHAR" property="context" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -71,7 +72,7 @@
id, time, user_id id, time, user_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
answer answer, context
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswerExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswerExample" resultMap="ResultMapWithBLOBs">
select select
@ -123,9 +124,9 @@
</delete> </delete>
<insert id="insert" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer"> <insert id="insert" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer">
insert into jzhyfx_stu_answer (id, time, user_id, insert into jzhyfx_stu_answer (id, time, user_id,
answer) answer, context)
values (#{id,jdbcType=VARCHAR}, #{time,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{time,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{answer,jdbcType=LONGVARCHAR}) #{answer,jdbcType=LONGVARCHAR}, #{context,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer"> <insert id="insertSelective" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer">
insert into jzhyfx_stu_answer insert into jzhyfx_stu_answer
@ -142,6 +143,9 @@
<if test="answer != null"> <if test="answer != null">
answer, answer,
</if> </if>
<if test="context != null">
context,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -156,6 +160,9 @@
<if test="answer != null"> <if test="answer != null">
#{answer,jdbcType=LONGVARCHAR}, #{answer,jdbcType=LONGVARCHAR},
</if> </if>
<if test="context != null">
#{context,jdbcType=LONGVARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswerExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswerExample" resultType="java.lang.Long">
@ -179,6 +186,9 @@
<if test="record.answer != null"> <if test="record.answer != null">
answer = #{record.answer,jdbcType=LONGVARCHAR}, answer = #{record.answer,jdbcType=LONGVARCHAR},
</if> </if>
<if test="record.context != null">
context = #{record.context,jdbcType=LONGVARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -189,7 +199,8 @@
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
time = #{record.time,jdbcType=VARCHAR}, time = #{record.time,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR},
answer = #{record.answer,jdbcType=LONGVARCHAR} answer = #{record.answer,jdbcType=LONGVARCHAR},
context = #{record.context,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -215,6 +226,9 @@
<if test="answer != null"> <if test="answer != null">
answer = #{answer,jdbcType=LONGVARCHAR}, answer = #{answer,jdbcType=LONGVARCHAR},
</if> </if>
<if test="context != null">
context = #{context,jdbcType=LONGVARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -222,7 +236,8 @@
update jzhyfx_stu_answer update jzhyfx_stu_answer
set time = #{time,jdbcType=VARCHAR}, set time = #{time,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR},
answer = #{answer,jdbcType=LONGVARCHAR} answer = #{answer,jdbcType=LONGVARCHAR},
context = #{context,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer"> <update id="updateByPrimaryKey" parameterType="com.sztzjy.linkCommerce.entity.JzhyfxStuAnswer">

Loading…
Cancel
Save