ContentPlatformVideoMapper.xml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoMapper">
  4. <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="dt" jdbcType="VARCHAR" property="dt" />
  7. <result column="video_id" jdbcType="BIGINT" property="videoId" />
  8. <result column="category" jdbcType="VARCHAR" property="category" />
  9. <result column="title" jdbcType="VARCHAR" property="title" />
  10. <result column="video" jdbcType="VARCHAR" property="video" />
  11. <result column="score" jdbcType="DOUBLE" property="score" />
  12. <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
  13. </resultMap>
  14. <sql id="Example_Where_Clause">
  15. <where>
  16. <foreach collection="oredCriteria" item="criteria" separator="or">
  17. <if test="criteria.valid">
  18. <trim prefix="(" prefixOverrides="and" suffix=")">
  19. <foreach collection="criteria.criteria" item="criterion">
  20. <choose>
  21. <when test="criterion.noValue">
  22. and ${criterion.condition}
  23. </when>
  24. <when test="criterion.singleValue">
  25. and ${criterion.condition} #{criterion.value}
  26. </when>
  27. <when test="criterion.betweenValue">
  28. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  29. </when>
  30. <when test="criterion.listValue">
  31. and ${criterion.condition}
  32. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  33. #{listItem}
  34. </foreach>
  35. </when>
  36. </choose>
  37. </foreach>
  38. </trim>
  39. </if>
  40. </foreach>
  41. </where>
  42. </sql>
  43. <sql id="Update_By_Example_Where_Clause">
  44. <where>
  45. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  46. <if test="criteria.valid">
  47. <trim prefix="(" prefixOverrides="and" suffix=")">
  48. <foreach collection="criteria.criteria" item="criterion">
  49. <choose>
  50. <when test="criterion.noValue">
  51. and ${criterion.condition}
  52. </when>
  53. <when test="criterion.singleValue">
  54. and ${criterion.condition} #{criterion.value}
  55. </when>
  56. <when test="criterion.betweenValue">
  57. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  58. </when>
  59. <when test="criterion.listValue">
  60. and ${criterion.condition}
  61. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  62. #{listItem}
  63. </foreach>
  64. </when>
  65. </choose>
  66. </foreach>
  67. </trim>
  68. </if>
  69. </foreach>
  70. </where>
  71. </sql>
  72. <sql id="Base_Column_List">
  73. id, dt, video_id, category, title, video, score, create_timestamp
  74. </sql>
  75. <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample" resultMap="BaseResultMap">
  76. select
  77. <if test="distinct">
  78. distinct
  79. </if>
  80. <include refid="Base_Column_List" />
  81. from content_platform_video
  82. <if test="_parameter != null">
  83. <include refid="Example_Where_Clause" />
  84. </if>
  85. <if test="orderByClause != null">
  86. order by ${orderByClause}
  87. </if>
  88. <if test="page != null">
  89. limit #{page.offset} , #{page.pageSize}
  90. </if>
  91. </select>
  92. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  93. select
  94. <include refid="Base_Column_List" />
  95. from content_platform_video
  96. where id = #{id,jdbcType=BIGINT}
  97. </select>
  98. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  99. delete from content_platform_video
  100. where id = #{id,jdbcType=BIGINT}
  101. </delete>
  102. <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample">
  103. delete from content_platform_video
  104. <if test="_parameter != null">
  105. <include refid="Example_Where_Clause" />
  106. </if>
  107. </delete>
  108. <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
  109. insert into content_platform_video (id, dt, video_id,
  110. category, title, video,
  111. score, create_timestamp)
  112. values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT},
  113. #{category,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR},
  114. #{score,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT})
  115. </insert>
  116. <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
  117. insert into content_platform_video
  118. <trim prefix="(" suffix=")" suffixOverrides=",">
  119. <if test="id != null">
  120. id,
  121. </if>
  122. <if test="dt != null">
  123. dt,
  124. </if>
  125. <if test="videoId != null">
  126. video_id,
  127. </if>
  128. <if test="category != null">
  129. category,
  130. </if>
  131. <if test="title != null">
  132. title,
  133. </if>
  134. <if test="video != null">
  135. video,
  136. </if>
  137. <if test="score != null">
  138. score,
  139. </if>
  140. <if test="createTimestamp != null">
  141. create_timestamp,
  142. </if>
  143. </trim>
  144. <trim prefix="values (" suffix=")" suffixOverrides=",">
  145. <if test="id != null">
  146. #{id,jdbcType=BIGINT},
  147. </if>
  148. <if test="dt != null">
  149. #{dt,jdbcType=VARCHAR},
  150. </if>
  151. <if test="videoId != null">
  152. #{videoId,jdbcType=BIGINT},
  153. </if>
  154. <if test="category != null">
  155. #{category,jdbcType=VARCHAR},
  156. </if>
  157. <if test="title != null">
  158. #{title,jdbcType=VARCHAR},
  159. </if>
  160. <if test="video != null">
  161. #{video,jdbcType=VARCHAR},
  162. </if>
  163. <if test="score != null">
  164. #{score,jdbcType=DOUBLE},
  165. </if>
  166. <if test="createTimestamp != null">
  167. #{createTimestamp,jdbcType=BIGINT},
  168. </if>
  169. </trim>
  170. </insert>
  171. <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample" resultType="java.lang.Long">
  172. select count(*) from content_platform_video
  173. <if test="_parameter != null">
  174. <include refid="Example_Where_Clause" />
  175. </if>
  176. </select>
  177. <update id="updateByExampleSelective" parameterType="map">
  178. update content_platform_video
  179. <set>
  180. <if test="record.id != null">
  181. id = #{record.id,jdbcType=BIGINT},
  182. </if>
  183. <if test="record.dt != null">
  184. dt = #{record.dt,jdbcType=VARCHAR},
  185. </if>
  186. <if test="record.videoId != null">
  187. video_id = #{record.videoId,jdbcType=BIGINT},
  188. </if>
  189. <if test="record.category != null">
  190. category = #{record.category,jdbcType=VARCHAR},
  191. </if>
  192. <if test="record.title != null">
  193. title = #{record.title,jdbcType=VARCHAR},
  194. </if>
  195. <if test="record.video != null">
  196. video = #{record.video,jdbcType=VARCHAR},
  197. </if>
  198. <if test="record.score != null">
  199. score = #{record.score,jdbcType=DOUBLE},
  200. </if>
  201. <if test="record.createTimestamp != null">
  202. create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
  203. </if>
  204. </set>
  205. <if test="_parameter != null">
  206. <include refid="Update_By_Example_Where_Clause" />
  207. </if>
  208. </update>
  209. <update id="updateByExample" parameterType="map">
  210. update content_platform_video
  211. set id = #{record.id,jdbcType=BIGINT},
  212. dt = #{record.dt,jdbcType=VARCHAR},
  213. video_id = #{record.videoId,jdbcType=BIGINT},
  214. category = #{record.category,jdbcType=VARCHAR},
  215. title = #{record.title,jdbcType=VARCHAR},
  216. video = #{record.video,jdbcType=VARCHAR},
  217. score = #{record.score,jdbcType=DOUBLE},
  218. create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
  219. <if test="_parameter != null">
  220. <include refid="Update_By_Example_Where_Clause" />
  221. </if>
  222. </update>
  223. <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
  224. update content_platform_video
  225. <set>
  226. <if test="dt != null">
  227. dt = #{dt,jdbcType=VARCHAR},
  228. </if>
  229. <if test="videoId != null">
  230. video_id = #{videoId,jdbcType=BIGINT},
  231. </if>
  232. <if test="category != null">
  233. category = #{category,jdbcType=VARCHAR},
  234. </if>
  235. <if test="title != null">
  236. title = #{title,jdbcType=VARCHAR},
  237. </if>
  238. <if test="video != null">
  239. video = #{video,jdbcType=VARCHAR},
  240. </if>
  241. <if test="score != null">
  242. score = #{score,jdbcType=DOUBLE},
  243. </if>
  244. <if test="createTimestamp != null">
  245. create_timestamp = #{createTimestamp,jdbcType=BIGINT},
  246. </if>
  247. </set>
  248. where id = #{id,jdbcType=BIGINT}
  249. </update>
  250. <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
  251. update content_platform_video
  252. set dt = #{dt,jdbcType=VARCHAR},
  253. video_id = #{videoId,jdbcType=BIGINT},
  254. category = #{category,jdbcType=VARCHAR},
  255. title = #{title,jdbcType=VARCHAR},
  256. video = #{video,jdbcType=VARCHAR},
  257. score = #{score,jdbcType=DOUBLE},
  258. create_timestamp = #{createTimestamp,jdbcType=BIGINT}
  259. where id = #{id,jdbcType=BIGINT}
  260. </update>
  261. </mapper>