Explorar el Código

错题 收藏排序

zhangbin hace 1 año
padre
commit
a16ad4486d

+ 6 - 1
nbjk-service/src/main/java/com/miaxis/question/dto/QuestionCollectionListDTO.java

@@ -24,7 +24,12 @@ public class QuestionCollectionListDTO  {
 
 
     /** 科目 */
-    @ApiModelProperty(value = "考试科目(1、2、3、4、9)")
+    @ApiModelProperty(value = "考试科目(1、2、3、4、8、9)")
     private Integer km;
 
+
+    /** 排序 */
+    @ApiModelProperty(value = "排序 0正 1反")
+    private Integer sort;
+
 }

+ 4 - 2
nbjk-service/src/main/java/com/miaxis/question/dto/QuestionWrongListDTO.java

@@ -18,9 +18,11 @@ public class QuestionWrongListDTO  {
     private Long userId;
 
     /** 科目 */
-    @ApiModelProperty(value = "考试科目(1、2、3、4)")
+    @ApiModelProperty(value = "考试科目(1、2、3、4、8、9)")
     private Integer km;
 
-
+    /** 排序 */
+    @ApiModelProperty(value = "排序 0正 1反")
+    private Integer sort;
 
 }

+ 12 - 2
nbjk-service/src/main/resources/mapper/question/QuestionCollectionMapper.xml

@@ -58,8 +58,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null and userId !='' "> and q2.user_id = #{userId}</if>
             <if test="km != null and km!='' "> and q2.km = #{km}</if>
         </where>
-        order by q2.create_time asc
-
+        order by q2.create_time
+        <choose>
+            <when test="sort==0">
+                asc
+            </when>
+            <when test="sort==1">
+                desc
+            </when>
+            <otherwise>
+                asc
+            </otherwise>
+        </choose>
     </select>
 
 

+ 11 - 0
nbjk-service/src/main/resources/mapper/question/QuestionWrongMapper.xml

@@ -57,6 +57,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="km != null and km!='' "> and q2.km = #{km}</if>
         </where>
         order by q2.create_time
+        <choose>
+            <when test="sort==0">
+                asc
+            </when>
+            <when test="sort==1">
+                desc
+            </when>
+            <otherwise>
+                asc
+            </otherwise>
+        </choose>
     </select>