Kaynağa Gözat

修复最近曲目练习重复

Eric 2 yıl önce
ebeveyn
işleme
3bd715f5cd

+ 10 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/StudentMusicSheetSearch.java

@@ -32,6 +32,8 @@ public class StudentMusicSheetSearch  extends MusicSheetSearch{
     @ApiModelProperty(value = "平台")
     private String platform;
 
+    // 客户端类型
+    private ClientEnum clientType;
 
 
     public ClientEnum getUserType() {
@@ -82,4 +84,12 @@ public class StudentMusicSheetSearch  extends MusicSheetSearch{
     public void setStudentId(Long studentId) {
         this.studentId = studentId;
     }
+
+    public ClientEnum getClientType() {
+        return clientType;
+    }
+
+    public void setClientType(ClientEnum clientType) {
+        this.clientType = clientType;
+    }
 }

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/MusicSheetServiceImpl.java

@@ -381,6 +381,9 @@ public class MusicSheetServiceImpl extends ServiceImpl<MusicSheetDao, MusicSheet
             page.setRecords(new ArrayList<>());
             return page;
         }
+
+        // 设置学生端收藏联系
+        query.setClientType(ClientEnum.STUDENT);
         // 构建分页信息
         page.setRecords(baseMapper.selectPracticeMusicPage(query, practiceMusicIdList));
         page.setPages(practiceMusicIdPage.getPages());

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

@@ -398,7 +398,7 @@
         from music_sheet_practice_record mspr
         left join music_sheet t on mspr.music_sheet_id_ = t.id_
         left join sys_user su on t.create_by_ = su.id_
-        left join music_favorite mf on t.id_ = mf.music_sheet_id_ and mspr.user_id_ = mf.user_id_
+        left join music_favorite mf on (t.id_ = mf.music_sheet_id_ and mspr.user_id_ = mf.user_id_ <if test="param.clientType != null"> AND mf.client_type_ = #{param.clientType}</if> )
         <where>
             su.del_flag_ = 0
             <include refid="QueryInfo"/>