BdCreativeMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.baidu.mapper.BdCreativeMapper">
  6. <resultMap type="BdCreative" id="BdCreativeResult">
  7. <result property="creativeFeedId" column="creative_feed_id" />
  8. <result property="adgroupFeedId" column="adgroup_feed_id" />
  9. <result property="materialstyle" column="materialstyle" />
  10. <result property="creativeFeedName" column="creative_feed_name" />
  11. <result property="pause" column="pause" />
  12. <result property="status" column="status" />
  13. <result property="material" column="material" />
  14. <result property="refusereason" column="refusereason" />
  15. <result property="commentnum" column="commentnum" />
  16. <result property="readnum" column="readnum" />
  17. <result property="playnum" column="playnum" />
  18. <result property="ideaType" column="idea_type" />
  19. <result property="showMt" column="show_mt" />
  20. <result property="addtime" column="addtime" />
  21. <result property="progFlag" column="prog_flag" />
  22. <result property="videoId" column="video_id" />
  23. <result property="videoUrl" column="video_url" />
  24. <result property="templateJson" column="template_json" />
  25. <result property="createTime" column="create_time" />
  26. <result property="createBy" column="create_by" />
  27. <result property="updateBy" column="update_by" />
  28. <result property="updateTime" column="update_time" />
  29. <result property="remark" column="remark" />
  30. </resultMap>
  31. <sql id="selectBdCreativeVo">
  32. select creative_feed_id, adgroup_feed_id, materialstyle, creative_feed_name, pause, status, material, refusereason, commentnum, readnum, playnum, idea_type, show_mt, addtime, prog_flag, video_id, video_url, template_json, create_time, create_by, update_by, update_time, remark from bd_creative
  33. </sql>
  34. <select id="selectBdCreativeList" parameterType="BdCreative" resultMap="BdCreativeResult">
  35. <include refid="selectBdCreativeVo"/>
  36. <where>
  37. <if test="adgroupFeedId != null "> and adgroup_feed_id = #{adgroupFeedId}</if>
  38. <if test="accountId != null "> and account_id = #{accountId}</if>
  39. <if test="materialstyle != null "> and materialstyle = #{materialstyle}</if>
  40. <if test="creativeFeedName != null and creativeFeedName != ''"> and creative_feed_name like concat('%', #{creativeFeedName}, '%')</if>
  41. <if test="pause != null "> and pause = #{pause}</if>
  42. <if test="status != null "> and status = #{status}</if>
  43. <if test="material != null and material != ''"> and material = #{material}</if>
  44. <if test="refusereason != null and refusereason != ''"> and refusereason = #{refusereason}</if>
  45. <if test="commentnum != null "> and commentnum = #{commentnum}</if>
  46. <if test="readnum != null "> and readnum = #{readnum}</if>
  47. <if test="playnum != null "> and playnum = #{playnum}</if>
  48. <if test="ideaType != null "> and idea_type = #{ideaType}</if>
  49. <if test="showMt != null "> and show_mt = #{showMt}</if>
  50. <if test="addtime != null and addtime != ''"> and addtime = #{addtime}</if>
  51. <if test="progFlag != null and progFlag != ''"> and prog_flag = #{progFlag}</if>
  52. <if test="videoId != null "> and video_id = #{videoId}</if>
  53. <if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
  54. <if test="templateJson != null and templateJson != ''"> and template_json = #{templateJson}</if>
  55. </where>
  56. </select>
  57. <select id="selectBdCreativeByCreativeFeedId" parameterType="Long" resultMap="BdCreativeResult">
  58. <include refid="selectBdCreativeVo"/>
  59. where creative_feed_id = #{creativeFeedId}
  60. </select>
  61. <insert id="insertBdCreative" parameterType="BdCreative">
  62. insert into bd_creative
  63. <trim prefix="(" suffix=")" suffixOverrides=",">
  64. <if test="creativeFeedId != null">creative_feed_id,</if>
  65. <if test="adgroupFeedId != null">adgroup_feed_id,</if>
  66. <if test="materialstyle != null">materialstyle,</if>
  67. <if test="creativeFeedName != null">creative_feed_name,</if>
  68. <if test="pause != null">pause,</if>
  69. <if test="status != null">status,</if>
  70. <if test="material != null">material,</if>
  71. <if test="refusereason != null">refusereason,</if>
  72. <if test="commentnum != null">commentnum,</if>
  73. <if test="readnum != null">readnum,</if>
  74. <if test="playnum != null">playnum,</if>
  75. <if test="ideaType != null">idea_type,</if>
  76. <if test="showMt != null">show_mt,</if>
  77. <if test="addtime != null">addtime,</if>
  78. <if test="progFlag != null">prog_flag,</if>
  79. <if test="videoId != null">video_id,</if>
  80. <if test="videoUrl != null">video_url,</if>
  81. <if test="templateJson != null">template_json,</if>
  82. <if test="createTime != null">create_time,</if>
  83. <if test="createBy != null">create_by,</if>
  84. <if test="updateBy != null">update_by,</if>
  85. <if test="updateTime != null">update_time,</if>
  86. <if test="remark != null">remark,</if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="creativeFeedId != null">#{creativeFeedId},</if>
  90. <if test="adgroupFeedId != null">#{adgroupFeedId},</if>
  91. <if test="materialstyle != null">#{materialstyle},</if>
  92. <if test="creativeFeedName != null">#{creativeFeedName},</if>
  93. <if test="pause != null">#{pause},</if>
  94. <if test="status != null">#{status},</if>
  95. <if test="material != null">#{material},</if>
  96. <if test="refusereason != null">#{refusereason},</if>
  97. <if test="commentnum != null">#{commentnum},</if>
  98. <if test="readnum != null">#{readnum},</if>
  99. <if test="playnum != null">#{playnum},</if>
  100. <if test="ideaType != null">#{ideaType},</if>
  101. <if test="showMt != null">#{showMt},</if>
  102. <if test="addtime != null">#{addtime},</if>
  103. <if test="progFlag != null">#{progFlag},</if>
  104. <if test="videoId != null">#{videoId},</if>
  105. <if test="videoUrl != null">#{videoUrl},</if>
  106. <if test="templateJson != null">#{templateJson},</if>
  107. <if test="createTime != null">#{createTime},</if>
  108. <if test="createBy != null">#{createBy},</if>
  109. <if test="updateBy != null">#{updateBy},</if>
  110. <if test="updateTime != null">#{updateTime},</if>
  111. <if test="remark != null">#{remark},</if>
  112. </trim>
  113. </insert>
  114. <update id="updateBdCreative" parameterType="BdCreative">
  115. update bd_creative
  116. <trim prefix="SET" suffixOverrides=",">
  117. <if test="adgroupFeedId != null">adgroup_feed_id = #{adgroupFeedId},</if>
  118. <if test="materialstyle != null">materialstyle = #{materialstyle},</if>
  119. <if test="creativeFeedName != null">creative_feed_name = #{creativeFeedName},</if>
  120. <if test="pause != null">pause = #{pause},</if>
  121. <if test="status != null">status = #{status},</if>
  122. <if test="material != null">material = #{material},</if>
  123. <if test="refusereason != null">refusereason = #{refusereason},</if>
  124. <if test="commentnum != null">commentnum = #{commentnum},</if>
  125. <if test="readnum != null">readnum = #{readnum},</if>
  126. <if test="playnum != null">playnum = #{playnum},</if>
  127. <if test="ideaType != null">idea_type = #{ideaType},</if>
  128. <if test="showMt != null">show_mt = #{showMt},</if>
  129. <if test="addtime != null">addtime = #{addtime},</if>
  130. <if test="progFlag != null">prog_flag = #{progFlag},</if>
  131. <if test="videoId != null">video_id = #{videoId},</if>
  132. <if test="videoUrl != null">video_url = #{videoUrl},</if>
  133. <if test="templateJson != null">template_json = #{templateJson},</if>
  134. <if test="createTime != null">create_time = #{createTime},</if>
  135. <if test="createBy != null">create_by = #{createBy},</if>
  136. <if test="updateBy != null">update_by = #{updateBy},</if>
  137. <if test="updateTime != null">update_time = #{updateTime},</if>
  138. <if test="remark != null">remark = #{remark},</if>
  139. </trim>
  140. where creative_feed_id = #{creativeFeedId}
  141. </update>
  142. <delete id="deleteBdCreativeByCreativeFeedId" parameterType="Long">
  143. delete from bd_creative where creative_feed_id = #{creativeFeedId}
  144. </delete>
  145. <delete id="deleteBdCreativeByCreativeFeedIds" parameterType="String">
  146. delete from bd_creative where creative_feed_id in
  147. <foreach item="creativeFeedId" collection="array" open="(" separator="," close=")">
  148. #{creativeFeedId}
  149. </foreach>
  150. </delete>
  151. </mapper>