|
@@ -41,6 +41,12 @@
|
|
|
<result column="provider_type_" jdbcType="VARCHAR" property="providerType"/>
|
|
|
<result column="cbs_music_sheet_id_" property="cbsMusicSheetId"/>
|
|
|
<result column="score_type_" property="scoreType"/>
|
|
|
+ <result column="tenant_sort_number_" property="tenantSortNumber"/>
|
|
|
+ <result column="tenant_state_" property="tenantState"/>
|
|
|
+ <result column="tenant_notation_" property="tenantNotation"/>
|
|
|
+ <result column="tenant_category_id_" property="tenantCategoryId"/>
|
|
|
+ <result column="tenant_score_type_" property="tenantScoreType"/>
|
|
|
+ <result column="tenant_del_flag_" property="tenantCategoryId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
@@ -94,7 +100,13 @@
|
|
|
t.audit_status_ as auditStatus,
|
|
|
t.submit_audit_time_ as submitAuditTime,
|
|
|
t.cbs_music_sheet_id_ as cbsMusicSheetId,
|
|
|
- t.score_type_ as scoreType
|
|
|
+ t.score_type_ as scoreType,
|
|
|
+ t.tenant_sort_number_ as tenantSortNumber,
|
|
|
+ t.tenant_state_ as tenantState,
|
|
|
+ t.tenant_notation_ as tenantNotation,
|
|
|
+ t.tenant_category_id_ as tenantCategoryId,
|
|
|
+ t.tenant_score_type_ as tenantScoreType,
|
|
|
+ t.tenant_del_flag_ as tenantDelFlag
|
|
|
</sql>
|
|
|
<insert id="batchInsert">
|
|
|
insert into music_sheet
|
|
@@ -204,7 +216,7 @@
|
|
|
t.composer_ like concat ('%',#{param.search},'%'))
|
|
|
</if>
|
|
|
<if test="param.providerType != null">
|
|
|
- and t.provider_type_ = #{param.providerType}
|
|
|
+ and find_in_set(#{param.providerType},t.provider_type_)
|
|
|
</if>
|
|
|
<if test="param.musicTagIds != null and param.musicTagIds != ''">
|
|
|
and
|
|
@@ -231,7 +243,21 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="param.state != null">
|
|
|
- and t.state_ = #{param.state}
|
|
|
+
|
|
|
+ <if test="param.providerType != null">
|
|
|
+ <if test="param.providerType == 'TENANT'">
|
|
|
+ and t.tenant_state_ = #{param.state}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="param.providerType == 'PLATFORM'">
|
|
|
+ and t.state_ = #{param.state}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="param.providerType == null">
|
|
|
+ and t.state_ = #{param.state}
|
|
|
+ </if>
|
|
|
+
|
|
|
</if>
|
|
|
<if test="param.auditStatus != null">
|
|
|
and msar.last_audit_state_ = #{param.auditStatus}
|
|
@@ -243,7 +269,20 @@
|
|
|
and t.create_by_ = #{param.createBy}
|
|
|
</if>
|
|
|
<if test="param.delFlag != null">
|
|
|
- and t.del_flag_ = #{param.delFlag}
|
|
|
+ <if test="param.providerType != null">
|
|
|
+ <if test="param.providerType == 'TENANT'">
|
|
|
+ and t.tenant_del_flag_ = #{param.delFlag}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="param.providerType == 'PLATFORM'">
|
|
|
+ and t.del_flag_ = #{param.delFlag}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="param.providerType == null">
|
|
|
+ and t.del_flag_ = #{param.delFlag}
|
|
|
+ </if>
|
|
|
+
|
|
|
</if>
|
|
|
<if test="param.sourceType != null">
|
|
|
and t.source_type_ = #{param.sourceType}
|
|
@@ -283,7 +322,7 @@
|
|
|
AND t.composer_ LIKE '%${param.composer}%'
|
|
|
</if>
|
|
|
<if test="param.providerType != null">
|
|
|
- and t.provider_type_ = #{param.providerType}
|
|
|
+ and find_in_set(#{param.providerType},t.provider_type_)
|
|
|
</if>
|
|
|
<if test="param.idAndName != null and param.idAndName != ''">
|
|
|
and (t.id_ like concat('%',#{param.idAndName},'%') or
|
|
@@ -435,6 +474,12 @@
|
|
|
<result column="musicFirstSvg" jdbcType="VARCHAR" property="musicFirstSvg"/>
|
|
|
<result column="musicSheetType" jdbcType="VARCHAR" property="musicSheetType"/>
|
|
|
<result column="musicSheetJson" jdbcType="VARCHAR" property="musicSheetJson"/>
|
|
|
+ <result column="tenantSortNumber" jdbcType="VARCHAR" property="tenantSortNumber"/>
|
|
|
+ <result column="tenantState" jdbcType="VARCHAR" property="tenantState"/>
|
|
|
+ <result column="tenantNotation" jdbcType="VARCHAR" property="tenantNotation"/>
|
|
|
+ <result column="tenantCategoryId" jdbcType="VARCHAR" property="tenantCategoryId"/>
|
|
|
+ <result column="tenantScoreType" jdbcType="VARCHAR" property="tenantScoreType"/>
|
|
|
+ <result column="tenantDelFlag" jdbcType="VARCHAR" property="tenantDelFlag"/>
|
|
|
<collection property="background" ofType="com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment">
|
|
|
<id column="accompanimentId" jdbcType="BIGINT" property="id"/>
|
|
|
<result column="accompanimentMusicSheetId" jdbcType="BIGINT" property="musicSheetId"/>
|
|
@@ -940,10 +985,28 @@
|
|
|
</foreach>
|
|
|
</update>
|
|
|
<update id="batchEnable">
|
|
|
- update music_sheet set state_ = #{status} where FIND_IN_SET(cbs_music_sheet_id_,#{ids})
|
|
|
+ update music_sheet
|
|
|
+ <set>
|
|
|
+ <if test="tenantFlag == 1">
|
|
|
+ tenant_state_ = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="tenantFlag == 0">
|
|
|
+ state_ = #{status}
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where FIND_IN_SET(cbs_music_sheet_id_,#{ids})
|
|
|
</update>
|
|
|
<update id="batchDel">
|
|
|
- update music_sheet set del_flag_ = 1 where FIND_IN_SET(cbs_music_sheet_id_,#{ids})
|
|
|
+ update music_sheet
|
|
|
+ <set>
|
|
|
+ <if test="tenantFlag == 1">
|
|
|
+ tenant_del_flag_ = 1,
|
|
|
+ </if>
|
|
|
+ <if test="tenantFlag == 0">
|
|
|
+ del_flag_ = 1
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where FIND_IN_SET(cbs_music_sheet_id_,#{ids})
|
|
|
</update>
|
|
|
<update id="updateMusicSheet">
|
|
|
update music_sheet
|
|
@@ -951,7 +1014,7 @@
|
|
|
composer_ = #{param.composer},title_img_ = #{param.musicCover},music_img_ = #{param.musicCover},accompaniment_type_ = #{param.audioType},
|
|
|
play_speed_ = #{param.playSpeed},is_all_subject_ = #{param.isAllSubject},
|
|
|
music_sheet_type_ = #{param.musicSheetType},source_type_ = CASE WHEN #{param.sourceType} = 'PLATFORM' THEN 'PLATFORM' ELSE 'TEACHER' END,
|
|
|
- create_by_ = #{param.userId}
|
|
|
+ create_by_ = #{param.userId},tenant_category_id_ = #{param.musicCategoryId}
|
|
|
where cbs_music_sheet_id_ = #{param.id}
|
|
|
</update>
|
|
|
|
|
@@ -987,7 +1050,7 @@
|
|
|
and tam.subject_type_ in ('ENSEMBLE', 'MUSIC', 'SUBJECT')
|
|
|
</if>
|
|
|
<if test="param.providerType != null">
|
|
|
- and t.provider_type_ = #{param.providerType}
|
|
|
+ and find_in_set(#{param.providerType},t.provider_type_)
|
|
|
</if>
|
|
|
</where>
|
|
|
order by t.top_flag_ desc, t.sort_number_ desc, t.favorite_count_ desc
|
|
@@ -1057,7 +1120,7 @@
|
|
|
from music_sheet t
|
|
|
left join tenant_album_music t1 on t1.music_sheet_id_ = t.id_
|
|
|
<where>
|
|
|
- t.del_flag_ = 0 and t.state_ =1 and t.audit_status_ = 'PASS' and t.cbs_music_sheet_id_ is not null
|
|
|
+ t.tenant_del_flag_ = 0 and t.tenant_state_ =1 and t.cbs_music_sheet_id_ is not null
|
|
|
and t1.del_flag_=0 and t1.subject_type_ in ('ENSEMBLE', 'MUSIC', 'SUBJECT')
|
|
|
<if test="queryInfo.albumId != null">
|
|
|
and t1.tenant_album_id_ = #{queryInfo.albumId}
|
|
@@ -1078,5 +1141,130 @@
|
|
|
</where>
|
|
|
|
|
|
</select>
|
|
|
+
|
|
|
+ <update id="updateTenantByCbsId">
|
|
|
+ update music_sheet ms set
|
|
|
+ ms.tenant_sort_number_ = #{item.sortNo},ms.tenant_del_flag_ = 0,
|
|
|
+ ms.tenant_score_type_ = #{item.scoreType},
|
|
|
+ ms.audit_status_ = 'PASS',
|
|
|
+ ms.tenant_state_ = #{item.status},
|
|
|
+ ms.tenant_notation_ = #{item.isConvertibleScore},
|
|
|
+ ms.provider_type_ = CASE WHEN ms.provider_type_ is null or ms.provider_type_ = '' THEN 'PLATFORM'
|
|
|
+ when find_in_set(#{item.availableType},ms.provider_type_) then ms.provider_type_
|
|
|
+ else concat(ms.provider_type_,',',#{item.availableType}) end
|
|
|
+ <if test="item.musicSheetUpdate != null">
|
|
|
+ ,ms.music_sheet_name_ = #{item.musicSheetUpdate.name},
|
|
|
+ ms.music_subject_ = #{item.musicSheetUpdate.subjectIds},
|
|
|
+ ms.music_svg_ = #{item.musicSheetUpdate.musicSvg},
|
|
|
+ ms.composer_ = #{item.musicSheetUpdate.composer},
|
|
|
+ ms.accompaniment_type_ = #{item.musicSheetUpdate.audioType},
|
|
|
+ ms.play_speed_ = #{item.musicSheetUpdate.playSpeed},
|
|
|
+ ms.music_sheet_type_ = #{item.musicSheetUpdate.musicSheetType},
|
|
|
+ ms.create_by_ = #{item.musicSheetUpdate.userId},
|
|
|
+ ms.audio_type_ = #{item.musicSheetUpdate.playMode},
|
|
|
+ ms.tenant_category_id_ = #{item.musicSheetUpdate.musicCategoryId},
|
|
|
+ ms.show_fingering_ = #{item.musicSheetUpdate.showFingering},
|
|
|
+ ms.can_evaluate_ = #{item.musicSheetUpdate.canEvaluate},
|
|
|
+ ms.upload_time_ = #{item.musicSheetUpdate.createTime},
|
|
|
+ ms.source_type_ = CASE WHEN #{item.musicSheetUpdate.sourceType} = 'PLATFORM' THEN 'PLATFORM'
|
|
|
+ WHEN #{item.musicSheetUpdate.sourceType} = 'PERSON' THEN 'TEACHER' ELSE 'TENANT' END
|
|
|
+ </if>
|
|
|
+ where ms.cbs_music_sheet_id_ = #{item.musicSheetId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updatePlatformByCbsId">
|
|
|
+ update music_sheet ms set
|
|
|
+ ms.music_tag_ = #{item.musicTagIds},ms.payment_type_ = #{item.paymentType},
|
|
|
+ ms.charge_type_ = #{item.paymentType},
|
|
|
+ ms.music_price_ = #{item.musicPrice},ms.top_flag_ = #{item.topFlag},
|
|
|
+ ms.exquisite_flag_ = #{item.exquisiteFlag},ms.sort_number_ = #{item.sortNo},ms.del_flag_ = 0,
|
|
|
+ ms.audit_status_ = 'PASS',
|
|
|
+ ms.score_type_ = #{item.scoreType},
|
|
|
+ ms.state_ = #{item.status},
|
|
|
+ ms.notation_ = #{item.isConvertibleScore},
|
|
|
+ ms.provider_type_ = CASE WHEN ms.provider_type_ is null or ms.provider_type_ = '' THEN 'PLATFORM'
|
|
|
+ when find_in_set(#{item.availableType},ms.provider_type_) then ms.provider_type_
|
|
|
+ else concat(ms.provider_type_,',',#{item.availableType}) end
|
|
|
+ <if test="item.musicSheetUpdate != null">
|
|
|
+ ,ms.music_sheet_name_ = #{item.musicSheetUpdate.name},
|
|
|
+ ms.music_subject_ = #{item.musicSheetUpdate.subjectIds},
|
|
|
+ ms.music_svg_ = #{item.musicSheetUpdate.musicSvg},
|
|
|
+ ms.composer_ = #{item.musicSheetUpdate.composer},
|
|
|
+ ms.accompaniment_type_ = #{item.musicSheetUpdate.audioType},
|
|
|
+ ms.play_speed_ = #{item.musicSheetUpdate.playSpeed},
|
|
|
+ ms.notation_ = #{item.musicSheetUpdate.notation},
|
|
|
+ ms.music_sheet_type_ = #{item.musicSheetUpdate.musicSheetType},
|
|
|
+ ms.create_by_ = #{item.musicSheetUpdate.userId},
|
|
|
+ ms.audio_type_ = #{item.musicSheetUpdate.playMode},
|
|
|
+ ms.show_fingering_ = #{item.musicSheetUpdate.showFingering},
|
|
|
+ ms.can_evaluate_ = #{item.musicSheetUpdate.canEvaluate},
|
|
|
+ ms.source_type_ = CASE WHEN #{item.musicSheetUpdate.sourceType} = 'PLATFORM' THEN 'PLATFORM'
|
|
|
+ WHEN #{item.musicSheetUpdate.sourceType} = 'PERSON' THEN 'TEACHER' ELSE 'TENANT' END
|
|
|
+ </if>
|
|
|
+ where ms.cbs_music_sheet_id_ = #{item.musicSheetId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <insert id="tenantInsert">
|
|
|
+ insert into music_sheet
|
|
|
+ (cbs_music_sheet_id_,tenant_sort_number_,tenant_score_type_,tenant_state_,tenant_notation_,tenant_category_id_
|
|
|
+ ,music_sheet_name_,music_subject_,music_svg_,composer_,accompaniment_type_,play_speed_,
|
|
|
+ music_sheet_type_,provider_type_,audio_type_,show_fingering_,
|
|
|
+ can_evaluate_,create_by_,user_id_,audit_status_,upload_time_
|
|
|
+ )
|
|
|
+ values
|
|
|
+ (#{item.musicSheetId},
|
|
|
+ #{item.sortNo},#{item.scoreType},#{item.status},#{item.isConvertibleScore}
|
|
|
+ ,#{item.musicSheetUpdate.musicCategoryId}
|
|
|
+ ,#{item.musicSheetUpdate.name},
|
|
|
+ #{item.musicSheetUpdate.subjectIds},
|
|
|
+ #{item.musicSheetUpdate.musicSvg},
|
|
|
+ #{item.musicSheetUpdate.composer},
|
|
|
+ #{item.musicSheetUpdate.audioType},
|
|
|
+ #{item.musicSheetUpdate.playSpeed},
|
|
|
+ #{item.musicSheetUpdate.musicSheetType},
|
|
|
+ 'TENANT',
|
|
|
+ #{item.musicSheetUpdate.playMode},
|
|
|
+ #{item.musicSheetUpdate.showFingering},
|
|
|
+ #{item.musicSheetUpdate.canEvaluate},
|
|
|
+ #{item.musicSheetUpdate.userId},
|
|
|
+ #{item.musicSheetUpdate.userId},
|
|
|
+ 'PASS',
|
|
|
+
|
|
|
+ #{item.musicSheetUpdate.createTime}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="platformInsert">
|
|
|
+ insert into music_sheet
|
|
|
+ (cbs_music_sheet_id_,music_tag_,payment_type_,charge_type_,top_flag_,exquisite_flag_,sort_number_,state_,audit_status_
|
|
|
+ ,music_sheet_name_,music_subject_,music_svg_,composer_,accompaniment_type_,play_speed_,
|
|
|
+ music_price_,notation_,music_sheet_type_,source_type_,provider_type_,audio_type_,show_fingering_,
|
|
|
+ can_evaluate_,create_by_,user_id_,score_type_
|
|
|
+ )
|
|
|
+ values
|
|
|
+ (#{item.musicSheetId},
|
|
|
+ #{item.musicTagIds},#{item.paymentType},#{item.paymentType},
|
|
|
+ #{item.topFlag},#{item.exquisiteFlag},#{item.sortNo},0
|
|
|
+ ,'PASS'
|
|
|
+ ,#{item.musicSheetUpdate.name},
|
|
|
+ #{item.musicSheetUpdate.subjectIds},
|
|
|
+ #{item.musicSheetUpdate.musicSvg},
|
|
|
+ #{item.musicSheetUpdate.composer},
|
|
|
+ #{item.musicSheetUpdate.audioType},
|
|
|
+ #{item.musicSheetUpdate.playSpeed},
|
|
|
+ #{item.musicSheetUpdate.musicPrice},
|
|
|
+ #{item.isConvertibleScore},
|
|
|
+ #{item.musicSheetUpdate.musicSheetType},
|
|
|
+ CASE WHEN #{item.musicSheetUpdate.sourceType} = 'PLATFORM' THEN 'PLATFORM'
|
|
|
+ WHEN #{item.musicSheetUpdate.sourceType} = 'PERSON' THEN 'TEACHER'
|
|
|
+ ELSE 'TENANT' END,
|
|
|
+ 'PLATFORM',
|
|
|
+ #{item.musicSheetUpdate.playMode},
|
|
|
+ #{item.musicSheetUpdate.showFingering},
|
|
|
+ #{item.musicSheetUpdate.canEvaluate},
|
|
|
+ #{item.musicSheetUpdate.userId},#{item.musicSheetUpdate.userId},
|
|
|
+ #{item.scoreType}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
<!--单曲专辑数量统计-->
|
|
|
</mapper>
|