|
@@ -10,17 +10,27 @@
|
|
<result column="id_" property="id" />
|
|
<result column="id_" property="id" />
|
|
<result column="exam_song_id_" property="examSongId" />
|
|
<result column="exam_song_id_" property="examSongId" />
|
|
<result column="subject_id_" property="subjectId" />
|
|
<result column="subject_id_" property="subjectId" />
|
|
|
|
+ <result column="subject_name_" property="subjectName" />
|
|
<result column="mp3_url_" property="mp3Url" />
|
|
<result column="mp3_url_" property="mp3Url" />
|
|
|
|
+ <result column="xml_url_" property="xmlUrl" />
|
|
|
|
+ <result column="name_" property="examSongName" />
|
|
|
|
+ <result column="type_" property="type" />
|
|
|
|
+ <result column="url_" property="url" />
|
|
<result column="del_flag_" property="delFlag" />
|
|
<result column="del_flag_" property="delFlag" />
|
|
<result column="speed_" property="speed" />
|
|
<result column="speed_" property="speed" />
|
|
- <result column="xml_url_" property="xmlUrl" />
|
|
|
|
<result column="create_time_" property="createTime" />
|
|
<result column="create_time_" property="createTime" />
|
|
<result column="update_time_" property="updateTime" />
|
|
<result column="update_time_" property="updateTime" />
|
|
</resultMap>
|
|
</resultMap>
|
|
-
|
|
|
|
|
|
+ <delete id="deleteBySongId">
|
|
|
|
+
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
<!-- 根据主键查询一条记录 -->
|
|
<!-- 根据主键查询一条记录 -->
|
|
<select id="get" resultMap="SysMusicScoreAccompaniment" >
|
|
<select id="get" resultMap="SysMusicScoreAccompaniment" >
|
|
- SELECT * FROM sys_music_score_accompaniment WHERE id_ = #{id}
|
|
|
|
|
|
+ SELECT sesa.*,ses.name_,ses.type_,ses.url_
|
|
|
|
+ FROM sys_music_score_accompaniment sesa
|
|
|
|
+ LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
|
|
|
|
+ WHERE sesa.id_ = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 全查询 -->
|
|
<!-- 全查询 -->
|
|
@@ -34,50 +44,69 @@
|
|
VALUES(#{examSongId},#{subjectId},#{mp3Url},#{delFlag},#{speed},#{xmlUrl},NOW(),NOW())
|
|
VALUES(#{examSongId},#{subjectId},#{mp3Url},#{delFlag},#{speed},#{xmlUrl},NOW(),NOW())
|
|
</insert>
|
|
</insert>
|
|
<insert id="batchInsert">
|
|
<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_)
|
|
|
|
+ VALUES
|
|
|
|
+ <foreach collection="sysExamSongAccompaniments" item="item" separator=",">
|
|
|
|
+ (#{item.examSongId},#{item.subjectId},#{item.mp3Url},#{item.delFlag},#{item.speed},#{item.xmlUrl},NOW(),NOW())
|
|
|
|
+ </foreach>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
<!-- 根据主键查询一条记录 -->
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment">
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment">
|
|
- UPDATE sys_music_score_accompaniment <set>
|
|
|
|
-<if test="delFlag != null">
|
|
|
|
-del_flag_ = #{delFlag},
|
|
|
|
-</if>
|
|
|
|
-<if test="subjectId != null">
|
|
|
|
-subject_id_ = #{subjectId},
|
|
|
|
-</if>
|
|
|
|
-<if test="id != null">
|
|
|
|
-id_ = #{id},
|
|
|
|
-</if>
|
|
|
|
-<if test="updateTime != null">
|
|
|
|
-update_time_ = #{updateTime},
|
|
|
|
-</if>
|
|
|
|
-<if test="xmlUrl != null">
|
|
|
|
-xml_url_ = #{xmlUrl},
|
|
|
|
-</if>
|
|
|
|
-<if test="examSongId != null">
|
|
|
|
-exam_song_id_ = #{examSongId},
|
|
|
|
-</if>
|
|
|
|
-<if test="mp3Url != null">
|
|
|
|
-mp3_url_ = #{mp3Url},
|
|
|
|
-</if>
|
|
|
|
-<if test="speed != null">
|
|
|
|
-speed_ = #{speed},
|
|
|
|
-</if>
|
|
|
|
-<if test="createTime != null">
|
|
|
|
-create_time_ = #{createTime},
|
|
|
|
-</if>
|
|
|
|
-</set> WHERE id_ = #{id}
|
|
|
|
|
|
+ UPDATE sys_music_score_accompaniment
|
|
|
|
+ <set>
|
|
|
|
+ <if test="subjectId != null">
|
|
|
|
+ subject_id_ = #{subjectId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="speed != null">
|
|
|
|
+ speed_ = #{speed},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="xmlUrl != null">
|
|
|
|
+ xml_url_ = #{xmlUrl},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="examSongId != null">
|
|
|
|
+ exam_song_id_ = #{examSongId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="mp3Url != null">
|
|
|
|
+ mp3_url_ = #{mp3Url},
|
|
|
|
+ </if>
|
|
|
|
+ update_time_ = NOW()
|
|
|
|
+ </set>WHERE id_ = #{id}
|
|
</update>
|
|
</update>
|
|
<update id="batchDel">
|
|
<update id="batchDel">
|
|
-
|
|
|
|
|
|
+ UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ IN
|
|
|
|
+ <foreach collection="delExamSongAccompanimentIds" item="item" open="(" close=")" separator=",">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </update>
|
|
|
|
+ <update id="batchUpdate">
|
|
|
|
+ <foreach collection="sysExamSongAccompaniment" item="item" separator=";">
|
|
|
|
+ UPDATE sys_music_score_accompaniment
|
|
|
|
+ <set>
|
|
|
|
+ <if test="item.speed != null">
|
|
|
|
+ speed_ = #{item.speed},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.subjectId != null">
|
|
|
|
+ subject_id_ = #{item.subjectId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.xmlUrl != null">
|
|
|
|
+ xml_url_ = #{item.xmlUrl},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.examSongId != null">
|
|
|
|
+ exam_song_id_ = #{item.examSongId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="item.mp3Url != null">
|
|
|
|
+ mp3_url_ = #{item.mp3Url},
|
|
|
|
+ </if>
|
|
|
|
+ update_time_ = NOW()
|
|
|
|
+ </set> WHERE id_ = #{item.id}
|
|
|
|
+ </foreach>
|
|
</update>
|
|
</update>
|
|
- <update id="batchUpdate"></update>
|
|
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
<!-- 根据主键删除一条记录 -->
|
|
- <delete id="delete" >
|
|
|
|
- DELETE FROM sys_music_score_accompaniment WHERE id_ = #{id}
|
|
|
|
- </delete>
|
|
|
|
|
|
+ <update id="delete" >
|
|
|
|
+ UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ = #{id}
|
|
|
|
+ </update>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
<!-- 分页查询 -->
|
|
<select id="queryPage" resultMap="SysMusicScoreAccompaniment" parameterType="map">
|
|
<select id="queryPage" resultMap="SysMusicScoreAccompaniment" parameterType="map">
|
|
@@ -89,6 +118,67 @@ create_time_ = #{createTime},
|
|
SELECT COUNT(*) FROM sys_music_score_accompaniment
|
|
SELECT COUNT(*) FROM sys_music_score_accompaniment
|
|
</select>
|
|
</select>
|
|
<select id="findSubjectByMusicScoreId" resultType="java.lang.Integer">
|
|
<select id="findSubjectByMusicScoreId" resultType="java.lang.Integer">
|
|
|
|
+ SELECT subject_id_ FROM sys_music_score_accompaniment
|
|
|
|
+ <where>
|
|
|
|
+ del_flag_ = 0
|
|
|
|
+ <if test="sysMusicScoreId != null">
|
|
|
|
+ AND exam_song_id_ = #{sysMusicScoreId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="idList != null and idList.size > 0">
|
|
|
|
+ AND id_ NOT IN
|
|
|
|
+ <foreach collection="idList" open="(" close=")" item="item" separator=",">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+ <select id="queryAccPage" resultType="java.lang.Object">
|
|
|
|
+ SELECT sesa.*,ses.name_,ses.type_,ses.url_,s.name_ subject_name_
|
|
|
|
+ FROM sys_music_score_accompaniment sesa
|
|
|
|
+ LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
|
|
|
|
+ LEFT JOIN subject s ON s.id_ = sesa.subject_id_
|
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
|
+ </select>
|
|
|
|
|
|
|
|
+ <select id="findAccCount" resultType="java.lang.Integer">
|
|
|
|
+ SELECT COUNT(DISTINCT sesa.id_) FROM sys_music_score_accompaniment sesa
|
|
|
|
+ LEFT JOIN sys_exam_song ses ON ses.id_ = sesa.exam_song_id_
|
|
|
|
+ <include refid="queryPageSql"/>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <sql id="queryPageSql">
|
|
|
|
+ <where>
|
|
|
|
+ sesa.del_flag_ = 0
|
|
|
|
+ <if test="search != null and search != ''">
|
|
|
|
+ AND (sesa.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sysExamSongId != null">
|
|
|
|
+ AND sesa.exam_song_id_ = #{sysExamSongId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="subjectId != null">
|
|
|
|
+ AND sesa.subject_id_ = #{subjectId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null and type == 'COMMON'">
|
|
|
|
+ AND ses.type_ = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null and type == 'ALL'">
|
|
|
|
+ <if test="createUserId != null">
|
|
|
|
+ AND (ses.type_ = 'COMMON' OR (ses.create_user_id_ = #{createUserId} AND ses.type_ = 'PERSON'))
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null and type == 'PERSON'">
|
|
|
|
+ <if test="createUserId != null">
|
|
|
|
+ AND ses.type_ = #{type} AND ses.create_user_id_ = #{createUserId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createUserId == null">
|
|
|
|
+ AND ses.type_ = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type == null or type == ''">
|
|
|
|
+ <if test="createUserId != null">
|
|
|
|
+ AND ses.create_user_id_ = #{createUserId}
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </sql>
|
|
</mapper>
|
|
</mapper>
|