Ver código fonte

fix:修复专辑能新增的曲目列表返回数据重复

liujunchi 3 anos atrás
pai
commit
9915c1a350

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

@@ -138,18 +138,19 @@
             <if test="param.state != null">
                 and t.state_ = #{param.state}
             </if>
+            <if test="param.delFlag != null">
+                and t.del_flag_ = #{param.delFlag}
+            </if>
             <if test="param.id != null">
                 <if test="param.type == 2">
                     and amr.album_id_ = #{param.id}
                     order by amr.create_time_
                 </if>
                 <if test="param.type == 1">
-                    and (amr.album_id_ &lt;&gt;  #{param.id} or amr.album_id_ is null)
+                    and not exists(select amr2.music_sheet_id_  from album_music_relate amr2
+                        where amr2.album_id_ = #{param.id} and t.id_ = amr2.music_sheet_id_)
                 </if>
             </if>
-            <if test="param.delFlag != null">
-                and t.del_flag_ = #{param.delFlag}
-            </if>
         </where>
     </select>