<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.MusicSceneRelateMapper">

    <resultMap type="MusicSceneRelate" id="MusicSceneRelateResult">
        <result property="id"    column="id"    />
        <result property="musicId"    column="music_id"    />
        <result property="sceneIds"    column="scene_ids"    />
        <result property="userId"    column="user_id"    />
        <result property="sceneInfo"    column="scene_info"    />
        <result property="sourceMusicId" column="source_music_id" />
    </resultMap>

    <sql id="selectMusicSceneRelateVo">
        select id, music_id, scene_ids,user_id,scene_info,source_music_id from music_scene_relate
    </sql>

    <insert id="insertMusicSceneRelate">
        INSERT INTO music_scene_relate(music_id, scene_ids, user_id, scene_info,source_music_id) VALUE (#{musicId},#{sceneIds},#{userId},#{sceneInfo},#{sourceMusicId})
    </insert>

    <select id="selectByMusicId" resultMap="MusicSceneRelateResult">
        select * from music_scene_relate where music_id = #{musicId}
    </select>

    <delete id="deleteByMusicId">
        delete from music_scene_relate where music_id=#{musicId}
    </delete>
</mapper>
