Procházet zdrojové kódy

免费题库修改

小么熊🐻 před 2 roky
rodič
revize
6dfc94d06c

+ 17 - 9
jpcj-admin/src/main/java/com/miaxis/app/controller/common/CommonQuestionInfoController.java

@@ -2,20 +2,18 @@ package com.miaxis.app.controller.common;
 
 import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
-import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.page.ResponsePageInfo;
 import com.miaxis.question.domain.QuestionInfo;
-import com.miaxis.question.dto.QuestionInfoDTO;
-import com.miaxis.question.dto.QuestionInfoFlDTO;
+import com.miaxis.question.dto.QuestionInfoFreeDTO;
 import com.miaxis.question.dto.QuestionInfoTestDTO;
 import com.miaxis.question.service.IQuestionInfoService;
-import com.miaxis.question.vo.QuestionInfoDfVO;
-import com.miaxis.question.vo.QuestionInfoFlVO;
-import com.miaxis.question.vo.QuestionInfoJxVO;
-import com.miaxis.question.vo.QuestionInfoSxVO;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
@@ -41,5 +39,15 @@ public class CommonQuestionInfoController extends BaseController{
         List<QuestionInfo> list = questionInfoService.selectTestK14QuestionInfoList(questionInfoTestDTO);
         return toResponsePageInfo(list);
     }
+
+    /**
+     * 查询免费题库
+     */
+    @GetMapping("/selectFreeQuestionInfo")
+    @ApiOperation("查询免费题库")
+    public ResponsePageInfo<QuestionInfo> selectFreeQuestionInfo(QuestionInfoFreeDTO freeDTO){
+        List<QuestionInfo> list = questionInfoService.selectFreeQuestionInfo(freeDTO);
+        return toResponsePageInfo(list);
+    }
 }
 

+ 1 - 9
jpcj-admin/src/main/java/com/miaxis/app/controller/h5/QuestionInfoController.java

@@ -7,6 +7,7 @@ import com.miaxis.common.core.page.ResponsePageInfo;
 import com.miaxis.question.domain.QuestionInfo;
 import com.miaxis.question.dto.QuestionInfoDTO;
 import com.miaxis.question.dto.QuestionInfoFlDTO;
+import com.miaxis.question.dto.QuestionInfoFreeDTO;
 import com.miaxis.question.dto.QuestionInfoTestDTO;
 import com.miaxis.question.service.IQuestionInfoService;
 import com.miaxis.question.vo.QuestionInfoDfVO;
