Browse Source

Merge branch 'master' of ssh://1.15.26.233:10022/miaxis/twzd

Althars123 3 years ago
parent
commit
b5c55ffe8c

+ 17 - 6
twzd-admin/src/main/java/com/miaxis/app/controller/h5/QuestionInfoController.java

@@ -129,8 +129,8 @@ public class QuestionInfoController extends BaseController{
      */
     @GetMapping(value = "/selectJxQustionInfo")
     @ApiOperation("获取精选题分类")
-    public List<QuestionInfoJxVO> selectJxQuestionInfo(@ModelAttribute QuestionInfoFlDTO questionInfoFlDTO) {
-        return questionInfoService.selectJxQuestionInfo(questionInfoFlDTO);
+    public Response<List<QuestionInfoJxVO>> selectJxQuestionInfo(@ModelAttribute QuestionInfoFlDTO questionInfoFlDTO) {
+        return Response.success(questionInfoService.selectJxQuestionInfo(questionInfoFlDTO));
     }
 
 
@@ -139,8 +139,8 @@ public class QuestionInfoController extends BaseController{
      */
     @GetMapping(value = "/selectDfQustionInfo")
     @ApiOperation("获取地方题分类")
-    public List<QuestionInfoDfVO> selectDfQuestionInfo(@ModelAttribute QuestionInfoFlDTO questionInfoFlDTO) {
-        return questionInfoService.selectDfQuestionInfo(questionInfoFlDTO);
+    public Response<List<QuestionInfoDfVO>> selectDfQuestionInfo(@ModelAttribute QuestionInfoFlDTO questionInfoFlDTO) {
+        return Response.success(questionInfoService.selectDfQuestionInfo(questionInfoFlDTO));
     }
 
     /**
@@ -148,8 +148,8 @@ public class QuestionInfoController extends BaseController{
      */
     @GetMapping(value = "/selectFlQustionInfo")
     @ApiOperation("获取分类专题分类")
-    public List<QuestionInfoFlVO> selectFlQuestionInfo(@ModelAttribute QuestionInfoFlDTO questionInfoFlDTO) {
-        return questionInfoService.selectFlQuestionInfo(questionInfoFlDTO);
+    public Response<List<QuestionInfoFlVO>> selectFlQuestionInfo(@ModelAttribute QuestionInfoFlDTO questionInfoFlDTO) {
+        return Response.success(questionInfoService.selectFlQuestionInfo(questionInfoFlDTO));
     }
 
     /**
@@ -184,5 +184,16 @@ public class QuestionInfoController extends BaseController{
         List<QuestionInfo> list = questionInfoService.selectTestQuestionInfo(questionInfoTestDTO);
         return toResponsePageInfo(list);
     }
+
+
+    /**
+     * 查询模拟考试题库
+     */
+    @GetMapping("/selectFreeQuestionInfo")
+    @ApiOperation("查询免费题库")
+    public ResponsePageInfo<QuestionInfo> selectFreeQuestionInfo(){
+        List<QuestionInfo> list = questionInfoService.selectFreeQuestionInfo();
+        return toResponsePageInfo(list);
+    }
 }
 

+ 27 - 0
twzd-service/src/main/java/com/miaxis/question/dto/QuestionInfoFreeDTO.java

@@ -0,0 +1,27 @@
+package com.miaxis.question.dto;
+
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 地方题选分类返回对象
+ * @author miaxis
+ * @date 2021-10-20
+ */
+@Data
+@ApiModel(value = "QuestionInfoTestDTO", description = "模拟考试输入对象")
+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;
+}

+ 2 - 0
twzd-service/src/main/java/com/miaxis/question/mapper/QuestionInfoMapper.java

@@ -55,4 +55,6 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
     void updateSortById(QuestionInfoSortUpateDTO dto);
 
     List<QuestionInfo> selectTestQuestionInfoList(QuestionInfoTestDTO questionInfoTestDTO);
+
+    List<QuestionInfo> selectFreeQuestionInfoList(QuestionInfoFreeDTO freeDTO);
 }

+ 2 - 0
twzd-service/src/main/java/com/miaxis/question/service/IQuestionInfoService.java

@@ -41,5 +41,7 @@ public interface IQuestionInfoService extends IService<QuestionInfo>{
     List<QuestionInfoExcelTypeVo> getIssueTypes(int issueTypeValue, Integer typeValue);
 
     List<QuestionInfo> selectTestQuestionInfo(QuestionInfoTestDTO questionInfoTestDTO);
+
+    List<QuestionInfo> selectFreeQuestionInfo();
 }
 

+ 19 - 1
twzd-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

@@ -170,9 +170,27 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
                 return list1;
             }
         }
+        return null;
+    }
 
 
-        return null;
+    @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;
     }
 
+
+
 }

+ 10 - 1
twzd-service/src/main/resources/mapper/qustion/QuestionInfoMapper.xml

@@ -360,7 +360,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
 
-
+    <select id="selectFreeQuestionInfoList"   resultMap="QuestionInfoResult">
+        select * from question_info
+        <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>
+        </where>
+        ORDER BY id limit 0,${num}
+    </select>
 
 
 </mapper>