12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?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.caimei.mapper.cmMapper.VideoMapper">
- <insert id="insertVideo" keyColumn="id" keyProperty="id" parameterType="com.caimei.model.po.VideoPo" useGeneratedKeys="true">
- insert into cm_brand_video(authUserId, title, name, previewUrl, downloadUrl, auditStatus, status, createTime,
- auditBy, auditTime)
- values (#{authUserId}, #{title}, #{name}, #{previewUrl}, #{downloadUrl}, #{auditStatus}, #{status},
- #{createTime}, #{auditBy}, #{auditTime})
- </insert>
- <update id="updateVideoByVideoId">
- update cm_brand_video
- set title = #{title},
- status = #{status},
- auditStatus = #{auditStatus}
- where id = #{id}
- </update>
- <update id="updateVideoStatusByVideoId">
- update cm_brand_video
- set status = #{status}
- where id = #{videoId}
- </update>
- <update id="updateVideoAuditStatus">
- update cm_brand_video
- set status = #{status},
- auditStatus = #{auditStatus},
- invalidReason = #{invalidReason},
- auditBy = #{auditBy},
- auditTime = #{auditTime}
- where id = #{videoId}
- </update>
- <update id="updateVideoSelective">
- update cm_brand_video
- <set>
- <if test="title != null and title != ''">
- title = #{title},
- </if>
- <if test="previewUrl != null and previewUrl != ''">
- previewUrl = #{previewUrl},
- </if>
- <if test="downloadUrl != null and downloadUrl != ''">
- downloadUrl = #{downloadUrl},
- </if>
- <if test="name != null and name != ''">
- name = #{name},
- </if>
- <if test="status != null">
- status = #{status},
- </if>
- <if test="auditStatus != null">
- auditStatus = #{auditStatus},
- </if>
- </set>
- where id = #{id}
- </update>
- <delete id="deleteVideoByVideoId">
- delete from cm_brand_video where id = #{videoId}
- </delete>
- <select id="getVideoList" resultType="com.caimei.model.vo.VideoListVo">
- select a.id as videoId,a.title as videoTitle,a.name as videoName, a.previewUrl as videoPreviewUrl, a.downloadUrl
- as videoDownloadUrl,a.auditStatus,a.invalidReason,a.status,a.createTime,
- au.name as auditBy,a.auditTime
- from cm_brand_video a
- left join cm_brand_auth_user au on a.auditBy = au.authUserId
- where a.authUserId = #{authUserId}
- <if test="videoTitle != null and videoTitle != ''">
- and a.title like concat('%',#{videoTitle},'%')
- </if>
- <if test="auditStatus != null">
- and a.auditStatus = #{auditStatus}
- </if>
- <if test="status != null">
- and a.status = #{status}
- </if>
- <choose>
- <when test="listType == 2">
- order by a.auditStatus desc, a.createTime desc
- </when>
- <otherwise>
- order by a.createTime desc
- </otherwise>
- </choose>
- </select>
- <select id="getWxVideoList" resultType="com.caimei.model.vo.WxVideoListVo">
- select id as videoId, title as videoTitle,name as videoName, previewUrl as videoPreviewUrl, downloadUrl as
- videoDownloadUrl, date_format(createTime, '%Y-%m-%d') as createTime
- from cm_brand_video a
- where authUserId = #{authUserId}
- and status = 1
- <if test="videoTitle != null and videoTitle != ''">
- and title like concat('%',#{videoTitle},'%')
- </if>
- order by a.createTime desc
- </select>
- </mapper>
|