@@ -173,15 +174,6 @@ public class QuestionInfoController extends BaseController{
 
 
 
-    /**
-     * 查询免费题库
-     */
-    @GetMapping("/selectFreeQuestionInfo")
-    @ApiOperation("查询免费题库")
-    public ResponsePageInfo<QuestionInfo> selectFreeQuestionInfo(){
-        List<QuestionInfo> list = questionInfoService.selectFreeQuestionInfo();
-        return toResponsePageInfo(list);
-    }
 
     /**
      * 查询模拟考试科目1与4题库

+ 17 - 4
jpcj-service/src/main/java/com/miaxis/question/domain/QuestionInfo.java

@@ -210,10 +210,10 @@ public class QuestionInfo extends BaseBusinessEntity{
     private Integer questionType;
 
 
-    /** 题目类型 */
-    @Excel(name = "题目类型")
-    @TableField("question_type")
-    @ApiModelProperty(value = "题目类型 1判断,2选择,3多选")
+    /** 科目 */
+    @Excel(name = "科目")
+    @TableField("subject")
+    @ApiModelProperty(value = "科目")
     private Integer subject;
 
     /** 分类练习排序字段 */
@@ -243,4 +243,17 @@ public class QuestionInfo extends BaseBusinessEntity{
     private Integer placeSort;
 
 
+    /** 章节ID */
+    @Excel(name = "章节ID")
+    @TableField("chapter_id")
+    @ApiModelProperty(value = "章节ID")
+    private Integer chapterId;
+
+    /** 难度等级1-5 */
+    @Excel(name = "难度等级1-5")
+    @TableField("diff_degree")
+    @ApiModelProperty(value = "难度等级1-5")
+    private Integer diffDegree;
+
+
 }

+ 10 - 0
jpcj-service/src/main/java/com/miaxis/question/dto/QuestionInfoDTO.java

@@ -178,5 +178,15 @@ public class QuestionInfoDTO extends BaseBusinessEntity{
     private String sortName;
 
 
+    /** 章节ID  */
+    @ApiModelProperty(value = "1:分类练习;2:精选考题;3:顺序练习;4:地方专题;")
+    private Integer chapterId;
+
+    /**
+     * 难度等级1-5
+     */
+    @ApiModelProperty(value = "分类字段名",hidden = true)
+    private String diffDegree;
+
 
 }

+ 0 - 6
jpcj-service/src/main/java/com/miaxis/question/dto/QuestionInfoFreeDTO.java

@@ -16,12 +16,6 @@ public class QuestionInfoFreeDTO extends BaseBusinessEntity{
     private static final long serialVersionUID = 1L;
 
 
-    @ApiModelProperty(hidden = true)
-    private Integer questionType;
-
-    @ApiModelProperty(hidden = true)
-    private Integer num;
-
     @ApiModelProperty(value = "科目")
     private Integer subject;
 }

+ 1 - 1
jpcj-service/src/main/java/com/miaxis/question/service/IQuestionInfoService.java

@@ -40,7 +40,7 @@ public interface IQuestionInfoService extends IService<QuestionInfo>{
 
     List<QuestionInfoExcelTypeVo> getIssueTypes(int issueTypeValue, Integer typeValue);
 
-    List<QuestionInfo> selectFreeQuestionInfo();
+    List<QuestionInfo> selectFreeQuestionInfo(QuestionInfoFreeDTO freeDTO);
 
     List<QuestionInfo> selectQuestionInfoListByYdtIds(Long[] ids);
 

+ 3 - 14
jpcj-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

@@ -130,20 +130,9 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
 
 
     @Override
-    public List<QuestionInfo> selectFreeQuestionInfo() {
-        QuestionInfoFreeDTO freeDTO = new QuestionInfoFreeDTO();
-        freeDTO.setNum(10);
-        freeDTO.setQuestionType(1);
-        freeDTO.setSubject(1);
-        List<QuestionInfo> list1 = questionInfoMapper.selectFreeQuestionInfoList(freeDTO);
-        freeDTO.setQuestionType(2);
-        List<QuestionInfo> list2 = questionInfoMapper.selectFreeQuestionInfoList(freeDTO);
-        freeDTO.setSubject(4);
-        freeDTO.setQuestionType(3);
-        List<QuestionInfo> list3 = questionInfoMapper.selectFreeQuestionInfoList(freeDTO);
-        list1.addAll(list2);
-        list1.addAll(list3);
-        return list1;
+    public List<QuestionInfo> selectFreeQuestionInfo(QuestionInfoFreeDTO freeDTO) {
+        List<QuestionInfo> list = questionInfoMapper.selectFreeQuestionInfoList(freeDTO);
+        return list;
     }
 
 

+ 40 - 6
jpcj-service/src/main/resources/mapper/question/QuestionInfoMapper.xml

@@ -41,6 +41,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="excellSort"    column="excell_sort"    />
         <result property="sequeSort"    column="seque_sort"    />
         <result property="placeSort"    column="place_sort"    />
+        <result property="sequeSort"    column="seque_sort"    />
+        <result property="placeSort"    column="place_sort"    />
+        <result property="chapterId"    column="chapter_id"    />
+        <result property="diffDegree"    column="diff_degree"    />
 
 
     </resultMap>
@@ -81,6 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="excellIssueName != null  and excellIssueName != ''"> and excell_issue_name like concat('%', #{excellIssueName}, '%')</if>
             <if test="questionType != null "> and question_type = #{questionType}</if>
             <if test="subject != null  and subject != ''"> and subject = #{subject}</if>
+            <if test="chapterId != null  and chapterId != ''"> and chapter_id = #{chapterId}</if>
+            <if test="diffDegree != null  and diffDegree != ''"> and diff_degree = #{diffDegree}</if>
         </where>
 
         <if test="isRand!=null and isRand!=''"> order by rand() </if>
@@ -120,6 +126,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="excellIssueName != null  and excellIssueName != ''"> and excell_issue_name like concat('%', #{excellIssueName}, '%')</if>
             <if test="classIssueName != null  and classIssueName != ''"> and class_issue_name like concat('%', #{classIssueName}, '%')</if>
             <if test="questionType != null "> and question_type = #{questionType}</if>
+            <if test="chapterId != null  and chapterId != ''"> and chapter_id = #{chapterId}</if>
+            <if test="diffDegree != null  and diffDegree != ''"> and diff_degree = #{diffDegree}</if>
         </where>
         limit 0,50
     </select>
@@ -321,6 +329,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
 
+    <select id="selectIssueType5"  resultType="com.miaxis.question.vo.QuestionInfoExcelTypeVo">
+        SELECT
+            DISTINCT case WHEN seque_issue_name is null then '地方专题' else seque_issue_name end as title,
+                     seque_issue as type_id
+        FROM
+            question_info
+        WHERE
+            subject = #{subject}
+          AND lice_car = 1 and
+            seque_issue_name is not null
+        ORDER BY
+            seque_issue + 0 ASC
+    </select>
+
+
+    <select id="selecQuestionInfoExcel5"  resultType="com.miaxis.question.vo.QuestionInfoExcelVo">
+        SELECT id,
+               id_ydt,
+            number,
+            issue,
+            image,
+            excell_issue_name,
+            class_issue_name,
+            place_issue_name,
+            seque_issue_name,
+            question_type  FROM question_info WHERE  seque_issue  = #{typeId} and subject_1 =1 and lice_car = 1
+    </select>
+
+
     <select id="selectQuestionInfoSortList"  resultType="com.miaxis.question.vo.QuestionInfoExcelVo">
         SELECT id,
              id_ydt,
@@ -384,14 +421,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectFreeQuestionInfoList"   resultMap="QuestionInfoResult">
-        select * from question_info
+        select q1.* from question_info q1 join question_free q2 on q1.id = q2.id
         <where>
-            and excell_issue_name like '%选学%'
-            and lice_car = 1
-            <if test="subject != null"> and subject = #{subject}</if>
-            <if test="questionType != null"> and question_type = #{questionType}</if>
+            <if test="subject != null"> and q2.subject = #{subject}</if>
         </where>
-        ORDER BY id limit 0,${num}
+         order by q2.free_sort
     </select>