FsUserCourseVideoMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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.FsUserCourseVideoMapper">
  6. <resultMap type="FsUserCourseVideo" id="FsUserCourseVideoResult">
  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="videoUrl" column="video_url" />
  12. <result property="thumbnail" column="thumbnail" />
  13. <result property="duration" column="duration" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="createTime" column="create_time" />
  16. <result property="talentId" column="talent_id" />
  17. <result property="courseId" column="course_id" />
  18. <result property="status" column="status" />
  19. <result property="courseSort" column="course_sort" />
  20. <result property="fileName" column="file_name" />
  21. <result property="isDel" column="is_del" />
  22. <result property="questionBankId" column="question_bank_id" />
  23. <result property="lineOne" column="line_one" />
  24. <result property="lineTwo" column="line_two" />
  25. <result property="lineThree" column="line_three" />
  26. <result property="uploadType" column="upload_type" />
  27. <result property="redPacketMoney" column="red_packet_money" />
  28. <result property="fileSize" column="file_size" />
  29. <result property="fileKey" column="file_key" />
  30. <result property="round" column="round" />
  31. <result property="packageJson" column="package_json" />
  32. <result property="isTranscode" column="is_transcode" />
  33. <result property="transcodeFileKey" column="transcode_file_key" />
  34. </resultMap>
  35. <sql id="selectFsUserCourseVideoVo">
  36. select video_id,line_one,package_json,is_transcode,transcode_file_key,file_size,file_key,round,red_packet_money,line_two,upload_type,line_three, file_id,file_name,is_del, title, description, video_url, thumbnail, duration, update_time, create_time, talent_id, course_id, status, course_sort, question_bank_id from fs_user_course_video
  37. </sql>
  38. <select id="selectFsUserCourseVideoList" parameterType="FsUserCourseVideo" resultMap="FsUserCourseVideoResult">
  39. <include refid="selectFsUserCourseVideoVo"/>
  40. <where>
  41. <if test="fileId != null and fileId != ''"> and file_id = #{fileId}</if>
  42. <if test="title != null and title != ''"> and title = #{title}</if>
  43. <if test="description != null and description != ''"> and description = #{description}</if>
  44. <if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
  45. <if test="thumbnail != null and thumbnail != ''"> and thumbnail = #{thumbnail}</if>
  46. <if test="duration != null "> and duration = #{duration}</if>
  47. <if test="talentId != null "> and talent_id = #{talentId}</if>
  48. <if test="courseId != null "> and course_id = #{courseId}</if>
  49. <if test="status != null "> and status = #{status}</if>
  50. <if test="courseSort != null "> and course_sort = #{courseSort}</if>
  51. <if test="questionBankId != null "> and question_bank_id = #{questionBankId}</if>
  52. </where>
  53. </select>
  54. <select id="selectFsUserCourseVideoByVideoId" parameterType="Long" resultMap="FsUserCourseVideoResult">
  55. <include refid="selectFsUserCourseVideoVo"/>
  56. where video_id = #{videoId}
  57. </select>
  58. <insert id="insertFsUserCourseVideo" parameterType="FsUserCourseVideo" useGeneratedKeys="true" keyProperty="videoId">
  59. insert into fs_user_course_video
  60. <trim prefix="(" suffix=")" suffixOverrides=",">
  61. <if test="fileId != null">file_id,</if>
  62. <if test="title != null">title,</if>
  63. <if test="description != null">description,</if>
  64. <if test="videoUrl != null">video_url,</if>
  65. <if test="thumbnail != null">thumbnail,</if>
  66. <if test="duration != null">duration,</if>
  67. <if test="updateTime != null">update_time,</if>
  68. <if test="createTime != null">create_time,</if>
  69. <if test="talentId != null">talent_id,</if>
  70. <if test="courseId != null">course_id,</if>
  71. <if test="status != null">status,</if>
  72. <if test="courseSort != null">course_sort,</if>
  73. <if test="fileName != null">file_name,</if>
  74. <if test="isDel != null">is_del,</if>
  75. <if test="questionBankId != null">question_bank_id,</if>
  76. <if test="lineOne != null">line_one,</if>
  77. <if test="lineTwo != null">line_two,</if>
  78. <if test="lineThree != null">line_three,</if>
  79. <if test="uploadType != null">upload_type,</if>
  80. <if test="redPacketMoney != null">red_packet_money,</if>
  81. <if test="fileSize != null">file_size,</if>
  82. <if test="fileKey != null">file_key,</if>
  83. <if test="round != null">round,</if>
  84. <if test="packageJson != null">package_json,</if>
  85. <if test="isTranscode != null">is_transcode,</if>
  86. <if test="transcodeFileKey != null">transcode_file_key,</if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="fileId != null">#{fileId},</if>
  90. <if test="title != null">#{title},</if>
  91. <if test="description != null">#{description},</if>
  92. <if test="videoUrl != null">#{videoUrl},</if>
  93. <if test="thumbnail != null">#{thumbnail},</if>
  94. <if test="duration != null">#{duration},</if>
  95. <if test="updateTime != null">#{updateTime},</if>
  96. <if test="createTime != null">#{createTime},</if>
  97. <if test="talentId != null">#{talentId},</if>
  98. <if test="courseId != null">#{courseId},</if>
  99. <if test="status != null">#{status},</if>
  100. <if test="courseSort != null">#{courseSort},</if>
  101. <if test="fileName != null">#{fileName},</if>
  102. <if test="isDel != null">#{isDel},</if>
  103. <if test="questionBankId != null">#{questionBankId},</if>
  104. <if test="lineOne != null">#{lineOne},</if>
  105. <if test="lineTwo != null">#{lineTwo},</if>
  106. <if test="lineThree != null">#{lineThree},</if>
  107. <if test="uploadType != null">#{uploadType},</if>
  108. <if test="redPacketMoney != null">#{redPacketMoney},</if>
  109. <if test="fileSize != null">#{fileSize},</if>
  110. <if test="fileKey != null">#{fileKey},</if>
  111. <if test="round != null">#{round},</if>
  112. <if test="packageJson != null">#{packageJson},</if>
  113. <if test="isTranscode != null">#{isTranscode},</if>
  114. <if test="transcodeFileKey != null">#{transcodeFileKey},</if>
  115. </trim>
  116. </insert>
  117. <update id="updateFsUserCourseVideo" parameterType="FsUserCourseVideo">
  118. update fs_user_course_video
  119. <trim prefix="SET" suffixOverrides=",">
  120. <if test="fileId != null">file_id = #{fileId},</if>
  121. <if test="title != null">title = #{title},</if>
  122. <if test="description != null">description = #{description},</if>
  123. <if test="videoUrl != null">video_url = #{videoUrl},</if>
  124. <if test="thumbnail != null">thumbnail = #{thumbnail},</if>
  125. <if test="duration != null">duration = #{duration},</if>
  126. <if test="updateTime != null">update_time = #{updateTime},</if>
  127. <if test="createTime != null">create_time = #{createTime},</if>
  128. <if test="talentId != null">talent_id = #{talentId},</if>
  129. <if test="courseId != null">course_id = #{courseId},</if>
  130. <if test="status != null">status = #{status},</if>
  131. <if test="courseSort != null">course_sort = #{courseSort},</if>
  132. <if test="fileName != null">file_name = #{fileName},</if>
  133. <if test="isDel != null">is_del = #{isDel},</if>
  134. <if test="questionBankId != null">question_bank_id = #{questionBankId},</if>
  135. <if test="lineOne != null">line_one = #{lineOne},</if>
  136. <if test="lineTwo != null">line_two = #{lineTwo},</if>
  137. <if test="lineThree != null">line_three = #{lineThree},</if>
  138. <if test="uploadType != null">upload_type = #{uploadType},</if>
  139. <if test="redPacketMoney != null">red_packet_money = #{redPacketMoney},</if>
  140. <if test="fileSize != null">file_size = #{fileSize},</if>
  141. <if test="fileKey != null">file_key = #{fileKey},</if>
  142. <if test="round != null">round = #{round},</if>
  143. <if test="packageJson != null">package_json = #{packageJson},</if>
  144. <if test="isTranscode != null">is_transcode = #{isTranscode},</if>
  145. <if test="transcodeFileKey != null">transcode_file_key = #{transcodeFileKey},</if>
  146. </trim>
  147. where video_id = #{videoId}
  148. </update>
  149. <update id="deleteFsUserCourseVideoByVideoId" parameterType="String">
  150. update fs_user_course_video set is_del = 1 where video_id = #{videoId}
  151. </update>
  152. <update id="deleteFsUserCourseVideoByVideoIds" parameterType="String">
  153. update fs_user_course_video set is_del = 1 where video_id in
  154. <foreach item="videoId" collection="array" open="(" separator="," close=")">
  155. #{videoId}
  156. </foreach>
  157. </update>
  158. <select id="selectFsUserCourseVideoPageList" resultType="FsUserCourseVideoPageListVO">
  159. SELECT
  160. video.video_id,
  161. video.title,
  162. video.description,
  163. video.video_url,
  164. video.thumbnail,
  165. video.duration,
  166. video.create_time,
  167. video.course_id,
  168. video.STATUS,
  169. video.course_sort,
  170. course.course_name
  171. FROM `fs_user_course_video` video
  172. LEFT JOIN fs_user_course course ON video.course_id = course.course_id
  173. where 1 = 1
  174. <if test="courseId != null and courseId !='' ">
  175. AND video.course_id = #{courseId}
  176. </if>
  177. <if test="keyword != null and keyword !='' ">
  178. AND video.title LIKE concat('%',#{keyword},'%')
  179. </if>
  180. order by video.course_sort
  181. </select>
  182. <!-- 获取课程分析数据 -->
  183. <select id="getCourseAnalysisByMap" resultType="com.fs.course.vo.FsCourseAnalysisVO">
  184. select
  185. fuc.course_id,
  186. fuc.course_name,
  187. fucv.title,
  188. fuc.img_url,
  189. fucv.description
  190. from fs_user_course_video fucv
  191. left join fs_user_course fuc on fuc.course_id = fucv.course_id
  192. </select>
  193. </mapper>