新增退出时机表,完成投资报告页面接口

master
xiaoCJ 1 year ago
parent 9f0ff3c1ed
commit 94992317b4

@ -7,7 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
* topic_record
*/
public class TopicRecord {
private String id;
private Integer id;
@ApiModelProperty("题目ID")
private String topicId;
@ -41,12 +41,12 @@ public class TopicRecord {
@ApiModelProperty("正确答案")
private String answer;
public String getId() {
public Integer getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
public void setId(Integer id) {
this.id = id;
}
public String getTopicId() {

@ -114,62 +114,52 @@ public class TopicRecordExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}

@ -12,7 +12,7 @@ public interface TopicRecordMapper {
int deleteByExample(TopicRecordExample example);
int deleteByPrimaryKey(String id);
int deleteByPrimaryKey(Integer id);
int insert(TopicRecord record);
@ -20,7 +20,7 @@ public interface TopicRecordMapper {
List<TopicRecord> selectByExample(TopicRecordExample example);
TopicRecord selectByPrimaryKey(String id);
TopicRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TopicRecord record, @Param("example") TopicRecordExample example);

@ -154,7 +154,6 @@ public class TopicServiceImpl implements TopicService {
return new ResultEntity<List<String>>(HttpStatus.BAD_REQUEST, "请勿重复提交!");
}
int score = 0;
List<String> list = new ArrayList<>();
String module = "";
for (TopicsWithBLOBs topic : topics) {
String userAnswer = topic.getUserAnswer();
@ -195,8 +194,6 @@ public class TopicServiceImpl implements TopicService {
}
//添加到答题记录表
TopicRecord topicRecord = new TopicRecord();
String recordId = IdUtil.simpleUUID();
topicRecord.setId(recordId);
topicRecord.setTopicId(topicId);
topicRecord.setUserAnswer(userAnswer);
topicRecord.setAnswer(rightAnswer);
@ -213,7 +210,6 @@ public class TopicServiceImpl implements TopicService {
topicRecord.setModule(module);
topicRecord.setTopicType(topicType);
topicRecordMapper.insert(topicRecord);
list.add(recordId);
}
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
@ -244,7 +240,7 @@ public class TopicServiceImpl implements TopicService {
performanceScoreMapper.updateByPrimaryKey(performanceScore);
performanceScoreService.calculateScoreByModule("ipoListedConditionScore", score, flowId);
}
return new ResultEntity<>(list);
return new ResultEntity<>(HttpStatus.OK,"提交成功!");
}
@ -318,7 +314,9 @@ public class TopicServiceImpl implements TopicService {
public List<TopicRecord> getTopicRecord(String flowId, String module) {
TopicRecordExample example = new TopicRecordExample();
example.createCriteria().andModuleEqualTo(module).andFlowIdEqualTo(flowId);
return topicRecordMapper.selectByExample(example);
example.setOrderByClause("id");
List<TopicRecord> list = topicRecordMapper.selectByExample(example);
return list;
}

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.fund_investment.mapper.TopicRecordMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.TopicRecord">
<id column="id" jdbcType="VARCHAR" property="id" />
<id column="id" jdbcType="INTEGER" property="id" />
<result column="topic_id" jdbcType="VARCHAR" property="topicId" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="module" jdbcType="VARCHAR" property="module" />
@ -92,15 +92,15 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from topic_record
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from topic_record
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.TopicRecordExample">
delete from topic_record
@ -114,7 +114,7 @@
choicesA, choicesB, choicesC,
choicesD, choicesE, user_answer,
answer)
values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR},
values (#{id,jdbcType=INTEGER}, #{topicId,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR},
#{module,jdbcType=VARCHAR}, #{topicContent,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR},
#{choicesa,jdbcType=VARCHAR}, #{choicesb,jdbcType=VARCHAR}, #{choicesc,jdbcType=VARCHAR},
#{choicesd,jdbcType=VARCHAR}, #{choicese,jdbcType=VARCHAR}, #{userAnswer,jdbcType=VARCHAR},
@ -165,7 +165,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
#{id,jdbcType=INTEGER},
</if>
<if test="topicId != null">
#{topicId,jdbcType=VARCHAR},
@ -215,7 +215,7 @@
update topic_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.topicId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR},
@ -260,7 +260,7 @@
</update>
<update id="updateByExample" parameterType="map">
update topic_record
set id = #{record.id,jdbcType=VARCHAR},
set id = #{record.id,jdbcType=INTEGER},
topic_id = #{record.topicId,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
@ -317,7 +317,7 @@
answer = #{answer,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.TopicRecord">
update topic_record
@ -333,6 +333,6 @@
choicesE = #{choicese,jdbcType=VARCHAR},
user_answer = #{userAnswer,jdbcType=VARCHAR},
answer = #{answer,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Loading…
Cancel
Save