Parcourir la source

导入题目完善

吴树波 il y a 1 semaine
Parent
commit
dee01d238f

+ 1 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseQuestionBankMapper.java

@@ -90,4 +90,5 @@ public interface FsCourseQuestionBankMapper
      * @return 结果
      */
     int updateFsCourseQuestionBankBatch(@Param("list") List<FsCourseQuestionBank> fsCourseQuestionBankList);
+    int updateFsCourseQuestionTitle(@Param("item") FsCourseQuestionBank item);
 }

+ 2 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsCourseQuestionBankServiceImpl.java

@@ -533,7 +533,8 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
 
         // 批量更新
         if (!updateList.isEmpty()) {
-            fsCourseQuestionBankMapper.updateFsCourseQuestionBankBatch(updateList);
+            updateList.forEach(fsCourseQuestionBankMapper::updateFsCourseQuestionTitle);
+//            fsCourseQuestionBankMapper.updateFsCourseQuestionBankBatch(updateList);
         }
 
         return result.buildResultMessage();

+ 15 - 0
fs-service/src/main/resources/mapper/course/FsCourseQuestionBankMapper.xml

@@ -165,4 +165,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             where title = #{item.title}
         </foreach>
     </update>
+    <update id="updateFsCourseQuestionTitle">
+        update fs_course_question_bank
+        <set>
+            <if test="item.sort != null">sort = #{item.sort},</if>
+            <if test="item.type != null">type = #{item.type},</if>
+            <if test="item.status != null">status = #{item.status},</if>
+            <if test="item.question != null">question = #{item.question},</if>
+            <if test="item.answer != null">answer = #{item.answer},</if>
+            <if test="item.createBy != null">create_by = #{item.createBy},</if>
+            <if test="item.questionType != null">question_type = #{item.questionType},</if>
+            <if test="item.questionSubType != null">question_sub_type = #{item.questionSubType},</if>
+            <if test="item.userId != null">user_id = #{item.userId},</if>
+        </set>
+        where title = #{item.title}
+    </update>
 </mapper>