|
@@ -31,6 +31,7 @@
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="part_index_" property="partIndex" />
|
|
|
<result column="tenant_id_" property="tenantId"/>
|
|
|
+ <result column="subject_id_" property="subjectId"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -47,15 +48,16 @@
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMusicCompareRecord" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
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_,create_date_,update_time_,part_index_,tenant_id_)
|
|
|
+ source_time_,feature_,create_time_,create_date_,update_time_,part_index_,tenant_id_,subject_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}, #{createTime}, #{createDate}, NOW(),#{partIndex},#{tenantId})
|
|
|
+ #{sourceTime},#{feature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{createTime}, #{createDate}, NOW(),#{partIndex},#{tenantId},#{subjectId})
|
|
|
</insert>
|
|
|
<insert id="init">
|
|
|
insert into sys_music_compare_day_data (user_id_, day_, train_num_, train_time_, tenant_id_)
|
|
|
- select smcr.user_id_,DATE_FORMAT(smcr.create_time_,'%Y-%m-%d'),COUNT(smcr.id_),SUM(smcr.play_time_),smcr.tenant_id_ from sys_music_compare_record smcr
|
|
|
+ select smcr.user_id_,DATE_FORMAT(smcr.create_time_,'%Y-%m-%d'),COUNT(smcr.id_),SUM(smcr.play_time_),smcr.tenant_id_
|
|
|
+ from sys_music_compare_record smcr
|
|
|
where smcr.create_date_ = #{date}
|
|
|
group by smcr.create_date_,smcr.user_id_;
|
|
|
</insert>
|
|
@@ -63,6 +65,9 @@
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicCompareRecord">
|
|
|
UPDATE sys_music_compare_record <set>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ subject_id_ = #{subjectId},
|
|
|
+ </if>
|
|
|
<if test="userId != null">
|
|
|
user_id_ = #{userId},
|
|
|
</if>
|
|
@@ -138,6 +143,9 @@
|
|
|
<if test="userId!=null">
|
|
|
AND smcr.user_id_=#{userId}
|
|
|
</if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ AND smcr.subject_id_=#{subjectId}
|
|
|
+ </if>
|
|
|
<if test="featureType != null">
|
|
|
AND smcr.feature_ = #{featureType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
@@ -157,7 +165,7 @@
|
|
|
LOCATE('musicalNotesPlayStats', smcr.score_data_) notes_data_index_,
|
|
|
smcr.score_, smcr.intonation_, smcr.cadence_,
|
|
|
smcr.integrity_, smcr.record_file_path_, smcr.video_file_path_, smcr.client_id_, smcr.device_type_, smcr.play_time_,
|
|
|
- smcr.monday_, smcr.create_time_,
|
|
|
+ smcr.monday_, smcr.create_time_,smcr.subject_id_,
|
|
|
sms.name_ sys_music_score_name_
|
|
|
FROM sys_music_compare_record smcr
|
|
|
LEFT JOIN sys_music_score sms on smcr.sys_music_score_id_ = sms.id_
|