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

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

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

Loading…
Cancel
Save