1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?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.fs.live.mapper.LiveVideoMapper">
-
- <resultMap type="LiveVideo" id="LiveVideoResult">
- <result property="videoId" column="video_id" />
- <result property="liveId" column="live_id" />
- <result property="videoUrl" column="video_url" />
- <result property="videoType" column="video_type" />
- <result property="sort" column="sort" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- </resultMap>
- <sql id="selectLiveVideoVo">
- select video_id, live_id, video_url, video_type, sort, create_time, create_by, update_by, update_time, remark from live_video
- </sql>
- <select id="selectLiveVideoList" parameterType="LiveVideo" resultMap="LiveVideoResult">
- <include refid="selectLiveVideoVo"/>
- <where>
- <if test="liveId != null "> and live_id = #{liveId}</if>
- <if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
- <if test="videoType != null "> and video_type = #{videoType}</if>
- <if test="sort != null "> and sort = #{sort}</if>
- </where>
- </select>
-
- <select id="selectLiveVideoByVideoId" parameterType="Long" resultMap="LiveVideoResult">
- <include refid="selectLiveVideoVo"/>
- where video_id = #{videoId}
- </select>
- <select id="selectLiveVideoByVideoIdAndCompanyIdAndCompanyUserId" resultMap="LiveVideoResult">
- <include refid="selectLiveVideoVo"/>
- where video_id = #{videoId} and company_id = #{companyId} and company_user_id = #{companyUserId}
- </select>
- <insert id="insertLiveVideo" parameterType="LiveVideo" useGeneratedKeys="true" keyProperty="videoId">
- insert into live_video
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="liveId != null">live_id,</if>
- <if test="videoUrl != null">video_url,</if>
- <if test="videoType != null">video_type,</if>
- <if test="sort != null">sort,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="liveId != null">#{liveId},</if>
- <if test="videoUrl != null">#{videoUrl},</if>
- <if test="videoType != null">#{videoType},</if>
- <if test="sort != null">#{sort},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateLiveVideo" parameterType="LiveVideo">
- update live_video
- <trim prefix="SET" suffixOverrides=",">
- <if test="liveId != null">live_id = #{liveId},</if>
- <if test="videoUrl != null">video_url = #{videoUrl},</if>
- <if test="videoType != null">video_type = #{videoType},</if>
- <if test="sort != null">sort = #{sort},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where video_id = #{videoId}
- </update>
- <delete id="deleteLiveVideoByVideoId" parameterType="Long">
- delete from live_video where video_id = #{videoId}
- </delete>
- <delete id="deleteLiveVideoByVideoIds" parameterType="String">
- delete from live_video where video_id in
- <foreach item="videoId" collection="array" open="(" separator="," close=")">
- #{videoId}
- </foreach>
- </delete>
- </mapper>
|