123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.fs.live.mapper.LiveMapper">
- <resultMap type="Live" id="LiveResult">
- <result property="liveId" column="live_id" />
- <result property="companyId" column="company_id" />
- <result property="companyUserId" column="company_user_id" />
- <result property="talentId" column="talent_id" />
- <result property="liveName" column="live_name" />
- <result property="liveDesc" column="live_desc" />
- <result property="showType" column="show_type" />
- <result property="status" column="status" />
- <result property="anchorId" column="anchor_id" />
- <result property="liveType" column="live_type" />
- <result property="startTime" column="start_time" />
- <result property="finishTime" column="finish_time" />
- <result property="liveImgUrl" column="live_img_url" />
- <result property="liveConfig" column="live_config" />
- <result property="isShow" column="is_show" />
- <result property="isDel" column="is_del" />
- <result property="qwQrCode" column="qw_qr_code" />
- <result property="rtmpUrl" column="rtmp_url" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- <result property="configJson" column="config_json" />
- <result property="isAudit" column="is_audit" />
- </resultMap>
- <sql id="selectLiveVo">
- 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
- </sql>
- <select id="selectLiveList" parameterType="Live" resultMap="LiveResult">
- <include refid="selectLiveVo"/>
- <where>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
- <if test="talentId != null "> and talent_id = #{talentId}</if>
- <if test="liveName != null and liveName != ''"> and live_name like concat('%', #{liveName}, '%')</if>
- <if test="liveDesc != null and liveDesc != ''"> and live_desc = #{liveDesc}</if>
- <if test="showType != null "> and show_type = #{showType}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="anchorId != null "> and anchor_id = #{anchorId}</if>
- <if test="liveType != null "> and live_type = #{liveType}</if>
- <if test="startTime != null "> and start_time = #{startTime}</if>
- <if test="finishTime != null "> and finish_time = #{finishTime}</if>
- <if test="liveImgUrl != null and liveImgUrl != ''"> and live_img_url = #{liveImgUrl}</if>
- <if test="liveConfig != null and liveConfig != ''"> and live_config = #{liveConfig}</if>
- <if test="isShow != null "> and is_show = #{isShow}</if>
- <if test="isDel != null "> and is_del = #{isDel}</if>
- <if test="qwQrCode != null and qwQrCode != ''"> and qw_qr_code = #{qwQrCode}</if>
- <if test="rtmpUrl != null and rtmpUrl != ''"> and rtmp_url = #{rtmpUrl}</if>
- <if test="flvHlsUrl != null and flvHlsUrl != ''"> and flv_hls_url = #{flvHlsUrl}</if>
- <if test="isAudit != null and isAudit != ''"> and is_audit = #{isAudit}</if>
- </where>
- </select>
- <select id="selectLiveByLiveId" parameterType="Long" resultMap="LiveResult">
- <include refid="selectLiveVo"/>
- where live_id = #{liveId}
- </select>
- <select id="selectLiveByLiveIdAndCompanyIdAndCompanyUserId" resultMap="LiveResult">
- <include refid="selectLiveVo"/>
- where live_id = #{liveId} and company_id = #{companyId} and company_user_id = #{companyUserId}
- </select>
- <select id="selectLiveToStudent" resultType="com.fs.live.domain.Live">
- <include refid="selectLiveVo"/>
- where 1=1
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- <if test="liveName != null and liveName != null">
- AND live_name like concat('%', #{liveName}, '%')
- </if>
- <if test="startTime != null and startTime != '' and finishTime != null and finishTime != ''">
- AND start_time BETWEEN #{startTime} AND #{finishTime}
- </if>
- </select>
- <insert id="insertLive" parameterType="Live" useGeneratedKeys="true" keyProperty="liveId">
- insert into live
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="companyId != null">company_id,</if>
- <if test="companyUserId != null">company_user_id,</if>
- <if test="talentId != null">talent_id,</if>
- <if test="liveName != null">live_name,</if>
- <if test="liveDesc != null">live_desc,</if>
- <if test="showType != null">show_type,</if>
- <if test="status != null">status,</if>
- <if test="anchorId != null">anchor_id,</if>
- <if test="liveType != null">live_type,</if>
- <if test="startTime != null">start_time,</if>
- <if test="finishTime != null">finish_time,</if>
- <if test="liveImgUrl != null">live_img_url,</if>
- <if test="liveConfig != null">live_config,</if>
- <if test="isShow != null">is_show,</if>
- <if test="isDel != null">is_del,</if>
- <if test="qwQrCode != null">qw_qr_code,</if>
- <if test="rtmpUrl != null">rtmp_url,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- <if test="configJson != null">config_json,</if>
- <if test="flvHlsUrl != null">flv_hls_url,</if>
- <if test="isAudit != null">is_audit,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="companyId != null">#{companyId},</if>
- <if test="companyUserId != null">#{companyUserId},</if>
- <if test="talentId != null">#{talentId},</if>
- <if test="liveName != null">#{liveName},</if>
- <if test="liveDesc != null">#{liveDesc},</if>
- <if test="showType != null">#{showType},</if>
- <if test="status != null">#{status},</if>
- <if test="anchorId != null">#{anchorId},</if>
- <if test="liveType != null">#{liveType},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="finishTime != null">#{finishTime},</if>
- <if test="liveImgUrl != null">#{liveImgUrl},</if>
- <if test="liveConfig != null">#{liveConfig},</if>
- <if test="isShow != null">#{isShow},</if>
- <if test="isDel != null">#{isDel},</if>
- <if test="qwQrCode != null">#{qwQrCode},</if>
- <if test="rtmpUrl != null">#{rtmpUrl},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- <if test="configJson != null">#{configJson},</if>
- <if test="flvHlsUrl != null">#{flvHlsUrl},</if>
- <if test="isAudit != null">#{isAudit},</if>
- </trim>
- </insert>
- <update id="updateLive" parameterType="Live">
- update live
- <trim prefix="SET" suffixOverrides=",">
- <if test="talentId != null">talent_id = #{talentId},</if>
- <if test="liveName != null">live_name = #{liveName},</if>
- <if test="liveDesc != null">live_desc = #{liveDesc},</if>
- <if test="showType != null">show_type = #{showType},</if>
- <if test="status != null">status = #{status},</if>
- <if test="anchorId != null">anchor_id = #{anchorId},</if>
- <if test="liveType != null">live_type = #{liveType},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="finishTime != null">finish_time = #{finishTime},</if>
- <if test="liveImgUrl != null">live_img_url = #{liveImgUrl},</if>
- <if test="liveConfig != null">live_config = #{liveConfig},</if>
- <if test="isShow != null">is_show = #{isShow},</if>
- <if test="isDel != null">is_del = #{isDel},</if>
- <if test="qwQrCode != null">qw_qr_code = #{qwQrCode},</if>
- <if test="rtmpUrl != null">rtmp_url = #{rtmpUrl},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="configJson != null">config_json = #{configJson},</if>
- <if test="flvHlsUrl != null">flv_hls_url = #{flvHlsUrl},</if>
- <if test="isAudit != null">is_audit = #{isAudit},</if>
- <if test="idCardUrl != null">id_card_url = #{idCardUrl},</if>
- </trim>
- where live_id = #{liveId}
- </update>
- <delete id="deleteLiveByLiveId" parameterType="Long">
- delete from live where live_id = #{liveId}
- </delete>
- <delete id="deleteLiveByLiveIds" parameterType="String">
- delete from live where live_id in
- <foreach item="liveId" collection="array" open="(" separator="," close=")">
- #{liveId}
- </foreach>
- </delete>
- </mapper>
|