搭建springboot三层架构 导入部分工具类 新增知识评测接口

master
xiaoCJ 1 year ago
parent c38e6e44c6
commit 23c2122bfc

@ -38,7 +38,7 @@ public class topicController {
public ResultEntity<List<Topics>> getRandomTopic(@ApiParam("题目来源模块") @RequestParam String module) {
TopicsExample topicsExample =new TopicsExample();
topicsExample.createCriteria().andModuleEqualTo(module);
List<Topics> topics = topicsMapper.selectByExample(topicsExample);
List<Topics> topics = topicsMapper.selectByExampleWithBLOBs(topicsExample);
//随机取6道题目
Collections.shuffle(topics);
int size = Math.min(6, topics.size());

@ -38,19 +38,19 @@
</javaClientGenerator>
<!-- 需要生成的表 -->
<table tableName="allotment_object" domainObjectName="AllotmentObject" />
<table tableName="fundraising" domainObjectName="Fundraising" />
<table tableName="inquiry_participation" domainObjectName="InquiryParticipation" />
<table tableName="issuance_info" domainObjectName="IssuanceInfo" />
<table tableName="issuance_parameter_input" domainObjectName="IssuanceParameterInput" />
<table tableName="performance_score" domainObjectName="PerformanceScore" />
<table tableName="profit_distribution" domainObjectName="ProfitDistribution" />
<table tableName="profit_management" domainObjectName="ProfitManagement" />
<table tableName="question_answer" domainObjectName="QuestionAnswer" />
<table tableName="topics" domainObjectName="Topics" />
<table tableName="topic_record" domainObjectName="TopicRecord" />
<table tableName="training_report" domainObjectName="TrainingReport" />
<table tableName="user_table" domainObjectName="UserTable" />
<!-- <table tableName="allotment_object" domainObjectName="AllotmentObject" />-->
<!-- <table tableName="fundraising" domainObjectName="Fundraising" />-->
<!-- <table tableName="inquiry_participation" domainObjectName="InquiryParticipation" />-->
<!-- <table tableName="issuance_info" domainObjectName="IssuanceInfo" />-->
<!-- <table tableName="issuance_parameter_input" domainObjectName="IssuanceParameterInput" />-->
<!-- <table tableName="performance_score" domainObjectName="PerformanceScore" />-->
<!-- <table tableName="profit_distribution" domainObjectName="ProfitDistribution" />-->
<!-- <table tableName="profit_management" domainObjectName="ProfitManagement" />-->
<!-- <table tableName="question_answer" domainObjectName="QuestionAnswer" />-->
<table tableName="sys_topics" domainObjectName="Topics" />
<!-- <table tableName="topic_record" domainObjectName="TopicRecord" />-->
<!-- <table tableName="training_report" domainObjectName="TrainingReport" />-->
<!-- <table tableName="user_table" domainObjectName="UserTable" />-->
</context>

@ -84,7 +84,7 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from topics
from sys_topics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -98,7 +98,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from topics
from sys_topics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -111,21 +111,21 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from topics
from sys_topics
where topic_id = #{topicId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from topics
delete from sys_topics
where topic_id = #{topicId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample">
delete from topics
delete from sys_topics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.Topics">
insert into topics (topic_id, topic_type, source,
insert into sys_topics (topic_id, topic_type, source,
module, answer, school_id,
topic_content)
values (#{topicId,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
@ -133,7 +133,7 @@
#{topicContent,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.Topics">
insert into topics
insert into sys_topics
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="topicId != null">
topic_id,
@ -182,13 +182,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.TopicsExample" resultType="java.lang.Long">
select count(*) from topics
select count(*) from sys_topics
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update topics
update sys_topics
<set>
<if test="record.topicId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR},
@ -217,7 +217,7 @@
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update topics
update sys_topics
set topic_id = #{record.topicId,jdbcType=VARCHAR},
topic_type = #{record.topicType,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
@ -230,7 +230,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update topics
update sys_topics
set topic_id = #{record.topicId,jdbcType=VARCHAR},
topic_type = #{record.topicType,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
@ -242,7 +242,7 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.Topics">
update topics
update sys_topics
<set>
<if test="topicType != null">
topic_type = #{topicType,jdbcType=VARCHAR},
@ -266,7 +266,7 @@
where topic_id = #{topicId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.fund_investment.entity.Topics">
update topics
update sys_topics
set topic_type = #{topicType,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
@ -276,7 +276,7 @@
where topic_id = #{topicId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.Topics">
update topics
update sys_topics
set topic_type = #{topicType,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},

Loading…
Cancel
Save