Ver código fonte

三力批量取题

小么熊🐻 2 anos atrás
pai
commit
67560a0afc

+ 12 - 1
jpcj-admin/src/main/java/com/miaxis/pc/controller/question/PcThreeForceController.java

@@ -1,6 +1,5 @@
 package com.miaxis.pc.controller.question;
 
-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;
@@ -63,5 +62,17 @@ public class PcThreeForceController extends BaseController {
         return toResponsePageInfo(list);
     }
 
+    /**
+     * 获取三力题库详细信息多个题库
+     */
+    @GetMapping(value = "/getThreeForceListIds")
+    @ApiOperation("获取三力题库详细信息批量取题")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids",value = "题目ids" ,dataType = "List", required = true)})
+    public ResponsePageInfo<ThreeForce> getThreeForceListIds(Long[] ids){
+        List<ThreeForce> list = threeForceService.selectThreeForceListIds(ids);
+        return toResponsePageInfo(list);
+    }
+
 
 }

+ 3 - 1
jpcj-service/src/main/java/com/miaxis/three/mapper/ThreeForceMapper.java

@@ -18,7 +18,9 @@ public interface ThreeForceMapper extends BaseMapper<ThreeForce> {
      * @param threeForce 三力测试
      * @return 三力测试集合
      */
-    public List<ThreeForce> selectThreeForceList(ThreeForce threeForce);
+    List<ThreeForce> selectThreeForceList(ThreeForce threeForce);
 
     List<ThreeForce> selectTestQuestionInfoList(String sql);
+
+    List<ThreeForce> selectThreeForceListIds(Long[] ids);
 }

+ 3 - 1
jpcj-service/src/main/java/com/miaxis/three/service/IThreeForceService.java

@@ -18,7 +18,9 @@ public interface IThreeForceService extends IService<ThreeForce>{
      * @param threeForce 三力测试
      * @return 三力测试集合
      */
-    public List<ThreeForce> selectThreeForceList(ThreeForce threeForce);
+    List<ThreeForce> selectThreeForceList(ThreeForce threeForce);
 
     List<ThreeForce> selectTestQuestionInfoList();
+
+    List<ThreeForce> selectThreeForceListIds(Long[] ids);
 }

+ 5 - 0
jpcj-service/src/main/java/com/miaxis/three/service/impl/ThreeForceServiceImpl.java

@@ -71,4 +71,9 @@ public class ThreeForceServiceImpl extends ServiceImpl<ThreeForceMapper, ThreeFo
             return null;
         }
     }
+
+    @Override
+    public List<ThreeForce> selectThreeForceListIds(Long[] ids) {
+        return threeForceMapper.selectThreeForceListIds(ids);
+    }
 }

+ 17 - 1
jpcj-service/src/main/resources/mapper/three/ThreeForceMapper.xml

@@ -43,7 +43,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select * from three_force
     </sql>
 
-    <select id="selectThreeForceList" parameterType="ThreeForce" resultMap="ThreeForceResult">
+
+    <select id="selectThreeForceListIds" parameterType="Long" resultMap="ThreeForceResult">
+        <include refid="selectThreeForceVo"/>
+        <where>
+            and id in
+            <foreach collection="array" item="id" index="index" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </where>
+        order by FIELD(id,
+        <foreach collection="array" item="id" index="index" open="" close="" separator=",">
+            #{id}
+        </foreach>
+        )
+    </select>
+
+    <select id="selectThreeForceList" parameterType="com.miaxis.three.domain.ThreeForce" resultMap="ThreeForceResult">
         <include refid="selectThreeForceVo"/>
         <where>
             <if test="id != null "> and ID = #{id}</if>