| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformDemandVideoMapperExt">
- <insert id="batchInsert" parameterType="java.util.List">
- INSERT INTO content_platform_demand_video
- (dt, channel_name, crowd_segment, dimension, point_type, standard_element,
- category_name, visit_uv, total_rov, video_id, config_code, score, sim, rov,
- match_text, title, cover, video, status, create_timestamp, update_timestamp)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.dt}, #{item.channelName}, #{item.crowdSegment}, #{item.dimension}, #{item.pointType}, #{item.standardElement},
- #{item.categoryName}, #{item.visitUv}, #{item.totalRov}, #{item.videoId}, #{item.configCode}, #{item.score}, #{item.sim}, #{item.rov},
- #{item.matchText}, #{item.title}, #{item.cover}, #{item.video}, #{item.status}, #{item.createTimestamp}, #{item.updateTimestamp})
- </foreach>
- </insert>
- <delete id="deleteByDt">
- DELETE FROM content_platform_demand_video WHERE dt = #{dt}
- </delete>
- <select id="selectByCondition" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideo">
- SELECT id, dt, channel_name, crowd_segment, dimension, point_type, standard_element,
- category_name, visit_uv, total_rov, video_id, config_code, score, sim, rov,
- match_text, title, cover, video, status, create_timestamp, update_timestamp
- FROM content_platform_demand_video
- WHERE dt = #{dt} AND status = 1
- <if test="channelName != null and channelName != ''">
- AND channel_name = #{channelName}
- </if>
- <if test="pointType != null and pointType != ''">
- AND point_type = #{pointType}
- </if>
- <if test="title != null and title != ''">
- AND title LIKE CONCAT('%', #{title}, '%')
- </if>
- <if test="crowdSegment != null and crowdSegment != ''">
- AND crowd_segment = #{crowdSegment}
- </if>
- ORDER BY score DESC
- LIMIT #{offset}, #{pageSize}
- </select>
- <select id="countByCondition" resultType="int">
- SELECT COUNT(*) FROM content_platform_demand_video
- WHERE dt = #{dt} AND status = 1
- <if test="channelName != null and channelName != ''">
- AND channel_name = #{channelName}
- </if>
- <if test="pointType != null and pointType != ''">
- AND point_type = #{pointType}
- </if>
- <if test="title != null and title != ''">
- AND title LIKE CONCAT('%', #{title}, '%')
- </if>
- <if test="crowdSegment != null and crowdSegment != ''">
- AND crowd_segment = #{crowdSegment}
- </if>
- </select>
- <select id="getMaxDt" resultType="java.lang.String">
- SELECT MAX(dt) FROM content_platform_demand_video WHERE status = 1
- </select>
- <select id="selectActiveVideos" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideo">
- SELECT DISTINCT video_id
- FROM content_platform_demand_video
- WHERE dt = #{dt} AND status = 1
- </select>
- <update id="updateStatusByVideoId">
- UPDATE content_platform_demand_video
- SET status = #{status}, update_timestamp = #{updateTimestamp}
- WHERE video_id = #{videoId} AND dt = #{dt} AND status = 1
- </update>
- </mapper>
|