123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <?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.ContentPlatformPlanMapperExt">
- <insert id="insertGzhPlanReturnId" useGeneratedKeys="true" keyProperty="id">
- insert into content_platform_gzh_plan (publish_stage, account_id,
- scene, external_id, create_account_id,
- create_timestamp, update_timestamp)
- values (#{record.publishStage}, #{record.accountId}, #{record.scene}, #{record.externalId},
- #{record.createAccountId}, #{record.createTimestamp}, #{record.updateTimestamp})
- </insert>
- <select id="getGzhPlanCount" resultType="java.lang.Integer">
- select count(*)
- from content_platform_gzh_plan
- where create_account_id = #{createAccountId}
- <if test="param.accountId != null and param.accountId != ''">
- and account_id = #{param.accountId}
- </if>
- <if test="param.publishStage != null and param.publishStage != ''">
- and publish_stage = #{param.publishStage}
- </if>
- <if test="param.createTimestampStart != null and param.createTimestampStart != ''">
- and create_timestamp > #{param.createTimestampStart}
- </if>
- <if test="param.createTimestampEnd != null and param.createTimestampEnd != ''">
- and create_timestamp < #{param.createTimestampEnd}
- </if>
- <if test="param.title != null and param.title != ''">
- and id in (select plan_id from content_platform_gzh_plan_video where title like concat('%', #{param.title},
- '%'))
- </if>
- </select>
- <select id="getGzhPlanList"
- resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
- select *
- from content_platform_gzh_plan
- where create_account_id = #{createAccountId}
- <if test="param.accountId != null and param.accountId != ''">
- and account_id = #{param.accountId}
- </if>
- <if test="param.publishStage != null and param.publishStage != ''">
- and publish_stage = #{param.publishStage}
- </if>
- <if test="param.createTimestampStart != null and param.createTimestampStart != ''">
- and create_timestamp > #{param.createTimestampStart}
- </if>
- <if test="param.createTimestampEnd != null and param.createTimestampEnd != ''">
- and create_timestamp < #{param.createTimestampEnd}
- </if>
- <if test="param.title != null and param.title != ''">
- and id in (select plan_id from content_platform_gzh_plan_video where title like concat('%', #{param.title},
- '%'))
- </if>
- order by create_timestamp desc
- limit #{offset}, #{pageSize}
- </select>
- <select id="getGzhPlanExists"
- resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
- select *
- from content_platform_gzh_plan
- where account_id = #{accountId}
- and scene = #{scene}
- <if test="id != null">
- and id != #{id}
- </if>
- limit 1
- </select>
- <select id="getVideoMaxDt" resultType="java.lang.String">
- select max(dt)
- from content_platform_video
- </select>
- <select id="getVideoCount" resultType="java.lang.Integer">
- select count(1)
- from content_platform_video
- where dt = #{dt}
- <if test="param.title!= null and param.title!= ''">
- and title like concat('%', #{param.title}, '%')
- </if>
- <if test="param.category!= null and param.category!= ''">
- and category = #{param.category}
- </if>
- </select>
- <select id="getVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
- select *
- from content_platform_video
- where dt = #{dt}
- <if test="param.title!= null and param.title!= ''">
- and title like concat('%', #{param.title}, '%')
- </if>
- <if test="param.category!= null and param.category!= ''">
- and category = #{param.category}
- </if>
- order by score desc
- limit #{offset}, #{pageSize}
- </select>
- <select id="getVideoCategoryList" resultType="java.lang.String">
- select distinct category
- from content_platform_video
- where dt = #{dt}
- </select>
- <insert id="batchInsertContentPlatformVideo">
- insert into content_platform_video (dt, video_id, category, title, video, score, create_timestamp)
- values
- <foreach collection="records" item="item" separator=",">
- (#{item.dt}, #{item.videoId}, #{item.category}, #{item.title}, #{item.video}, #{item.score},
- #{item.createTimestamp})
- </foreach>
- </insert>
- <select id="getQwPlanCount" resultType="java.lang.Integer">
- select count(*)
- from content_platform_qw_plan
- where create_account_id = #{createAccountId}
- and type = #{param.type}
- <if test="param.scene != null">
- and scene < #{param.scene}
- </if>
- <if test="param.title != null and param.title != ''">
- and id in (select plan_id from content_platform_qw_plan_video where title like concat('%', #{param.title},
- '%'))
- </if>
- </select>
- <select id="getQwPlanList"
- resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlan">
- select *
- from content_platform_qw_plan
- where create_account_id = #{createAccountId}
- and type = #{param.type}
- <if test="param.scene != null">
- and scene < #{param.scene}
- </if>
- <if test="param.title != null and param.title != ''">
- and id in (select plan_id from content_platform_qw_plan_video where title like concat('%', #{param.title},
- '%'))
- </if>
- order by create_timestamp desc
- limit #{offset}, #{pageSize}
- </select>
- <insert id="batchInsertQwPlan">
- insert into content_platform_qw_plan (`type`, scene, page_url, root_source_id,
- create_account_id, create_timestamp, update_timestamp
- )
- values
- <foreach collection="records" item="item" separator=",">
- (#{item.type}, #{item.scene}, #{item.pageUrl}, #{item.rootSourceId},
- #{item.createAccountId}, #{item.createTimestamp}, #{item.updateTimestamp}
- )
- </foreach>
- </insert>
- <insert id="insertQwPlanReturnId" useGeneratedKeys="true" keyProperty="id">
- insert into content_platform_qw_plan (`type`, scene, page_url, root_source_id, create_account_id,
- create_timestamp, update_timestamp)
- values ( #{record.type}, #{record.scene}, #{record.pageUrl}, #{record.rootSourceId},
- #{record.createAccountId}, #{record.createTimestamp}, #{record.updateTimestamp})
- </insert>
- <select id="getGzhPlanVideoListByCooperateAccountId"
- resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
- select cpgpv.*
- from content_platform_gzh_plan_video cpgpv
- join content_platform_gzh_plan cpgp on cpgp.id = cpgpv.plan_id
- join content_platform_gzh_account cpgac on cpgac.id = cpgp.account_id
- where cpgac.gh_id = #{ghId}
- and cpgac.status = 1
- and cpgp.scene = 0
- </select>
- </mapper>
|