<?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.ruixuan.live.mapper.KuaishouLiveBroadcastFilesMapper">

    <select id="selectKuaishouLiveBroadcastFilesById" parameterType="String"
            resultType="com.ruixuan.live.entity.KuaishouLiveBroadcastFiles">
        select id,
               up_common_url,
               dapan_count,
               dapan_names,
               dapan_msg,
               portrait_count,
               portrait_names,
               portrait_msg,
               replay_common_url,
               replay_picture_count,
               replay_picture_names,
               replay_picture_msg,
               replay_file_url
        from kuaishou_live_broadcast_files
        where id = #{id}
    </select>

    <insert id="insertKuaishouLiveBroadcastFiles" parameterType="com.ruixuan.live.entity.KuaishouLiveBroadcastFiles">
        insert into kuaishou_live_broadcast_files
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">id,</if>
            <if test="upCommonUrl != null">up_common_url,</if>
            <if test="dapanCount != null">dapan_count,</if>
            <if test="dapanNames != null">dapan_names,</if>
            <if test="dapanMsg != null">dapan_msg,</if>
            <if test="portraitCount != null">portrait_count,</if>
            <if test="portraitNames != null">portrait_names,</if>
            <if test="portraitMsg != null">portrait_msg,</if>
            <if test="replayCommonUrl != null">replay_common_url,</if>
            <if test="replayPictureCount != null">replay_picture_count,</if>
            <if test="replayPictureNames != null">replay_picture_names,</if>
            <if test="replayPictureMsg != null">replay_picture_msg,</if>
            <if test="replayFileUrl != null">replay_file_url,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">#{id},</if>
            <if test="upCommonUrl != null">#{upCommonUrl},</if>
            <if test="dapanCount != null">#{dapanCount},</if>
            <if test="dapanNames != null">#{dapanNames},</if>
            <if test="dapanMsg != null">#{dapanMsg},</if>
            <if test="portraitCount != null">#{portraitCount},</if>
            <if test="portraitNames != null">#{portraitNames},</if>
            <if test="portraitMsg != null">#{portraitMsg},</if>
            <if test="replayCommonUrl != null">#{replayCommonUrl},</if>
            <if test="replayPictureCount != null">#{replayPictureCount},</if>
            <if test="replayPictureNames != null">#{replayPictureNames},</if>
            <if test="replayPictureMsg != null">#{replayPictureMsg},</if>
            <if test="replayFileUrl != null">#{replayFileUrl},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
        </trim>
    </insert>

    <update id="updateKuaishouLiveBroadcastFiles" parameterType="com.ruixuan.live.entity.KuaishouLiveBroadcastFiles">
        update kuaishou_live_broadcast_files
        <trim prefix="SET" suffixOverrides=",">
            <if test="upCommonUrl != null">up_common_url = #{upCommonUrl},</if>
            <if test="dapanCount != null">dapan_count = #{dapanCount},</if>
            <if test="dapanNames != null">dapan_names = #{dapanNames},</if>
            <if test="dapanMsg != null">dapan_msg = #{dapanMsg},</if>
            <if test="portraitCount != null">portrait_count = #{portraitCount},</if>
            <if test="portraitNames != null">portrait_names = #{portraitNames},</if>
            <if test="portraitMsg != null">portrait_msg = #{portraitMsg},</if>
            <if test="replayCommonUrl != null">replay_common_url = #{replayCommonUrl},</if>
            <if test="replayPictureCount != null">replay_picture_count = #{replayPictureCount},</if>
            <if test="replayPictureNames != null">replay_picture_names = #{replayPictureNames},</if>
            <if test="replayPictureMsg != null">replay_picture_msg = #{replayPictureMsg},</if>
            <if test="replayFileUrl != null">replay_file_url = #{replayFileUrl},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteKuaishouLiveBroadcastFilesById" parameterType="String">
        delete
        from kuaishou_live_broadcast_files
        where id = #{id}
    </delete>

    <delete id="deleteKuaishouLiveBroadcastFilesByIds" parameterType="String">
        delete from kuaishou_live_broadcast_files where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>