Browse Source

试题栏移除听力题

tags/正式版本
王宁 2 years ago
parent
commit
a0a6162b71

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/question/UserBasketMapper.java View File

@@ -25,6 +25,8 @@ public interface UserBasketMapper extends TkMapper<TUserBasket> {
25 25
      * @return java.lang.Integer
26 26
      **/
27 27
     Integer deleteByTypeId(@Param("userid") Integer userid, @Param("qtypeid") String qtypeid);
28
+    //删除听力题
29
+    Integer deleteTlt(@Param("userid") Integer userid);
28 30
 
29 31
     /**
30 32
      * 列表

+ 6
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/UserBasketService.java View File

@@ -122,6 +122,11 @@ public class UserBasketService {
122 122
      * @return java.lang.Integer
123 123
      **/
124 124
     public Integer deleteByTypeId(Integer userid, String qtypeid) {
125
-        return userBasketMapper.deleteByTypeId(userid, qtypeid);
125
+        if(qtypeid.equals("tlt")){
126
+            //删除用户试题栏中听力题(试题标识为听力文件的试题)
127
+           return userBasketMapper.deleteTlt(userid);
128
+        }else{
129
+           return userBasketMapper.deleteByTypeId(userid, qtypeid);
130
+        }
126 131
     }
127 132
 }

+ 4
- 0
sstudy/src/main/resources/mapper/question/UserBasketMapper.xml View File

@@ -79,6 +79,10 @@
79 79
     <delete id="deleteByTypeId">
80 80
         delete from t_user_basket where userid=#{userid} and qtypeid=#{qtypeid}
81 81
     </delete>
82
+    <delete id="deleteTlt">
83
+        delete u.* from t_user_basket u,t_question q where u.questionid=q.questionid and u.userid=#{userid} and q.hashear=1
84
+    </delete>
85
+
82 86
     <!--获取用户试题篮id-->
83 87
     <select id="getUbidByUserIdQuestionId" resultType="java.lang.Integer">
84 88
         select ubid from t_user_basket where userid=#{userid} and questionid=#{questionid} limit 1

Loading…
Cancel
Save