FsUserVideoMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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.course.mapper.FsUserVideoMapper">
  6. <resultMap type="FsUserVideo" id="FsUserVideoResult">
  7. <result property="videoId" column="video_id" />
  8. <result property="fileId" column="file_id" />
  9. <result property="title" column="title" />
  10. <result property="description" column="description" />
  11. <result property="url" column="url" />
  12. <result property="thumbnail" column="thumbnail" />
  13. <result property="duration" column="duration" />
  14. <result property="createTime" column="create_time" />
  15. <result property="talentId" column="talent_id" />
  16. <result property="cateId" column="cate_id" />
  17. <result property="likes" column="likes" />
  18. <result property="views" column="views" />
  19. <result property="comments" column="comments" />
  20. <result property="status" column="status" />
  21. <result property="isHot" column="is_hot" />
  22. <result property="isAudit" column="is_audit" />
  23. <result property="auditBy" column="audit_by" />
  24. <result property="auditTime" column="audit_time" />
  25. <result property="updateTime" column="update_time" />
  26. <result property="source" column="source" />
  27. <result property="isDel" column="is_del" />
  28. <result property="shares" column="shares" />
  29. <result property="tags" column="tags" />
  30. <result property="productId" column="product_id" />
  31. <result property="productJson" column="product_json" />
  32. <result property="favoriteNum" column="favorite_num" />
  33. <result property="uploadType" column="upload_type" />
  34. <result property="txCdnUrl" column="tx_cdn_url" />
  35. <result property="txPcdnUrl" column="tx_pcdn_url" />
  36. <result property="txVodUrl" column="tx_vod_url" />
  37. <result property="hwObsUrl" column="hw_obs_url" />
  38. <result property="hwVodUrl" column="hw_vod_url" />
  39. <result property="addNum" column="add_num" />
  40. </resultMap>
  41. <sql id="selectFsUserVideoVo">
  42. select video_id, file_id, title, description, url, thumbnail, duration, create_time, talent_id, cate_id, likes, views, comments, status, is_hot, is_audit, audit_by, audit_time, update_time, source, is_del, shares, tags, product_id, product_json, favorite_num, upload_type, tx_cdn_url, tx_pcdn_url, tx_vod_url, hw_obs_url, hw_vod_url,add_num from fs_user_video
  43. </sql>
  44. <select id="selectFsUserVideoList" parameterType="FsUserVideo" resultMap="FsUserVideoResult">
  45. <include refid="selectFsUserVideoVo"/>
  46. <where>
  47. is_del = 0
  48. <if test="fileId != null and fileId != ''"> and file_id = #{fileId}</if>
  49. <if test="title != null and title != ''"> and title = #{title}</if>
  50. <if test="description != null and description != ''"> and description = #{description}</if>
  51. <if test="url != null and url != ''"> and url = #{url}</if>
  52. <if test="thumbnail != null and thumbnail != ''"> and thumbnail = #{thumbnail}</if>
  53. <if test="duration != null "> and duration = #{duration}</if>
  54. <if test="talentId != null "> and talent_id = #{talentId}</if>
  55. <if test="cateId != null "> and cate_id = #{cateId}</if>
  56. <if test="likes != null "> and likes = #{likes}</if>
  57. <if test="views != null "> and views = #{views}</if>
  58. <if test="comments != null "> and comments = #{comments}</if>
  59. <if test="status != null "> and status = #{status}</if>
  60. <if test="isHot != null "> and is_hot = #{isHot}</if>
  61. <if test="isAudit != null "> and is_audit = #{isAudit}</if>
  62. <if test="auditBy != null "> and audit_by = #{auditBy}</if>
  63. <if test="auditTime != null "> and audit_time = #{auditTime}</if>
  64. <if test="source != null "> and source = #{source}</if>
  65. <if test="isDel != null "> and is_del = #{isDel}</if>
  66. <if test="shares != null "> and shares = #{shares}</if>
  67. <if test="tags != null and tags != ''"> and tags = #{tags}</if>
  68. <if test="productId != null "> and product_id = #{productId}</if>
  69. <if test="productJson != null and productJson != ''"> and product_json = #{productJson}</if>
  70. <if test="favoriteNum != null "> and favorite_num = #{favoriteNum}</if>
  71. <if test="addNum != null "> and add_num = #{addNum}</if>
  72. </where>
  73. </select>
  74. <select id="selectFsUserVideoByVideoId" parameterType="String" resultMap="FsUserVideoResult">
  75. <include refid="selectFsUserVideoVo"/>
  76. where video_id = #{videoId}
  77. </select>
  78. <select id="selectVideoByTalentId" resultMap="FsUserVideoResult">
  79. <include refid="selectFsUserVideoVo"/>
  80. where talent_id = #{talentId}
  81. </select>
  82. <insert id="insertFsUserVideo" parameterType="FsUserVideo" useGeneratedKeys="true" keyProperty="videoId">
  83. insert into fs_user_video
  84. <trim prefix="(" suffix=")" suffixOverrides=",">
  85. <if test="fileId != null">file_id,</if>
  86. <if test="title != null">title,</if>
  87. <if test="description != null">description,</if>
  88. <if test="url != null">url,</if>
  89. <if test="thumbnail != null">thumbnail,</if>
  90. <if test="duration != null">duration,</if>
  91. <if test="createTime != null">create_time,</if>
  92. <if test="talentId != null">talent_id,</if>
  93. <if test="cateId != null">cate_id,</if>
  94. <if test="likes != null">likes,</if>
  95. <if test="views != null">views,</if>
  96. <if test="comments != null">comments,</if>
  97. <if test="status != null">status,</if>
  98. <if test="isHot != null">is_hot,</if>
  99. <if test="isAudit != null">is_audit,</if>
  100. <if test="auditBy != null">audit_by,</if>
  101. <if test="auditTime != null">audit_time,</if>
  102. <if test="updateTime != null">update_time,</if>
  103. <if test="source != null">source,</if>
  104. <if test="isDel != null">is_del,</if>
  105. <if test="shares != null">shares,</if>
  106. <if test="tags != null">tags,</if>
  107. <if test="productId != null">product_id,</if>
  108. <if test="productJson != null">product_json,</if>
  109. <if test="favoriteNum != null">favorite_num,</if>
  110. <if test="uploadType != null">upload_type,</if>
  111. <if test="txCdnUrl != null">tx_cdn_url,</if>
  112. <if test="txPcdnUrl != null">tx_pcdn_url,</if>
  113. <if test="txVodUrl != null">tx_vod_url,</if>
  114. <if test="hwObsUrl != null">hw_obs_url,</if>
  115. <if test="hwVodUrl != null">hw_vod_url,</if>
  116. <if test="addNum != null">add_num,</if>
  117. </trim>
  118. <trim prefix="values (" suffix=")" suffixOverrides=",">
  119. <if test="fileId != null">#{fileId},</if>
  120. <if test="title != null">#{title},</if>
  121. <if test="description != null">#{description},</if>
  122. <if test="url != null">#{url},</if>
  123. <if test="thumbnail != null">#{thumbnail},</if>
  124. <if test="duration != null">#{duration},</if>
  125. <if test="createTime != null">#{createTime},</if>
  126. <if test="talentId != null">#{talentId},</if>
  127. <if test="cateId != null">#{cateId},</if>
  128. <if test="likes != null">#{likes},</if>
  129. <if test="views != null">#{views},</if>
  130. <if test="comments != null">#{comments},</if>
  131. <if test="status != null">#{status},</if>
  132. <if test="isHot != null">#{isHot},</if>
  133. <if test="isAudit != null">#{isAudit},</if>
  134. <if test="auditBy != null">#{auditBy},</if>
  135. <if test="auditTime != null">#{auditTime},</if>
  136. <if test="updateTime != null">#{updateTime},</if>
  137. <if test="source != null">#{source},</if>
  138. <if test="isDel != null">#{isDel},</if>
  139. <if test="shares != null">#{shares},</if>
  140. <if test="tags != null">#{tags},</if>
  141. <if test="productId != null">#{productId},</if>
  142. <if test="productJson != null">#{productJson},</if>
  143. <if test="favoriteNum != null">#{favoriteNum},</if>
  144. <if test="uploadType != null">#{uploadType},</if>
  145. <if test="txCdnUrl != null">#{txCdnUrl},</if>
  146. <if test="txPcdnUrl != null">#{txPcdnUrl},</if>
  147. <if test="txVodUrl != null">#{txVodUrl},</if>
  148. <if test="hwObsUrl != null">#{hwObsUrl},</if>
  149. <if test="hwVodUrl != null">#{hwVodUrl},</if>
  150. <if test="addNum != null">#{addNum},</if>
  151. </trim>
  152. </insert>
  153. <update id="updateFsUserVideo" parameterType="FsUserVideo">
  154. update fs_user_video
  155. <trim prefix="SET" suffixOverrides=",">
  156. <if test="fileId != null">file_id = #{fileId},</if>
  157. <if test="title != null">title = #{title},</if>
  158. <if test="description != null">description = #{description},</if>
  159. <if test="url != null">url = #{url},</if>
  160. <if test="thumbnail != null">thumbnail = #{thumbnail},</if>
  161. <if test="duration != null">duration = #{duration},</if>
  162. <if test="createTime != null">create_time = #{createTime},</if>
  163. <if test="talentId != null">talent_id = #{talentId},</if>
  164. <if test="cateId != null">cate_id = #{cateId},</if>
  165. <if test="likes != null">likes = #{likes},</if>
  166. <if test="views != null">views = #{views},</if>
  167. <if test="comments != null">comments = #{comments},</if>
  168. <if test="status != null">status = #{status},</if>
  169. <if test="isHot != null">is_hot = #{isHot},</if>
  170. <if test="isAudit != null">is_audit = #{isAudit},</if>
  171. <if test="auditBy != null">audit_by = #{auditBy},</if>
  172. <if test="auditTime != null">audit_time = #{auditTime},</if>
  173. <if test="updateTime != null">update_time = #{updateTime},</if>
  174. <if test="source != null">source = #{source},</if>
  175. <if test="isDel != null">is_del = #{isDel},</if>
  176. <if test="shares != null">shares = #{shares},</if>
  177. <if test="tags != null">tags = #{tags},</if>
  178. <if test="productId != null">product_id = #{productId},</if>
  179. <if test="productJson != null">product_json = #{productJson},</if>
  180. <if test="favoriteNum != null">favorite_num = #{favoriteNum},</if>
  181. <if test="uploadType != null">upload_type = #{uploadType},</if>
  182. <if test="txCdnUrl != null">tx_cdn_url = #{txCdnUrl},</if>
  183. <if test="txPcdnUrl != null">tx_pcdn_url = #{txPcdnUrl},</if>
  184. <if test="txVodUrl != null">tx_vod_url = #{txVodUrl},</if>
  185. <if test="hwObsUrl != null">hw_obs_url = #{hwObsUrl},</if>
  186. <if test="hwVodUrl != null">hw_vod_url = #{hwVodUrl},</if>
  187. <if test="addNum != null">add_num = #{addNum},</if>
  188. </trim>
  189. where video_id = #{videoId}
  190. </update>
  191. <update id="deleteFsUserVideoByVideoId" parameterType="String">
  192. update fs_user_video set is_del = 1 where video_id = #{videoId}
  193. </update>
  194. <update id="deleteFsUserVideoByVideoIds" parameterType="String">
  195. update fs_user_video set is_del = 1 where video_id in
  196. <foreach item="videoId" collection="array" open="(" separator="," close=")">
  197. #{videoId}
  198. </foreach>
  199. </update>
  200. </mapper>