<?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="cn.reghao.tnb.content.app.vod.db.mapper.VideoErrorMapper">
    <insert id="save" useGeneratedKeys="true" keyProperty="id">
        insert into vod_video_error
        (`video_id`,`error_code`,`error_info`,`solved`)
        values 
        (#{videoId},#{errorCode},#{errorInfo},#{solved})
    </insert>

    <delete id="deleteByErrorCode">
        delete from vod_video_error
        where error_code=#{errorCode}
    </delete>

    <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoError">
        select *
        from vod_video_error
    </select>
    <select id="findByVideoId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoError">
        select *
        from vod_video_error
        where video_id=#{videoId}
    </select>
    <select id="findByErrorCode" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoError">
        select *
        from vod_video_error
        where error_code=#{errorCode}
    </select>
</mapper>