|
@@ -239,6 +239,9 @@
|
|
|
left join (select count(1) as num,af.album_id_ from album_favorite af
|
|
|
group by af.album_id_
|
|
|
) t2 on t2.album_id_ = t.id_
|
|
|
+ <if test="clientType != null and query.userId != null">
|
|
|
+ left join music_sheet_purchase_record t3 on t3.music_sheet_id_ = t.id_ and t3.client_type_ = #{clientType} and t3.student_id_ = #{query.userId}
|
|
|
+ </if>
|
|
|
<where>
|
|
|
t.del_flag_ = 0
|
|
|
<if test="query.idAndName != null and query.idAndName != ''">
|
|
@@ -264,7 +267,12 @@
|
|
|
and t.audit_version_ = #{query.auditVersion}
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by t.sort_number_ desc
|
|
|
+ order by
|
|
|
+ <if test="clientType != null and query.userId != null">
|
|
|
+ field(t3.id_,null,t3.id_) desc,
|
|
|
+ </if>
|
|
|
+
|
|
|
+ t.sort_number_ desc
|
|
|
<if test="query.sortBy != null">
|
|
|
<choose>
|
|
|
<when test="query.sortBy == 1">
|