<?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.ard.gb28181.mapper.GbChannelMapper">
|
|
<resultMap type="com.ard.gb28181.domain.GbChannel" id="GbChannelResult">
|
<id property="id" column="id"/>
|
<result property="gbDeviceId" column="gb_device_id"/>
|
<result property="gbChannelId" column="gb_channel_id"/>
|
<result property="channelName" column="channel_name"/>
|
<result property="deviceCode" column="device_code"/>
|
<result property="streamMode" column="stream_mode"/>
|
<result property="enableMp4" column="enable_mp4"/>
|
<result property="streamStatus" column="stream_status"/>
|
<result property="mediaServerId" column="media_server_id"/>
|
<result property="streamKey" column="stream_key"/>
|
<result property="snap" column="snap"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="remark" column="remark"/>
|
</resultMap>
|
|
<sql id="selectGbChannelVo">
|
select id, gb_device_id, gb_channel_id, channel_name, device_code, stream_mode, enable_mp4,
|
stream_status, media_server_id, stream_key, snap,
|
create_by, create_time, update_by, update_time, remark
|
from ard_gb_channel
|
</sql>
|
|
<select id="selectGbChannelById" parameterType="Long" resultMap="GbChannelResult">
|
<include refid="selectGbChannelVo"/> where id = #{id}
|
</select>
|
|
<select id="selectGbChannelByGbDeviceId" parameterType="String" resultMap="GbChannelResult">
|
<include refid="selectGbChannelVo"/> where gb_device_id = #{gbDeviceId}
|
order by id
|
</select>
|
|
<select id="selectByGbDeviceIdAndGbChannelId" resultMap="GbChannelResult">
|
<include refid="selectGbChannelVo"/>
|
where gb_device_id = #{gbDeviceId} and gb_channel_id = #{gbChannelId}
|
</select>
|
|
<select id="selectGbChannelList" parameterType="com.ard.gb28181.domain.GbChannel" resultMap="GbChannelResult">
|
<include refid="selectGbChannelVo"/>
|
<where>
|
<if test="gbDeviceId != null and gbDeviceId != ''">
|
and gb_device_id like concat('%', #{gbDeviceId}, '%')
|
</if>
|
<if test="gbChannelId != null and gbChannelId != ''">
|
and gb_channel_id like concat('%', #{gbChannelId}, '%')
|
</if>
|
<if test="channelName != null and channelName != ''">
|
and channel_name like concat('%', #{channelName}, '%')
|
</if>
|
</where>
|
</select>
|
|
<insert id="insertGbChannel" parameterType="com.ard.gb28181.domain.GbChannel" useGeneratedKeys="true" keyProperty="id">
|
insert into ard_gb_channel
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="gbDeviceId != null">gb_device_id,</if>
|
<if test="gbChannelId != null">gb_channel_id,</if>
|
<if test="channelName != null">channel_name,</if>
|
<if test="deviceCode != null">device_code,</if>
|
<if test="streamMode != null">stream_mode,</if>
|
<if test="enableMp4 != null">enable_mp4,</if>
|
<if test="streamStatus != null">stream_status,</if>
|
<if test="mediaServerId != null">media_server_id,</if>
|
<if test="streamKey != null">stream_key,</if>
|
<if test="snap != null">snap,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="remark != null">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="gbDeviceId != null">#{gbDeviceId},</if>
|
<if test="gbChannelId != null">#{gbChannelId},</if>
|
<if test="channelName != null">#{channelName},</if>
|
<if test="deviceCode != null">#{deviceCode},</if>
|
<if test="streamMode != null">#{streamMode},</if>
|
<if test="enableMp4 != null">#{enableMp4},</if>
|
<if test="streamStatus != null">#{streamStatus},</if>
|
<if test="mediaServerId != null">#{mediaServerId},</if>
|
<if test="streamKey != null">#{streamKey},</if>
|
<if test="snap != null">#{snap},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remark != null">#{remark},</if>
|
</trim>
|
</insert>
|
|
<update id="updateGbChannel" parameterType="com.ard.gb28181.domain.GbChannel">
|
update ard_gb_channel
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="channelName != null">channel_name = #{channelName},</if>
|
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
<if test="streamMode != null">stream_mode = #{streamMode},</if>
|
<if test="enableMp4 != null">enable_mp4 = #{enableMp4},</if>
|
<if test="streamStatus != null">stream_status = #{streamStatus},</if>
|
<if test="mediaServerId != null">media_server_id = #{mediaServerId},</if>
|
<if test="streamKey != null">stream_key = #{streamKey},</if>
|
<if test="snap != null">snap = #{snap},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="updateGbChannelStream">
|
update ard_gb_channel
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="streamStatus != null">stream_status = #{streamStatus},</if>
|
<if test="streamKey != null">stream_key = #{streamKey},</if>
|
<if test="mediaServerId != null">media_server_id = #{mediaServerId},</if>
|
<if test="snap != null">snap = #{snap},</if>
|
update_by = #{updateBy},
|
update_time = #{updateTime}
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteGbChannelById" parameterType="Long">
|
delete from ard_gb_channel where id = #{id}
|
</delete>
|
|
<delete id="deleteGbChannelByIds" parameterType="String">
|
delete from ard_gb_channel where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
|
</delete>
|
|
</mapper>
|