|
@@ -240,10 +240,17 @@
|
|
where find_in_set(s.id_,t.music_subject_) and s.del_flag_ = 0) as subjectNames
|
|
where find_in_set(s.id_,t.music_subject_) and s.del_flag_ = 0) as subjectNames
|
|
<if test="param.studentId != null">
|
|
<if test="param.studentId != null">
|
|
,if(mf.id_ is not null,1,0) as favorite
|
|
,if(mf.id_ is not null,1,0) as favorite
|
|
|
|
+ ,case when mspr.id_ is not null then 1
|
|
|
|
+ when t.charge_type_ = 'FREE' then 1
|
|
|
|
+ else 0 end as play
|
|
</if>
|
|
</if>
|
|
from music_sheet t
|
|
from music_sheet t
|
|
left join sys_user su on t.create_by_ = su.id_
|
|
left join sys_user su on t.create_by_ = su.id_
|
|
<if test="param.studentId != null">
|
|
<if test="param.studentId != null">
|
|
|
|
+ left join music_sheet_purchase_record mspr
|
|
|
|
+ on mspr.music_sheet_id_ = t.id_
|
|
|
|
+ and mspr.student_id_ = #{param.studentId}
|
|
|
|
+ and order_status_ = 'PAID'
|
|
left join music_favorite mf on t.id_ = mf.music_sheet_id_ and mf.user_id_ = #{param.studentId}
|
|
left join music_favorite mf on t.id_ = mf.music_sheet_id_ and mf.user_id_ = #{param.studentId}
|
|
</if>
|
|
</if>
|
|
<where>
|
|
<where>
|