From d470757bba19143fd3fc441365fcbb2362dfd0f0 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期六, 11 五月 2024 18:04:39 +0800
Subject: [PATCH] 个人练习

---
 src/main/resources/mapper/SelfPracticeMapper.xml |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mapper/SelfPracticeMapper.xml b/src/main/resources/mapper/SelfPracticeMapper.xml
index cb25add..a713dd3 100644
--- a/src/main/resources/mapper/SelfPracticeMapper.xml
+++ b/src/main/resources/mapper/SelfPracticeMapper.xml
@@ -5,9 +5,9 @@
 
     <insert id="add" keyColumn="id" useGeneratedKeys="true" parameterType="com.mindskip.xzs.domain.SelfPractice">
         INSERT INTO
-            t_self_practice(user_id, remark, subjects, practice_type, create_time, update_time, deleted)
+            t_self_practice(user_id, remark, subjects, practice_type, create_time, update_time, question_num, deleted)
         VALUE
-            (#{userId}, #{remark}, #{subjects}, #{practiceType}, #{createTime}, #{updateTime}, #{deleted})
+            (#{userId}, #{remark}, #{subjects}, #{practiceType}, #{createTime}, #{updateTime}, #{questionNum}, #{deleted})
     </insert>
 
     <select id="page" resultType="com.mindskip.xzs.domain.vo.SelfPracticeVO">
@@ -18,7 +18,9 @@
                subjects as subjectString,
                practice_type as practiceType,
                create_time createTime,
-               update_time as updateTime
+               update_time as updateTime,
+               question_num as questionNum,
+               question_ids as questionIds
         FROM
              t_self_practice
         <where>
@@ -37,5 +39,26 @@
               id IN <foreach collection="ids" open="(" separator="," close=")" item="id">#{id}</foreach>
     </update>
 
+    <select id="selectById" resultType="com.mindskip.xzs.domain.SelfPractice">
+        SELECT
+            id,
+            user_id as userId,
+            remark,
+            subjects as subjects,
+            practice_type as practiceType,
+            create_time createTime,
+            update_time as updateTime,
+            question_num as questionNum,
+            question_ids as questionIds
+        FROM
+             t_self_practice
+        WHERE
+              id = #{id}
+    </select>
+
+    <update id="setQuestionIds">
+        UPDATE t_self_practice SET question_ids = #{questionIds} WHERE id = #{id}
+    </update>
+
 
 </mapper>

--
Gitblit v1.8.0