|
@@ -21,8 +21,9 @@
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
</resultMap>
|
|
|
- <delete id="deleteBySongId">
|
|
|
|
|
|
+ <delete id="deleteBySongId">
|
|
|
+ UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE exam_song_id_ = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -40,14 +41,14 @@
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO sys_music_score_accompaniment (exam_song_id_,subject_id_,mp3_url_,del_flag_,speed_,xml_url_,create_time_,update_time_)
|
|
|
- VALUES(#{examSongId},#{subjectId},#{mp3Url},#{delFlag},#{speed},#{xmlUrl},NOW(),NOW())
|
|
|
+ INSERT INTO sys_music_score_accompaniment (exam_song_id_,subject_id_,mp3_url_,speed_,xml_url_,create_time_,update_time_)
|
|
|
+ VALUES(#{examSongId},#{subjectId},#{mp3Url},#{speed},#{xmlUrl},NOW(),NOW())
|
|
|
</insert>
|
|
|
<insert id="batchInsert">
|
|
|
- INSERT INTO sys_music_score_accompaniment (exam_song_id_,subject_id_,mp3_url_,del_flag_,speed_,xml_url_,create_time_,update_time_)
|
|
|
+ INSERT INTO sys_music_score_accompaniment (exam_song_id_,subject_id_,mp3_url_,speed_,xml_url_,create_time_,update_time_)
|
|
|
VALUES
|
|
|
- <foreach collection="sysExamSongAccompaniments" item="item" separator=",">
|
|
|
- (#{item.examSongId},#{item.subjectId},#{item.mp3Url},#{item.delFlag},#{item.speed},#{item.xmlUrl},NOW(),NOW())
|
|
|
+ <foreach collection="sysMusicScoreAccompaniments" item="item" separator=",">
|
|
|
+ (#{sysMusicScoreId},#{item.subjectId},#{item.mp3Url},#{item.speed},#{item.xmlUrl},NOW(),NOW())
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -80,7 +81,7 @@
|
|
|
</foreach>
|
|
|
</update>
|
|
|
<update id="batchUpdate">
|
|
|
- <foreach collection="sysExamSongAccompaniment" item="item" separator=";">
|
|
|
+ <foreach collection="sysMusicScoreAccompaniments" item="item" separator=";">
|
|
|
UPDATE sys_music_score_accompaniment
|
|
|
<set>
|
|
|
<if test="item.speed != null">
|
|
@@ -110,7 +111,20 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="SysMusicScoreAccompaniment" parameterType="map">
|
|
|
- SELECT * FROM sys_music_score_accompaniment ORDER BY id_ <include refid="global.limit"/>
|
|
|
+ SELECT sesa.*,s.name_ subject_name_
|
|
|
+ FROM sys_music_score_accompaniment sesa
|
|
|
+ LEFT JOIN `subject` s ON s.id_ = sesa.subject_id_
|
|
|
+ <where>
|
|
|
+ sesa.del_flag_ = 0
|
|
|
+ <if test="subjectId != null">
|
|
|
+ AND sesa.subject_id_ = #{subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="sysMusicScoreId != null">
|
|
|
+ AND sesa.exam_song_id_ = #{sysMusicScoreId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY sesa.id_ DESC
|
|
|
+ <include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|