后台服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 regels
7.7 KiB

  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.iformall.mapper.PhotoSpeakVideoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.PhotoSpeakVideo">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  9. <result column="person_photo_id" jdbcType="BIGINT" property="personPhotoId"/>
  10. <result column="person_photo_url" jdbcType="VARCHAR" property="personPhotoUrl"/>
  11. <result column="subtitle_enabled" jdbcType="INTEGER" property="subtitleEnabled"/>
  12. <result column="subtitle_params" jdbcType="VARCHAR" property="subtitleParams"/>
  13. <result column="voice_from" jdbcType="INTEGER" property="voiceFrom"/>
  14. <result column="voice_mould_id" jdbcType="BIGINT" property="voiceMouldId"/>
  15. <result column="voice_mould_sm" jdbcType="VARCHAR" property="voiceMouldSm"/>
  16. <result column="paperwork" jdbcType="VARCHAR" property="paperwork"/>
  17. <result column="voice_material_id" jdbcType="BIGINT" property="voiceMaterialId"/>
  18. <result column="voice_material_url" jdbcType="VARCHAR" property="voiceMaterialUrl"/>
  19. <result column="title" jdbcType="VARCHAR" property="title"/>
  20. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  21. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  22. <result column="video_id" jdbcType="VARCHAR" property="videoId"/>
  23. <result column="video_path" jdbcType="VARCHAR" property="videoPath"/>
  24. <result column="video_play_url" jdbcType="VARCHAR" property="videoPlayUrl"/>
  25. <result column="video_time" jdbcType="VARCHAR" property="videoTime"/>
  26. <result column="video_size" jdbcType="BIGINT" property="videoSize"/>
  27. <result column="video_status" jdbcType="INTEGER" property="videoStatus"/>
  28. <result column="video_msg" jdbcType="VARCHAR" property="videoMsg"/>
  29. <result column="is_hy" jdbcType="INTEGER" property="isHy"/>
  30. <result column="video_hy_status" jdbcType="INTEGER" property="videoHyStatus"/>
  31. <result column="music_id" jdbcType="VARCHAR" property="musicId"/>
  32. <result column="save_dir" jdbcType="VARCHAR" property="saveDir"/>
  33. <result column="create_video_date" jdbcType="TIMESTAMP" property="createVideoDate"/>
  34. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  35. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  36. </resultMap>
  37. <sql id="allColumns">
  38. `id`, `tenant_id`, `parent_tenant_id`, `user_id`,
  39. `person_photo_id`, `person_photo_url`, `subtitle_enabled`, `subtitle_params`, `voice_from`, `voice_mould_id`, `voice_mould_sm`, `paperwork`, `voice_material_id`, `voice_material_url`,
  40. `title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`, `create_video_date`, `create_date`, `update_date`,
  41. `is_hy`,`video_hy_status`,`music_id`,`save_dir`
  42. </sql>
  43. <sql id="dynamicWhereConditions">
  44. where `is_del` = 0
  45. <if test=" null != id ">
  46. and `id` = #{id}
  47. </if>
  48. <if test=" null != tenantId and '' != tenantId">
  49. and `tenant_id` = #{tenantId}
  50. </if>
  51. <if test=" null != parentTenantId and '' != parentTenantId">
  52. and `parent_tenant_id` = #{parentTenantId}
  53. </if>
  54. <if test=" null != userId ">
  55. and `user_id` = #{userId}
  56. </if>
  57. <if test=" null != voiceFrom ">
  58. and `voice_from` = #{voiceFrom}
  59. </if>
  60. <if test=" null != isHy ">
  61. and `is_hy` = #{isHy}
  62. </if>
  63. <if test=" null != musicId ">
  64. and `music_id` = #{musicId}
  65. </if>
  66. <if test=" null != saveDir ">
  67. and `save_dir` = #{saveDir}
  68. </if>
  69. <if test=" null != voiceMouldId ">
  70. and `voice_mould_id` = #{voiceMouldId}
  71. </if>
  72. <if test=" null != title and ''!=title">
  73. and `title` like concat('%', #{title},'%')
  74. </if>
  75. <if test=" null != videoStatus ">
  76. and `video_status` = #{videoStatus}
  77. </if>
  78. <if test=" null != videoHyStatus ">
  79. and `video_hy_status` = #{videoHyStatus}
  80. </if>
  81. <if test=" null != startDate ">
  82. and create_date &gt;= #{startDate}
  83. </if>
  84. <if test=" null != endDate">
  85. and create_date &lt; #{endDate}
  86. </if>
  87. <if test=" null != videoStartDate ">
  88. and create_video_date &gt;= #{videoStartDate}
  89. </if>
  90. <if test=" null != videoEndDate">
  91. and create_video_date &lt; #{videoEndDate}
  92. </if>
  93. <if test=" null != videoStatuss ">
  94. and video_status in
  95. <foreach collection="videoStatuss" index="index" item="videoStatusItem" open="(" separator="," close=")">
  96. #{videoStatusItem}
  97. </foreach>
  98. </if>
  99. <if test=" null != ids ">
  100. and id in
  101. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  102. #{idItem}
  103. </foreach>
  104. </if>
  105. <if test=" null != sortColumns">order by ${sortColumns}</if>
  106. </sql>
  107. <select id="findList" parameterType="com.iformall.domain.po.sm.UserMouldVideo" resultMap="BaseResultMap">
  108. select
  109. <include refid="allColumns"/>
  110. from photo_speak_video
  111. <include refid="dynamicWhereConditions"/>
  112. </select>
  113. <delete id="deleteById" parameterType="java.util.HashMap">
  114. update photo_speak_video set is_del = 1,update_date = now() where id = #{id}
  115. </delete>
  116. <select id="findCList" parameterType="com.iformall.domain.po.sm.UserMouldVideo" resultMap="BaseResultMap">
  117. select
  118. `id`,
  119. `paperwork`,
  120. `title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`,`video_msg`,
  121. `create_video_date`, `create_date`, `update_date`,`is_hy`,`video_hy_status`
  122. from photo_speak_video
  123. <include refid="dynamicWhereConditions"/>
  124. </select>
  125. <select id="findVideo" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  126. select
  127. `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`
  128. from photo_speak_video
  129. where `id` = #{id}
  130. </select>
  131. <select id="getSortList" parameterType="com.iformall.domain.po.sm.UserMouldVideo" resultMap="BaseResultMap">
  132. select id,title,video_id,video_path, video_play_url,video_status
  133. from photo_speak_video
  134. <include refid="dynamicWhereConditions"/>
  135. </select>
  136. <select id="checkVideoStatus" resultType="java.lang.Integer">
  137. select count(1)
  138. from photo_speak_video
  139. where user_id = #{userId}
  140. and (video_status = 5 or video_status = 11)
  141. <if test="list != null and list.size > 0">
  142. and id in
  143. <foreach collection="list" index="index" item="id" open="(" separator="," close=")">
  144. #{id}
  145. </foreach>
  146. </if>
  147. </select>
  148. <select id="getNotHaveUrl" resultType="com.iformall.domain.po.sm.PhotoSpeakVideo">
  149. select id,title,video_id,video_path, video_play_url,video_status
  150. from photo_speak_video
  151. where `is_del` = 0
  152. and `video_id` is not null
  153. and `video_id` != ''
  154. and (`cover_img` = '' or `cover_img` is null)
  155. </select>
  156. </mapper>