INSERT INTO sys_music_compare_record (id_,user_id_,sys_music_score_id_,heard_level_,behavior_id_,score_data_,score_,intonation_,cadence_,integrity_,
record_file_path_,video_file_path_,device_type_,client_id_,play_time_,speed_,monday_,
source_time_,feature_,create_time_,update_time_,part_index_,tenant_id_)
VALUES(#{id},#{userId},#{sysMusicScoreId},#{heardLevel,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{behaviorId},#{scoreData},
#{score},#{intonation},#{cadence},#{integrity},
#{recordFilePath},#{videoFilePath},#{deviceType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{clientId},#{playTime},#{speed},#{monday},
#{sourceTime},#{feature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, NOW(), NOW(),#{partIndex},#{tenantId})
UPDATE sys_music_compare_record
user_id_ = #{userId},
sys_music_score_id_ = #{sysMusicScoreId},
behavior_id_ = #{behaviorId},
score_data_ = #{scoreData},
score_ = #{score},
intonation_ = #{intonation},
integrity_ = #{integrity},
cadence_ = #{cadence},
record_file_path_ = #{recordFilePath},
video_file_path_ = #{videoFilePath},
client_id_ = #{clientId},
device_type_ = #{deviceType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
source_time_ = #{sourceTime},
play_time_ = #{playTime},
speed_ = #{speed},
monday_ = #{monday},
part_index_ = #{partIndex},
feature_ = #{feature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
heard_level_ = #{heardLevel,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
update_time_ = NOW()
WHERE id_ = #{id} and tenant_id_ = #{tenantId}
DELETE FROM sys_music_compare_record WHERE id_ = #{id}
smcr.tenant_id_ = #{tenantId}
AND smcr.user_id_=#{userId}
AND smcr.feature_ = #{featureType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
AND DATE_FORMAT(smcr.create_time_, '%Y-%m-%d') >= #{startTime}
AND DATE_FORMAT(smcr.create_time_, '%Y-%m-%d') <= #{endTime}
sr.music_group_status_='NORMAL' AND stu.user_id_ IS NOT NULL and sr.tenant_id_ = #{tenantId}
AND DATE_FORMAT( smcr.create_time_, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
AND sr.music_group_id_ = #{musicGroupId}
AND (su.username_ LIKE CONCAT('%', #{search}, '%'))