瀏覽代碼

收藏排序

刘俊驰 7 月之前
父節點
當前提交
18c173c19f

+ 2 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/MusicSheetCbsController.java

@@ -144,6 +144,8 @@ public class MusicSheetCbsController extends BaseController {
         query.setDelFlag(false);
         query.setVersionFlag(appAuditVersion == YesOrNoEnum.YES);
         query.setStatus(true);
+        query.setUserId(student.getUserId());
+        query.setClientType(ClientEnum.STUDENT.name());
 
         // 如果是机构学生
         if (student.getTenantId() !=null && student.getTenantId()>0) {

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/MusicSheetWrapper.java

@@ -1008,6 +1008,10 @@ public class MusicSheetWrapper {
         @ApiModelProperty("是否最近练习")
         private Boolean recentFlag = false;
 
+
+        @ApiModelProperty("是否查看收藏")
+        private Boolean favoriteFlag = false;
+
         @ApiModelProperty("最近练习 当前曲目ID")
         private Long excludeMusicId;
 

+ 9 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -1343,11 +1343,17 @@
         <if test="param.albumId != null">
             left join tenant_album_music tam on t.id_ = tam.music_sheet_id_ and tam.del_flag_ = 0
         </if>
+        <if test="param.favoriteFlag != null and param.favoriteFlag == 1">
+            left join music_favorite mf on t.id_ = mf.music_sheet_id_ and mf.user_id_ = #{param.userId} and mf.client_type_ = #{param.clientType}
+        </if>
         <where>
             t.cbs_music_sheet_id_ is not null
             <if test="param.name != null and param.name != ''">
                 and t.music_sheet_name_ like concat('%',#{param.name},'%')
             </if>
+            <if test="param.favoriteFlag != null and param.favoriteFlag == 1">
+                and mf.id_ is not null
+            </if>
             <if test="param.status != null">
 
                 <if test="param.providerType != null">
@@ -1429,6 +1435,9 @@
             order by
             max(msar.create_time_) desc
         </if>
+        <if test="param.favoriteFlag != null and param.favoriteFlag == 1">
+            order by mf.id_ desc
+        </if>
         <if test="param.recentFlag == null">
             order by tam.level_,tam.type_,tam.sort_number_
         </if>