|
@@ -1350,13 +1350,44 @@
|
|
|
where id_ = #{musicSheetId}
|
|
|
</update>
|
|
|
|
|
|
+ <select id="musicSheetTotal"
|
|
|
+ resultType="com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper$MusicSheetTotal">
|
|
|
+ select
|
|
|
+ if(t.audit_status_ = 'PASS' and t.state_ = 1,1,0) as musicSheetNum,
|
|
|
+ if(t.audit_status_ = 'DOING' ,1,0) musicSheetAuditNum,
|
|
|
+ t.exposure_num_ musicSheetExposureNum
|
|
|
+ from music_sheet t
|
|
|
+ where t.del_flag_=0 and t.user_id_ = #{teacherId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="musicSheetPage"
|
|
|
+ resultType="com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper$MusicSheetTotal">
|
|
|
+ select
|
|
|
+ t.music_sheet_name_ musicSheetName,
|
|
|
+ t.create_time_ createTime,
|
|
|
+ t.exposure_num_ musicSheetExposureNum,
|
|
|
+ count(distinct t1.buy_user_) musicSheetPayNum,
|
|
|
+ sum(t1.trans_amount_) as musicSheetIncome
|
|
|
+ from music_sheet t
|
|
|
+ left join user_cash_account_record t1 on t.id_ = t1.biz_id_
|
|
|
+ where t1.account_id_ = #{param.teacherId}
|
|
|
+ and t1.biz_type_ = 'MUSIC_SHARE'
|
|
|
+ and t1.post_status_ = 'RECORDED'
|
|
|
+ and t1.in_or_out_ = 'IN'
|
|
|
+ and t.del_flag_=0 and t.user_id_ = #{param.teacherId}
|
|
|
+ group by t.id_
|
|
|
+ order by t.create_time_ desc
|
|
|
+ limit #{param.rows}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="cloudPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.MusicSheetWrapper$MusicSheetCloud">
|
|
|
select t.id_, t.music_sheet_name_,t.title_img_,t.composer_,t.cbs_music_sheet_id_ ,t.payment_type_,t.music_price_ as musicPrice
|
|
|
from (
|
|
|
select a.* from
|
|
|
music_sheet a
|
|
|
<if test="param.providerType != null and param.providerType.code == 'TENANT'">
|
|
|
- left join tenant_album_music tam on a.id_ = tam.music_sheet_id_ and tam.del_flag_ = 0 and tam.tenant_album_id_ in
|
|
|
+ left join tenant_album_music tam on a.id_ = tam.music_sheet_id_ and tam.del_flag_ = 0 and tam.tenant_album_id_ in
|
|
|
<foreach collection="param.tenantAlbumIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -1462,7 +1493,7 @@
|
|
|
left join music_favorite mf on t.id_ = mf.music_sheet_id_ and mf.user_id_ = #{param.userId} and mf.client_type_ = #{param.clientType} and mf.provider_type_ = #{param.providerType}
|
|
|
</if>
|
|
|
<where>
|
|
|
-
|
|
|
+
|
|
|
<if test="param.favoriteFlag != null and param.favoriteFlag == 1">
|
|
|
and mf.id_ is not null
|
|
|
</if>
|
|
@@ -1482,7 +1513,7 @@
|
|
|
</if>
|
|
|
|
|
|
</if>
|
|
|
-
|
|
|
+
|
|
|
</where>
|
|
|
|
|
|
GROUP BY t.id_
|