| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?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="duration" column="duration" />
- <result property="remark" column="remark" />
- <result property="fileSize" column="file_size" />
- <result property="finishStatus" column="finish_status" />
- <result property="companyIds" column="company_ids" typeHandler="com.fs.live.domain.handler.CompanyIdsTypeHandler" />
- </resultMap>
- <sql id="selectLiveVideoVo">
- select video_id, live_id, video_url, video_type, sort, create_time, create_by, update_by, update_time, remark,duration,file_size,finish_status,company_ids 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>
- <if test="remark != null "> and remark like CONCAT('%',#{remark},'%')</if>
- <if test="finishStatus != null "> and finish_status = #{finishStatus}</if>
- <if test="companyId != null">
- and (company_ids IS NULL OR company_ids = '' OR company_ids = '[]' OR JSON_CONTAINS(company_ids, CAST(#{companyId} AS JSON), '$'))
- </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>
- <if test="duration != null">duration,</if>
- <if test="fileSize != null">file_size,</if>
- <if test="finishStatus != null">finish_status,</if>
- <if test="companyIds != null">company_ids,</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>
- <if test="duration != null">#{duration},</if>
- <if test="fileSize != null">#{fileSize},</if>
- <if test="finishStatus != null">#{finishStatus},</if>
- <if test="companyIds != null">#{companyIds, typeHandler=com.fs.live.domain.handler.CompanyIdsTypeHandler},</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="duration != null">duration = #{duration},</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>
- <if test="fileSize != null">file_size = #{fileSize},</if>
- <if test="finishStatus != null">finish_status = #{finishStatus},</if>
- <if test="companyIds != null">company_ids = #{companyIds, typeHandler=com.fs.live.domain.handler.CompanyIdsTypeHandler},</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>
|