|
|
@@ -8,7 +8,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="videoId" column="video_id" />
|
|
|
<result property="liveId" column="live_id" />
|
|
|
<result property="videoUrl" column="video_url" />
|
|
|
+ <result property="videoName" column="video_name" />
|
|
|
<result property="videoType" column="video_type" />
|
|
|
+ <result property="category" column="category" />
|
|
|
<result property="sort" column="sort" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
@@ -22,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</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
|
|
|
+ select video_id, live_id, video_url, video_name, video_type, category, 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">
|
|
|
@@ -30,14 +32,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<where>
|
|
|
<if test="liveId != null "> and live_id = #{liveId}</if>
|
|
|
<if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
|
|
|
+ <if test="videoName != null and videoName != ''"> and video_name like CONCAT('%',#{videoName},'%')</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="remark != null and remark != ''"> and remark like CONCAT('%',#{remark},'%')</if>
|
|
|
+ <if test="category != null and category != ''"> and category like CONCAT('%',#{category},'%')</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>
|
|
|
+ order by case when sort is null then 1 else 0 end asc, sort asc, create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectLiveVideoByVideoId" parameterType="Long" resultMap="LiveVideoResult">
|
|
|
@@ -54,7 +59,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="liveId != null">live_id,</if>
|
|
|
<if test="videoUrl != null">video_url,</if>
|
|
|
+ <if test="videoName != null">video_name,</if>
|
|
|
<if test="videoType != null">video_type,</if>
|
|
|
+ <if test="category != null">category,</if>
|
|
|
<if test="sort != null">sort,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
@@ -69,7 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="liveId != null">#{liveId},</if>
|
|
|
<if test="videoUrl != null">#{videoUrl},</if>
|
|
|
+ <if test="videoName != null">#{videoName},</if>
|
|
|
<if test="videoType != null">#{videoType},</if>
|
|
|
+ <if test="category != null">#{category},</if>
|
|
|
<if test="sort != null">#{sort},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
@@ -88,7 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="liveId != null">live_id = #{liveId},</if>
|
|
|
<if test="videoUrl != null">video_url = #{videoUrl},</if>
|
|
|
+ <if test="videoName != null">video_name = #{videoName},</if>
|
|
|
<if test="videoType != null">video_type = #{videoType},</if>
|
|
|
+ <if test="category != null">category = #{category},</if>
|
|
|
<if test="duration != null">duration = #{duration},</if>
|
|
|
<if test="sort != null">sort = #{sort},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
@@ -113,4 +124,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{videoId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
+
|
|
|
+ <update id="batchUpdateCategory">
|
|
|
+ update live_video set category = #{category}, update_time = NOW()
|
|
|
+ where video_id in
|
|
|
+ <foreach item="videoId" collection="videoIds" open="(" separator="," close=")">
|
|
|
+ #{videoId}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
</mapper>
|