LiveMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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.live.mapper.LiveMapper">
  6. <resultMap type="Live" id="LiveResult">
  7. <result property="liveId" column="live_id" />
  8. <result property="companyId" column="company_id" />
  9. <result property="companyUserId" column="company_user_id" />
  10. <result property="talentId" column="talent_id" />
  11. <result property="liveName" column="live_name" />
  12. <result property="liveDesc" column="live_desc" />
  13. <result property="showType" column="show_type" />
  14. <result property="status" column="status" />
  15. <result property="anchorId" column="anchor_id" />
  16. <result property="liveType" column="live_type" />
  17. <result property="startTime" column="start_time" />
  18. <result property="finishTime" column="finish_time" />
  19. <result property="liveImgUrl" column="live_img_url" />
  20. <result property="liveConfig" column="live_config" />
  21. <result property="isShow" column="is_show" />
  22. <result property="isDel" column="is_del" />
  23. <result property="qwQrCode" column="qw_qr_code" />
  24. <result property="rtmpUrl" column="rtmp_url" />
  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. <result property="configJson" column="config_json" />
  31. <result property="isAudit" column="is_audit" />
  32. </resultMap>
  33. <sql id="selectLiveVo">
  34. select live_id, company_id, company_user_id,talent_id, live_name, is_audit, live_desc, show_type, status, anchor_id, live_type, start_time, finish_time, live_img_url, live_config, id_card_url, is_show, is_del, qw_qr_code, rtmp_url, flv_hls_url, create_time, create_by, update_by, update_time, remark,config_json from live
  35. </sql>
  36. <select id="selectLiveList" parameterType="Live" resultMap="LiveResult">
  37. <include refid="selectLiveVo"/>
  38. <where>
  39. <if test="companyId != null "> and company_id = #{companyId}</if>
  40. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  41. <if test="talentId != null "> and talent_id = #{talentId}</if>
  42. <if test="liveName != null and liveName != ''"> and live_name like concat('%', #{liveName}, '%')</if>
  43. <if test="liveDesc != null and liveDesc != ''"> and live_desc = #{liveDesc}</if>
  44. <if test="showType != null "> and show_type = #{showType}</if>
  45. <if test="status != null "> and status = #{status}</if>
  46. <if test="anchorId != null "> and anchor_id = #{anchorId}</if>
  47. <if test="liveType != null "> and live_type = #{liveType}</if>
  48. <if test="startTime != null "> and start_time = #{startTime}</if>
  49. <if test="finishTime != null "> and finish_time = #{finishTime}</if>
  50. <if test="liveImgUrl != null and liveImgUrl != ''"> and live_img_url = #{liveImgUrl}</if>
  51. <if test="liveConfig != null and liveConfig != ''"> and live_config = #{liveConfig}</if>
  52. <if test="isShow != null "> and is_show = #{isShow}</if>
  53. <if test="isDel != null "> and is_del = #{isDel}</if>
  54. <if test="qwQrCode != null and qwQrCode != ''"> and qw_qr_code = #{qwQrCode}</if>
  55. <if test="rtmpUrl != null and rtmpUrl != ''"> and rtmp_url = #{rtmpUrl}</if>
  56. <if test="flvHlsUrl != null and flvHlsUrl != ''"> and flv_hls_url = #{flvHlsUrl}</if>
  57. <if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if>
  58. </where>
  59. </select>
  60. <select id="selectLiveByLiveId" parameterType="Long" resultMap="LiveResult">
  61. <include refid="selectLiveVo"/>
  62. where live_id = #{liveId}
  63. </select>
  64. <select id="selectLiveByLiveIdAndCompanyIdAndCompanyUserId" resultMap="LiveResult">
  65. <include refid="selectLiveVo"/>
  66. where live_id = #{liveId} and company_id = #{companyId} and company_user_id = #{companyUserId}
  67. </select>
  68. <select id="selectLiveToStudent" resultType="com.fs.live.domain.Live">
  69. <include refid="selectLiveVo"/>
  70. where 1=1
  71. <if test="status != null and status != ''">
  72. AND status = #{status}
  73. </if>
  74. <if test="liveName != null and liveName != null">
  75. AND live_name like concat('%', #{liveName}, '%')
  76. </if>
  77. <if test="startTime != null and startTime != '' and finishTime != null and finishTime != ''">
  78. AND start_time BETWEEN #{startTime} AND #{finishTime}
  79. </if>
  80. </select>
  81. <insert id="insertLive" parameterType="Live" useGeneratedKeys="true" keyProperty="liveId">
  82. insert into live
  83. <trim prefix="(" suffix=")" suffixOverrides=",">
  84. <if test="companyId != null">company_id,</if>
  85. <if test="companyUserId != null">company_user_id,</if>
  86. <if test="talentId != null">talent_id,</if>
  87. <if test="liveName != null">live_name,</if>
  88. <if test="liveDesc != null">live_desc,</if>
  89. <if test="showType != null">show_type,</if>
  90. <if test="status != null">status,</if>
  91. <if test="anchorId != null">anchor_id,</if>
  92. <if test="liveType != null">live_type,</if>
  93. <if test="startTime != null">start_time,</if>
  94. <if test="finishTime != null">finish_time,</if>
  95. <if test="liveImgUrl != null">live_img_url,</if>
  96. <if test="liveConfig != null">live_config,</if>
  97. <if test="isShow != null">is_show,</if>
  98. <if test="isDel != null">is_del,</if>
  99. <if test="qwQrCode != null">qw_qr_code,</if>
  100. <if test="rtmpUrl != null">rtmp_url,</if>
  101. <if test="createTime != null">create_time,</if>
  102. <if test="createBy != null">create_by,</if>
  103. <if test="updateBy != null">update_by,</if>
  104. <if test="updateTime != null">update_time,</if>
  105. <if test="remark != null">remark,</if>
  106. <if test="configJson != null">config_json,</if>
  107. <if test="flvHlsUrl != null">flv_hls_url,</if>
  108. <if test="isAudit != null">is_audit,</if>
  109. </trim>
  110. <trim prefix="values (" suffix=")" suffixOverrides=",">
  111. <if test="companyId != null">#{companyId},</if>
  112. <if test="companyUserId != null">#{companyUserId},</if>
  113. <if test="talentId != null">#{talentId},</if>
  114. <if test="liveName != null">#{liveName},</if>
  115. <if test="liveDesc != null">#{liveDesc},</if>
  116. <if test="showType != null">#{showType},</if>
  117. <if test="status != null">#{status},</if>
  118. <if test="anchorId != null">#{anchorId},</if>
  119. <if test="liveType != null">#{liveType},</if>
  120. <if test="startTime != null">#{startTime},</if>
  121. <if test="finishTime != null">#{finishTime},</if>
  122. <if test="liveImgUrl != null">#{liveImgUrl},</if>
  123. <if test="liveConfig != null">#{liveConfig},</if>
  124. <if test="isShow != null">#{isShow},</if>
  125. <if test="isDel != null">#{isDel},</if>
  126. <if test="qwQrCode != null">#{qwQrCode},</if>
  127. <if test="rtmpUrl != null">#{rtmpUrl},</if>
  128. <if test="createTime != null">#{createTime},</if>
  129. <if test="createBy != null">#{createBy},</if>
  130. <if test="updateBy != null">#{updateBy},</if>
  131. <if test="updateTime != null">#{updateTime},</if>
  132. <if test="remark != null">#{remark},</if>
  133. <if test="configJson != null">#{configJson},</if>
  134. <if test="flvHlsUrl != null">#{flvHlsUrl},</if>
  135. <if test="isAudit != null">#{isAudit},</if>
  136. </trim>
  137. </insert>
  138. <update id="updateLive" parameterType="Live">
  139. update live
  140. <trim prefix="SET" suffixOverrides=",">
  141. <if test="talentId != null">talent_id = #{talentId},</if>
  142. <if test="liveName != null">live_name = #{liveName},</if>
  143. <if test="liveDesc != null">live_desc = #{liveDesc},</if>
  144. <if test="showType != null">show_type = #{showType},</if>
  145. <if test="status != null">status = #{status},</if>
  146. <if test="anchorId != null">anchor_id = #{anchorId},</if>
  147. <if test="liveType != null">live_type = #{liveType},</if>
  148. <if test="startTime != null">start_time = #{startTime},</if>
  149. <if test="finishTime != null">finish_time = #{finishTime},</if>
  150. <if test="liveImgUrl != null">live_img_url = #{liveImgUrl},</if>
  151. <if test="liveConfig != null">live_config = #{liveConfig},</if>
  152. <if test="isShow != null">is_show = #{isShow},</if>
  153. <if test="isDel != null">is_del = #{isDel},</if>
  154. <if test="qwQrCode != null">qw_qr_code = #{qwQrCode},</if>
  155. <if test="rtmpUrl != null">rtmp_url = #{rtmpUrl},</if>
  156. <if test="createTime != null">create_time = #{createTime},</if>
  157. <if test="createBy != null">create_by = #{createBy},</if>
  158. <if test="updateBy != null">update_by = #{updateBy},</if>
  159. <if test="updateTime != null">update_time = #{updateTime},</if>
  160. <if test="remark != null">remark = #{remark},</if>
  161. <if test="configJson != null">config_json = #{configJson},</if>
  162. <if test="flvHlsUrl != null">flv_hls_url = #{flvHlsUrl},</if>
  163. <if test="isAudit != null">is_audit = #{isAudit},</if>
  164. <if test="idCardUrl != null">id_card_url = #{idCardUrl},</if>
  165. </trim>
  166. where live_id = #{liveId}
  167. </update>
  168. <delete id="deleteLiveByLiveId" parameterType="Long">
  169. delete from live where live_id = #{liveId}
  170. </delete>
  171. <delete id="deleteLiveByLiveIds" parameterType="String">
  172. delete from live where live_id in
  173. <foreach item="liveId" collection="array" open="(" separator="," close=")">
  174. #{liveId}
  175. </foreach>
  176. </delete>
  177. </mapper>