理论试题管理代码调整

This commit is contained in:
tiger_zhou 2022-09-22 17:43:12 +08:00
parent a6ccd7dc81
commit f8efdbc965
10 changed files with 30 additions and 33 deletions

View File

@ -5,9 +5,9 @@ import club.joylink.rtss.services.completition.question.PagerQuestionService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.pager.question.PagerLableQueryVO;
import club.joylink.rtss.vo.client.pager.question.PaperQuestionVO;
import club.joylink.rtss.vo.client.question.QuestionQueryVO;
import club.joylink.rtss.vo.client.question.v2.PagerLableQueryVO;
import club.joylink.rtss.vo.client.question.v2.PaperQuestionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

View File

@ -1,7 +1,8 @@
package club.joylink.rtss.dao;
package club.joylink.rtss.dao.paper;
import club.joylink.rtss.entity.question.PaperQuestion;
import club.joylink.rtss.entity.question.PaperQuestionExample;
import club.joylink.rtss.dao.MyBatisBaseDao;
import club.joylink.rtss.entity.paper.question.PaperQuestion;
import club.joylink.rtss.entity.paper.question.PaperQuestionExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
@ -10,7 +11,7 @@ import java.util.List;
@Mapper
@Repository
public interface PagerQuestionDAO extends MyBatisBaseDao<PaperQuestion, Long, PaperQuestionExample>{
public interface PagerQuestionDAO extends MyBatisBaseDao<PaperQuestion, Long, PaperQuestionExample> {
@Select("<script>" +
"select * from paper_question where 1 = 1 " +
"<choose>" +

View File

@ -1,4 +1,4 @@
package club.joylink.rtss.entity.question;
package club.joylink.rtss.entity.paper.question;
import java.io.Serializable;
import java.time.LocalDateTime;

View File

@ -1,4 +1,4 @@
package club.joylink.rtss.entity.question;
package club.joylink.rtss.entity.paper.question;
import java.util.ArrayList;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package club.joylink.rtss.entity.question;
package club.joylink.rtss.entity.paper.question;
import java.io.Serializable;
import lombok.Data;

View File

@ -2,20 +2,19 @@ package club.joylink.rtss.services.completition.question;
import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.constants.Project;
import club.joylink.rtss.dao.PagerQuestionDAO;
import club.joylink.rtss.entity.question.PaperQuestion;
import club.joylink.rtss.entity.question.PaperQuestionExample;
import club.joylink.rtss.dao.paper.PagerQuestionDAO;
import club.joylink.rtss.entity.paper.question.PaperQuestion;
import club.joylink.rtss.entity.paper.question.PaperQuestionExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.pager.question.PagerLableQueryVO;
import club.joylink.rtss.vo.client.pager.question.PaperQuestionOptionVO2;
import club.joylink.rtss.vo.client.pager.question.PaperQuestionVO;
import club.joylink.rtss.vo.client.question.QuestionQueryVO;
import club.joylink.rtss.vo.client.question.v2.PagerLableQueryVO;
import club.joylink.rtss.vo.client.question.v2.PaperQuestionOptionVO2;
import club.joylink.rtss.vo.client.question.v2.PaperQuestionVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -126,7 +125,7 @@ public class PagerQuestionService {
* @param random
* @return
*/
public List<PaperQuestionVO> queryQuestionsForRaceLable(String projectCode, PagerLableQueryVO queryVO,boolean random) {
public List<PaperQuestionVO> queryQuestionsForRaceLable(String projectCode, PagerLableQueryVO queryVO, boolean random) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(queryVO.allNotNullOrEmpty(),"查询内容不能为空");
int isDel = BusinessConsts.DBLogicDelete.NORMAL.ordinal();

View File

@ -1,11 +1,8 @@
package club.joylink.rtss.vo.client.question.v2;
package club.joylink.rtss.vo.client.pager.question;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.Objects;

View File

@ -1,4 +1,4 @@
package club.joylink.rtss.vo.client.question.v2;
package club.joylink.rtss.vo.client.pager.question;
import club.joylink.rtss.entity.RaceQuestionOption;
import lombok.Getter;

View File

@ -1,8 +1,8 @@
package club.joylink.rtss.vo.client.question.v2;
package club.joylink.rtss.vo.client.pager.question;
import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.constants.Project;
import club.joylink.rtss.entity.question.PaperQuestion;
import club.joylink.rtss.entity.paper.question.PaperQuestion;
import club.joylink.rtss.util.JsonUtils;
import lombok.Getter;
import lombok.NoArgsConstructor;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="club.joylink.rtss.dao.PagerQuestionDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.question.PaperQuestion">
<mapper namespace="club.joylink.rtss.dao.paper.PagerQuestionDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.paper.question.PaperQuestion">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
@ -105,7 +105,7 @@
</if>
</if>
</select>-->
<select id="selectByExample" parameterType="club.joylink.rtss.entity.question.PaperQuestionExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="club.joylink.rtss.entity.paper.question.PaperQuestionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
@ -141,13 +141,13 @@
delete from paper_question
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.question.PaperQuestionExample">
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.paper.question.PaperQuestionExample">
delete from paper_question
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="club.joylink.rtss.entity.question.PaperQuestionWithBLOBs">
<insert id="insert" parameterType="club.joylink.rtss.entity.paper.question.PaperQuestionWithBLOBs">
insert into paper_question (id, `type`, create_user_id,
create_time, project_code, company_id,
race_lable, is_del, topic,
@ -157,7 +157,7 @@
#{raceLable,jdbcType=VARCHAR}, #{isDel,jdbcType=INTEGER}, #{topic,jdbcType=LONGVARCHAR},
#{questions,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.question.PaperQuestionWithBLOBs">
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.paper.question.PaperQuestionWithBLOBs">
insert into paper_question
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -224,7 +224,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.question.PaperQuestionExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="club.joylink.rtss.entity.paper.question.PaperQuestionExample" resultType="java.lang.Long">
select count(*) from paper_question
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
@ -301,7 +301,7 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.question.PaperQuestionWithBLOBs">
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.paper.question.PaperQuestionWithBLOBs">
update paper_question
<set>
<if test="type != null">
@ -347,7 +347,7 @@
questions = #{questions,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>-->
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.question.PaperQuestion">
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.paper.question.PaperQuestion">
update paper_question
set `type` = #{type,jdbcType=VARCHAR},
create_user_id = #{createUserId,jdbcType=BIGINT},