第一次提交
This commit is contained in:
@ -0,0 +1,182 @@
|
||||
<?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.fastbee.sip.mapper.MediaServerMapper">
|
||||
|
||||
<resultMap type="MediaServer" id="MediaServerResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="serverId" column="server_id" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="enabled" column="enabled" />
|
||||
<result property="protocol" column="protocol" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="domain" column="domain" />
|
||||
<result property="hookurl" column="hookurl" />
|
||||
<result property="secret" column="secret" />
|
||||
<result property="portHttp" column="port_http" />
|
||||
<result property="portHttps" column="port_https" />
|
||||
<result property="portRtmp" column="port_rtmp" />
|
||||
<result property="portRtsp" column="port_rtsp" />
|
||||
<result property="rtpProxyPort" column="rtp_proxy_port" />
|
||||
<result property="rtpEnable" column="rtp_enable" />
|
||||
<result property="rtpPortRange" column="rtp_port_range" />
|
||||
<result property="recordPort" column="record_port" />
|
||||
<result property="autoConfig" column="auto_config" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<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="selectMediaServerVo">
|
||||
select id, server_id, tenant_id, tenant_name, enabled, protocol, ip, domain, hookurl, secret, port_http, port_https, port_rtmp, port_rtsp, rtp_proxy_port, rtp_enable, rtp_port_range, record_port, auto_config, status, del_flag, create_by, create_time, update_by, update_time, remark from media_server
|
||||
</sql>
|
||||
|
||||
<select id="selectMediaServerList" parameterType="MediaServer" resultMap="MediaServerResult">
|
||||
<include refid="selectMediaServerVo"/>
|
||||
<where>
|
||||
<if test="serverId != null and serverId != ''"> and server_id = #{serverId}</if>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
|
||||
<if test="enabled != null "> and enabled = #{enabled}</if>
|
||||
<if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
|
||||
<if test="ip != null and ip != ''"> and ip = #{ip}</if>
|
||||
<if test="domain != null and domain != ''"> and domain = #{domain}</if>
|
||||
<if test="hookurl != null and hookurl != ''"> and hookurl = #{hookurl}</if>
|
||||
<if test="secret != null and secret != ''"> and secret = #{secret}</if>
|
||||
<if test="portHttp != null "> and port_http = #{portHttp}</if>
|
||||
<if test="portHttps != null "> and port_https = #{portHttps}</if>
|
||||
<if test="portRtmp != null "> and port_rtmp = #{portRtmp}</if>
|
||||
<if test="portRtsp != null "> and port_rtsp = #{portRtsp}</if>
|
||||
<if test="rtpProxyPort != null "> and rtp_proxy_port = #{rtpProxyPort}</if>
|
||||
<if test="rtpEnable != null "> and rtp_enable = #{rtpEnable}</if>
|
||||
<if test="rtpPortRange != null and rtpPortRange != ''"> and rtp_port_range = #{rtpPortRange}</if>
|
||||
<if test="recordPort != null "> and record_port = #{recordPort}</if>
|
||||
<if test="autoConfig != null "> and auto_config = #{autoConfig}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMediaServerById" parameterType="Long" resultMap="MediaServerResult">
|
||||
<include refid="selectMediaServerVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMediaServer" parameterType="MediaServer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into media_server
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="serverId != null and serverId != ''">server_id,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
|
||||
<if test="enabled != null">enabled,</if>
|
||||
<if test="protocol != null and protocol != ''">protocol,</if>
|
||||
<if test="ip != null and ip != ''">ip,</if>
|
||||
<if test="domain != null and domain != ''">domain,</if>
|
||||
<if test="hookurl != null and hookurl != ''">hookurl,</if>
|
||||
<if test="secret != null and secret != ''">secret,</if>
|
||||
<if test="portHttp != null">port_http,</if>
|
||||
<if test="portHttps != null">port_https,</if>
|
||||
<if test="portRtmp != null">port_rtmp,</if>
|
||||
<if test="portRtsp != null">port_rtsp,</if>
|
||||
<if test="rtpProxyPort != null">rtp_proxy_port,</if>
|
||||
<if test="rtpEnable != null">rtp_enable,</if>
|
||||
<if test="rtpPortRange != null and rtpPortRange != ''">rtp_port_range,</if>
|
||||
<if test="recordPort != null">record_port,</if>
|
||||
<if test="autoConfig != null">auto_config,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">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="serverId != null and serverId != ''">#{serverId},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
|
||||
<if test="enabled != null">#{enabled},</if>
|
||||
<if test="protocol != null and protocol != ''">#{protocol},</if>
|
||||
<if test="ip != null and ip != ''">#{ip},</if>
|
||||
<if test="domain != null and domain != ''">#{domain},</if>
|
||||
<if test="hookurl != null and hookurl != ''">#{hookurl},</if>
|
||||
<if test="secret != null and secret != ''">#{secret},</if>
|
||||
<if test="portHttp != null">#{portHttp},</if>
|
||||
<if test="portHttps != null">#{portHttps},</if>
|
||||
<if test="portRtmp != null">#{portRtmp},</if>
|
||||
<if test="portRtsp != null">#{portRtsp},</if>
|
||||
<if test="rtpProxyPort != null">#{rtpProxyPort},</if>
|
||||
<if test="rtpEnable != null">#{rtpEnable},</if>
|
||||
<if test="rtpPortRange != null and rtpPortRange != ''">#{rtpPortRange},</if>
|
||||
<if test="recordPort != null">#{recordPort},</if>
|
||||
<if test="autoConfig != null">#{autoConfig},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{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="updateMediaServer" parameterType="MediaServer">
|
||||
update media_server
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="serverId != null and serverId != ''">server_id = #{serverId},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
|
||||
<if test="enabled != null">enabled = #{enabled},</if>
|
||||
<if test="protocol != null and protocol != ''">protocol = #{protocol},</if>
|
||||
<if test="ip != null and ip != ''">ip = #{ip},</if>
|
||||
<if test="domain != null and domain != ''">domain = #{domain},</if>
|
||||
<if test="hookurl != null and hookurl != ''">hookurl = #{hookurl},</if>
|
||||
<if test="secret != null and secret != ''">secret = #{secret},</if>
|
||||
<if test="portHttp != null">port_http = #{portHttp},</if>
|
||||
<if test="portHttps != null">port_https = #{portHttps},</if>
|
||||
<if test="portRtmp != null">port_rtmp = #{portRtmp},</if>
|
||||
<if test="portRtsp != null">port_rtsp = #{portRtsp},</if>
|
||||
<if test="rtpProxyPort != null">rtp_proxy_port = #{rtpProxyPort},</if>
|
||||
<if test="rtpEnable != null">rtp_enable = #{rtpEnable},</if>
|
||||
<if test="rtpPortRange != null and rtpPortRange != ''">rtp_port_range = #{rtpPortRange},</if>
|
||||
<if test="recordPort != null">record_port = #{recordPort},</if>
|
||||
<if test="autoConfig != null">auto_config = #{autoConfig},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</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>
|
||||
|
||||
<delete id="deleteMediaServerById" parameterType="Long">
|
||||
delete from media_server where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMediaServerByIds" parameterType="String">
|
||||
delete from media_server where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectMediaServer" resultMap="MediaServerResult" parameterType="MediaServer">
|
||||
<include refid="selectMediaServerVo"/>
|
||||
<where>
|
||||
<if test="tenantId != null and tenantId != 0"> and tenant_id = #{tenantId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMediaServerBytenantId" parameterType="Long" resultMap="MediaServerResult">
|
||||
<include refid="selectMediaServerVo"/>
|
||||
where tenant_id = #{tenantId}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,164 @@
|
||||
<?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.fastbee.sip.mapper.SipConfigMapper">
|
||||
|
||||
<resultMap type="SipConfig" id="SipConfigResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="enabled" column="enabled"/>
|
||||
<result property="isdefault" column="isdefault"/>
|
||||
<result property="seniorsdp" column="seniorSdp"/>
|
||||
<result property="domain" column="domain"/>
|
||||
<result property="serverSipid" column="server_sipid"/>
|
||||
<result property="password" column="password"/>
|
||||
<result property="ip" column="ip"/>
|
||||
<result property="port" column="port"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<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="selectSipConfigVo">
|
||||
select id,
|
||||
product_id,
|
||||
product_name,
|
||||
enabled,
|
||||
isdefault,
|
||||
seniorSdp,
|
||||
domain,
|
||||
server_sipid,
|
||||
password,
|
||||
ip,
|
||||
port,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from sip_config
|
||||
</sql>
|
||||
|
||||
<select id="selectSipConfigList" parameterType="SipConfig" resultMap="SipConfigResult">
|
||||
<include refid="selectSipConfigVo"/>
|
||||
<where>
|
||||
<if test="productId != null ">and product_id = #{productId}</if>
|
||||
<if test="productName != null and productName != ''">and product_name like concat('%', #{productName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="enabled != null ">and enabled = #{enabled}</if>
|
||||
<if test="isdefault != null ">and isdefault = #{isdefault}</if>
|
||||
<if test="seniorsdp != null ">and seniorSdp = #{seniorsdp}</if>
|
||||
<if test="domain != null and domain != ''">and domain = #{domain}</if>
|
||||
<if test="serverSipid != null and serverSipid != ''">and server_sipid = #{serverSipid}</if>
|
||||
<if test="password != null and password != ''">and password = #{password}</if>
|
||||
<if test="ip != null and ip != ''">and ip = #{ip}</if>
|
||||
<if test="port != null ">and port = #{port}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSipConfigByProductId" parameterType="Long" resultMap="SipConfigResult">
|
||||
<include refid="selectSipConfigVo"/>
|
||||
where product_id = #{productId}
|
||||
</select>
|
||||
|
||||
<select id="selectSipConfigByproductId" parameterType="Long" resultMap="SipConfigResult">
|
||||
<include refid="selectSipConfigVo"/>
|
||||
where product_id = #{productId}
|
||||
</select>
|
||||
<insert id="insertSipConfig" parameterType="SipConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sip_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="enabled != null">enabled,</if>
|
||||
<if test="isdefault != null">isdefault,</if>
|
||||
<if test="seniorsdp != null">seniorSdp,</if>
|
||||
<if test="domain != null and domain != ''">domain,</if>
|
||||
<if test="serverSipid != null and serverSipid != ''">server_sipid,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="ip != null">ip,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">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="productId != null">#{productId},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="enabled != null">#{enabled},</if>
|
||||
<if test="isdefault != null">#{isdefault},</if>
|
||||
<if test="seniorsdp != null">#{seniorsdp},</if>
|
||||
<if test="domain != null and domain != ''">#{domain},</if>
|
||||
<if test="serverSipid != null and serverSipid != ''">#{serverSipid},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="ip != null">#{ip},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{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="updateSipConfig" parameterType="SipConfig">
|
||||
update sip_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
<if test="enabled != null">enabled = #{enabled},</if>
|
||||
<if test="isdefault != null">isdefault = #{isdefault},</if>
|
||||
<if test="seniorsdp != null">seniorSdp = #{seniorsdp},</if>
|
||||
<if test="domain != null and domain != ''">domain = #{domain},</if>
|
||||
<if test="serverSipid != null and serverSipid != ''">server_sipid = #{serverSipid},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="ip != null">ip = #{ip},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</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="resetDefaultSipConfig">
|
||||
update sip_config
|
||||
set isdefault = 0
|
||||
where isdefault = 1
|
||||
</update>
|
||||
|
||||
<delete id="deleteSipConfigById" parameterType="Long">
|
||||
delete
|
||||
from sip_config
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSipConfigByIds" parameterType="String">
|
||||
delete from sip_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSipConfigByProductId" parameterType="String">
|
||||
delete from sip_config where product_id in
|
||||
<foreach item="productId" collection="array" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,398 @@
|
||||
<?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.fastbee.sip.mapper.SipDeviceChannelMapper">
|
||||
|
||||
<resultMap type="com.fastbee.sip.domain.SipDeviceChannel" id="SipDeviceChannelResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="tenantName" column="tenant_name"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="deviceSipId" column="device_sip_id"/>
|
||||
<result property="channelSipId" column="channel_sip_id"/>
|
||||
<result property="channelName" column="channel_name"/>
|
||||
<result property="registerTime" column="register_time"/>
|
||||
<result property="deviceType" column="device_type"/>
|
||||
<result property="channelType" column="channel_type"/>
|
||||
<result property="citycode" column="cityCode"/>
|
||||
<result property="civilcode" column="civilCode"/>
|
||||
<result property="manufacture" column="manufacture"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="owner" column="owner"/>
|
||||
<result property="block" column="block"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="parentid" column="parentId"/>
|
||||
<result property="ipaddress" column="ipAddress"/>
|
||||
<result property="port" column="port"/>
|
||||
<result property="password" column="password"/>
|
||||
<result property="ptztype" column="PTZType"/>
|
||||
<result property="ptztypetext" column="PTZTypeText"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="longitude" column="longitude"/>
|
||||
<result property="latitude" column="latitude"/>
|
||||
<result property="streamid" column="streamId"/>
|
||||
<result property="subcount" column="subCount"/>
|
||||
<result property="parental" column="parental"/>
|
||||
<result property="hasaudio" column="hasAudio"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<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"/>
|
||||
<result property="reDeviceId" column="re_device_id"/>
|
||||
<result property="reSceneModelId" column="re_scene_model_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSipDeviceChannelVo">
|
||||
select id,
|
||||
tenant_id,
|
||||
tenant_name,
|
||||
product_id,
|
||||
product_name,
|
||||
user_id,
|
||||
user_name,
|
||||
device_sip_id,
|
||||
channel_sip_id,
|
||||
channel_name,
|
||||
register_time,
|
||||
device_type,
|
||||
channel_type,
|
||||
cityCode,
|
||||
civilCode,
|
||||
manufacture,
|
||||
model,
|
||||
owner,
|
||||
block,
|
||||
address,
|
||||
parentId,
|
||||
ipAddress,
|
||||
port,
|
||||
password,
|
||||
PTZType,
|
||||
PTZTypeText,
|
||||
status,
|
||||
longitude,
|
||||
latitude,
|
||||
streamId,
|
||||
subCount,
|
||||
parental,
|
||||
hasAudio,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from sip_device_channel
|
||||
</sql>
|
||||
|
||||
<select id="selectSipDeviceChannelList" parameterType="SipDeviceChannel" resultMap="SipDeviceChannelResult">
|
||||
select s.id,
|
||||
s.tenant_id,
|
||||
s.tenant_name,
|
||||
s.product_id,
|
||||
s.product_name,
|
||||
s.user_id,
|
||||
s.user_name,
|
||||
s.device_sip_id,
|
||||
s.channel_sip_id,
|
||||
s.channel_name,
|
||||
s.register_time,
|
||||
s.device_type,
|
||||
s.channel_type,
|
||||
s.cityCode,
|
||||
s.civilCode,
|
||||
s.manufacture,
|
||||
s.model,
|
||||
s.owner,
|
||||
s.block,
|
||||
s.address,
|
||||
s.parentId,
|
||||
s.ipAddress,
|
||||
s.port,
|
||||
s.password,
|
||||
s.PTZType,
|
||||
s.PTZTypeText,
|
||||
s.status,
|
||||
s.longitude,
|
||||
s.latitude,
|
||||
s.streamId,
|
||||
s.subCount,
|
||||
s.parental,
|
||||
s.hasAudio,
|
||||
s.del_flag,
|
||||
s.create_by,
|
||||
s.create_time,
|
||||
s.update_by,
|
||||
s.update_time,
|
||||
s.remark,
|
||||
d.re_device_id,
|
||||
d.re_scene_model_id
|
||||
from sip_device_channel s
|
||||
left join iot_sip_relation d on s.channel_sip_id = d.channel_id
|
||||
<where>
|
||||
<if test="tenantId != null ">and s.tenant_id = #{tenantId}</if>
|
||||
<if test="tenantName != null and tenantName != ''">and s.tenant_name like concat('%', #{tenantName}, '%')</if>
|
||||
<if test="productId != null ">and s.product_id = #{productId}</if>
|
||||
<if test="productName != null and productName != ''">and s.product_name like concat('%', #{productName},'%')</if>
|
||||
<if test="userId != null ">and s.user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''">and s.user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="deviceSipId != null and deviceSipId != ''">and s.device_sip_id = #{deviceSipId}</if>
|
||||
<if test="channelSipId != null and channelSipId != ''">and s.channel_sip_id = #{channelSipId}</if>
|
||||
<if test="channelName != null and channelName != ''">and s.channel_name like concat('%', #{channelName},'%')</if>
|
||||
<if test="registerTime != null ">and s.register_time = #{registerTime}</if>
|
||||
<if test="deviceType != null and deviceType != ''">and s.device_type = #{deviceType}</if>
|
||||
<if test="channelType != null and channelType != ''">and s.channel_type = #{channelType}</if>
|
||||
<if test="citycode != null and citycode != ''">and s.cityCode = #{citycode}</if>
|
||||
<if test="civilcode != null and civilcode != ''">and s.civilCode = #{civilcode}</if>
|
||||
<if test="manufacture != null and manufacture != ''">and s.manufacture = #{manufacture}</if>
|
||||
<if test="model != null and model != ''">and s.model = #{model}</if>
|
||||
<if test="owner != null and owner != ''">and s.owner = #{owner}</if>
|
||||
<if test="block != null and block != ''">and s.block = #{block}</if>
|
||||
<if test="address != null and address != ''">and s.address = #{address}</if>
|
||||
<if test="parentid != null and parentid != ''">and s.parentId = #{parentid}</if>
|
||||
<if test="ipaddress != null and ipaddress != ''">and s.ipAddress = #{ipaddress}</if>
|
||||
<if test="port != null ">and s.port = #{port}</if>
|
||||
<if test="password != null and password != ''">and s.password = #{password}</if>
|
||||
<if test="ptztype != null ">and s.PTZType = #{ptztype}</if>
|
||||
<if test="ptztypetext != null and ptztypetext != ''">and s.PTZTypeText = #{ptztypetext}</if>
|
||||
<if test="status != null ">and s.status = #{status}</if>
|
||||
<if test="longitude != null ">and s.longitude = #{longitude}</if>
|
||||
<if test="latitude != null ">and s.latitude = #{latitude}</if>
|
||||
<if test="streamid != null and streamid != ''">and s.streamId = #{streamid}</if>
|
||||
<if test="subcount != null ">and s.subCount = #{subcount}</if>
|
||||
<if test="parental != null ">and s.parental = #{parental}</if>
|
||||
<if test="hasaudio != null ">and s.hasAudio = #{hasaudio}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSipDeviceChannelById" parameterType="Long" resultMap="SipDeviceChannelResult">
|
||||
<include refid="selectSipDeviceChannelVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSipDeviceChannel" parameterType="SipDeviceChannel" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sip_device_channel
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="deviceSipId != null">device_sip_id,</if>
|
||||
<if test="channelSipId != null and channelSipId != ''">channel_sip_id,</if>
|
||||
<if test="channelName != null and channelName != ''">channel_name,</if>
|
||||
<if test="registerTime != null">register_time,</if>
|
||||
<if test="deviceType != null">device_type,</if>
|
||||
<if test="channelType != null">channel_type,</if>
|
||||
<if test="citycode != null and citycode != ''">cityCode,</if>
|
||||
<if test="civilcode != null and civilcode != ''">civilCode,</if>
|
||||
<if test="manufacture != null and manufacture != ''">manufacture,</if>
|
||||
<if test="model != null and model != ''">model,</if>
|
||||
<if test="owner != null and owner != ''">owner,</if>
|
||||
<if test="block != null and block != ''">block,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="parentid != null and parentid != ''">parentId,</if>
|
||||
<if test="ipaddress != null">ipAddress,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="ptztype != null">PTZType,</if>
|
||||
<if test="ptztypetext != null and ptztypetext != ''">PTZTypeText,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="longitude != null">longitude,</if>
|
||||
<if test="latitude != null">latitude,</if>
|
||||
<if test="streamid != null and streamid != ''">streamId,</if>
|
||||
<if test="subcount != null">subCount,</if>
|
||||
<if test="parental != null">parental,</if>
|
||||
<if test="hasaudio != null">hasAudio,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">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="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="deviceSipId != null">#{deviceSipId},</if>
|
||||
<if test="channelSipId != null and channelSipId != ''">#{channelSipId},</if>
|
||||
<if test="channelName != null and channelName != ''">#{channelName},</if>
|
||||
<if test="registerTime != null">#{registerTime},</if>
|
||||
<if test="deviceType != null">#{deviceType},</if>
|
||||
<if test="channelType != null">#{channelType},</if>
|
||||
<if test="citycode != null and citycode != ''">#{citycode},</if>
|
||||
<if test="civilcode != null and civilcode != ''">#{civilcode},</if>
|
||||
<if test="manufacture != null and manufacture != ''">#{manufacture},</if>
|
||||
<if test="model != null and model != ''">#{model},</if>
|
||||
<if test="owner != null and owner != ''">#{owner},</if>
|
||||
<if test="block != null and block != ''">#{block},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="parentid != null and parentid != ''">#{parentid},</if>
|
||||
<if test="ipaddress != null">#{ipaddress},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="ptztype != null">#{ptztype},</if>
|
||||
<if test="ptztypetext != null and ptztypetext != ''">#{ptztypetext},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="longitude != null">#{longitude},</if>
|
||||
<if test="latitude != null">#{latitude},</if>
|
||||
<if test="streamid != null and streamid != ''">#{streamid},</if>
|
||||
<if test="subcount != null">#{subcount},</if>
|
||||
<if test="parental != null">#{parental},</if>
|
||||
<if test="hasaudio != null">#{hasaudio},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{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="updateSipDeviceChannel" parameterType="SipDeviceChannel">
|
||||
update sip_device_channel
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="deviceSipId != null">device_sip_id = #{deviceSipId},</if>
|
||||
<if test="channelSipId != null and channelSipId != ''">channel_sip_id = #{channelSipId},</if>
|
||||
<if test="channelName != null and channelName != ''">channel_name = #{channelName},</if>
|
||||
<if test="registerTime != null">register_time = #{registerTime},</if>
|
||||
<if test="deviceType != null">device_type = #{deviceType},</if>
|
||||
<if test="channelType != null">channel_type = #{channelType},</if>
|
||||
<if test="citycode != null and citycode != ''">cityCode = #{citycode},</if>
|
||||
<if test="civilcode != null and civilcode != ''">civilCode = #{civilcode},</if>
|
||||
<if test="manufacture != null and manufacture != ''">manufacture = #{manufacture},</if>
|
||||
<if test="model != null and model != ''">model = #{model},</if>
|
||||
<if test="owner != null and owner != ''">owner = #{owner},</if>
|
||||
<if test="block != null and block != ''">block = #{block},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="parentid != null and parentid != ''">parentId = #{parentid},</if>
|
||||
<if test="ipaddress != null">ipAddress = #{ipaddress},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="ptztype != null">PTZType = #{ptztype},</if>
|
||||
<if test="ptztypetext != null and ptztypetext != ''">PTZTypeText = #{ptztypetext},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="streamid != null and streamid != ''">streamId = #{streamid},</if>
|
||||
<if test="subcount != null">subCount = #{subcount},</if>
|
||||
<if test="parental != null">parental = #{parental},</if>
|
||||
<if test="hasaudio != null">hasAudio = #{hasaudio},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</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 channel_sip_id = #{channelSipId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSipDeviceChannelById" parameterType="Long">
|
||||
delete
|
||||
from sip_device_channel
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSipDeviceChannelByIds" parameterType="String">
|
||||
delete from sip_device_channel where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectSipDeviceChannelByDeviceSipId" parameterType="String" resultMap="SipDeviceChannelResult">
|
||||
<include refid="selectSipDeviceChannelVo"/>
|
||||
where device_sip_id = #{deviceSipId}
|
||||
</select>
|
||||
|
||||
<select id="selectSipDeviceChannelByChannelSipId" parameterType="String" resultMap="SipDeviceChannelResult">
|
||||
<include refid="selectSipDeviceChannelVo"/>
|
||||
where channel_sip_id = #{channelSipId}
|
||||
</select>
|
||||
|
||||
<select id="selectChannelWithCivilCodeAndLength" resultMap="SipDeviceChannelResult">
|
||||
<include refid="selectSipDeviceChannelVo"/>
|
||||
where device_sip_id = #{deviceSipId}
|
||||
<if test='parentId != null and length != null' > and parentId = #{parentid} or left(channel_sip_id, LENGTH(#{parentId})) = #{parentId} and length(channel_sip_id)=#{length} </if>
|
||||
<if test='parentId == null and length != null' > and parentId = #{parentid} or length(channel_sip_id)=#{length} </if>
|
||||
<if test='parentId == null and length == null' > and parentId = #{parentid} </if>
|
||||
<if test='parentId != null and length == null' > and parentId = #{parentid} or left(channel_sip_id, LENGTH(#{parentId})) = #{parentId} </if>
|
||||
</select>
|
||||
|
||||
<select id="selectChannelByCivilCode" resultMap="SipDeviceChannelResult">
|
||||
<include refid="selectSipDeviceChannelVo"/>
|
||||
where device_sip_id = #{deviceSipId} and length(channel_sip_id)>14 and civilCode=#{parentId}
|
||||
</select>
|
||||
|
||||
<select id="selectChannelWithoutCiviCode" resultMap="SipDeviceChannelResult">
|
||||
<include refid="selectSipDeviceChannelVo"/>
|
||||
where device_sip_id=#{deviceSipId} and civilCode not in (select civilCode from sip_device_channel where device_sip_id=#{deviceSipId} group by civilCode)
|
||||
</select>
|
||||
|
||||
<select id="getChannelMinLength" resultType="Integer">
|
||||
select min(length(channel_sip_id)) as minLength
|
||||
from sip_device_channel
|
||||
where device_sip_id = #{deviceSipId}
|
||||
</select>
|
||||
|
||||
<update id="updateChannelStreamId" parameterType="SipDeviceChannel">
|
||||
update sip_device_channel
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="streamid != null and streamid != ''">streamId = #{streamid},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSipDeviceChannelByDeviceId" parameterType="String">
|
||||
delete
|
||||
from sip_device_channel
|
||||
where device_sip_id = #{deviceSipId}
|
||||
</delete>
|
||||
|
||||
<select id="getBindingChannel" resultType="com.fastbee.sip.domain.BindingChannel">
|
||||
select s.channel_sip_id as channelId,
|
||||
d.device_id as deviceId,
|
||||
d.device_name as deviceName,
|
||||
m.scene_model_id as sceneModelId,
|
||||
m.scene_model_name as sceneModelName
|
||||
from sip_device_channel s
|
||||
left join iot_device d on s.channel_sip_id = d.channel_id
|
||||
left join scene_model m on m.channel_id = s.channel_sip_id
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectDeviceRelSipDeviceChannelList" resultType="com.fastbee.sip.domain.SipDeviceChannel">
|
||||
select sc.id, sr.re_device_id, sc.channel_name, sc.device_sip_id, sc.channel_sip_id, sc.status
|
||||
from iot_device d left join iot_sip_relation sr on d.device_id = sr.re_device_id
|
||||
left join sip_device_channel sc on sr.channel_id = sc.channel_sip_id
|
||||
where d.del_flag = 0
|
||||
and sc.del_flag = 0
|
||||
and d.serial_number = #{serialNumber}
|
||||
</select>
|
||||
|
||||
<select id="selectSceneRelSipDeviceChannelList" resultType="com.fastbee.sip.domain.SipDeviceChannel">
|
||||
select sc.id, sr.re_device_id, sc.channel_name, sc.device_sip_id, sc.channel_sip_id, sc.status
|
||||
from iot_sip_relation sr
|
||||
left join sip_device_channel sc on sr.channel_id = sc.channel_sip_id
|
||||
where sc.del_flag = 0
|
||||
and sr.re_scene_model_id = #{sceneModelId}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,212 @@
|
||||
<?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.fastbee.sip.mapper.SipDeviceMapper">
|
||||
|
||||
<resultMap type="SipDevice" id="SipDeviceResult">
|
||||
<result property="deviceId" column="device_id"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="deviceSipId" column="device_sip_id"/>
|
||||
<result property="deviceName" column="device_name"/>
|
||||
<result property="manufacturer" column="manufacturer"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="firmware" column="firmware"/>
|
||||
<result property="transport" column="transport"/>
|
||||
<result property="streammode" column="streamMode"/>
|
||||
<result property="online" column="online"/>
|
||||
<result property="registertime" column="registerTime"/>
|
||||
<result property="lastconnecttime" column="lastConnectTime"/>
|
||||
<result property="activeTime" column="active_time"/>
|
||||
<result property="ip" column="ip"/>
|
||||
<result property="port" column="port"/>
|
||||
<result property="hostaddress" column="hostAddress"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<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="selectSipDeviceVo">
|
||||
select device_id,
|
||||
product_id,
|
||||
product_name,
|
||||
device_sip_id,
|
||||
device_name,
|
||||
manufacturer,
|
||||
model,
|
||||
firmware,
|
||||
transport,
|
||||
streamMode,
|
||||
online,
|
||||
registerTime,
|
||||
lastConnectTime,
|
||||
active_time,
|
||||
ip,
|
||||
port,
|
||||
hostAddress,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
remark
|
||||
from sip_device
|
||||
</sql>
|
||||
|
||||
<select id="selectSipDeviceList" parameterType="SipDevice" resultMap="SipDeviceResult">
|
||||
<include refid="selectSipDeviceVo"/>
|
||||
<where>
|
||||
<if test="productId != null ">and product_id = #{productId}</if>
|
||||
<if test="productName != null and productName != ''">and product_name like concat('%', #{productName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="deviceSipId != null and deviceSipId != ''">and device_sip_id = #{deviceSipId}</if>
|
||||
<if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
|
||||
</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">and manufacturer = #{manufacturer}</if>
|
||||
<if test="model != null and model != ''">and model = #{model}</if>
|
||||
<if test="firmware != null and firmware != ''">and firmware = #{firmware}</if>
|
||||
<if test="transport != null and transport != ''">and transport = #{transport}</if>
|
||||
<if test="streammode != null and streammode != ''">and streamMode = #{streammode}</if>
|
||||
<if test="online != null and online != ''">and online = #{online}</if>
|
||||
<if test="registertime != null ">and registerTime = #{registertime}</if>
|
||||
<if test="lastconnecttime != null ">and lastConnectTime = #{lastconnecttime}</if>
|
||||
<if test="activeTime != null ">and active_time = #{activeTime}</if>
|
||||
<if test="ip != null and ip != ''">and ip = #{ip}</if>
|
||||
<if test="port != null ">and port = #{port}</if>
|
||||
<if test="hostaddress != null and hostaddress != ''">and hostAddress = #{hostaddress}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSipDeviceByDeviceId" parameterType="Long" resultMap="SipDeviceResult">
|
||||
<include refid="selectSipDeviceVo"/>
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSipDevice" parameterType="SipDevice" useGeneratedKeys="true" keyProperty="deviceId">
|
||||
insert into sip_device
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="deviceSipId != null and deviceSipId != ''">device_sip_id,</if>
|
||||
<if test="deviceName != null and deviceName != ''">device_name,</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
|
||||
<if test="model != null and model != ''">model,</if>
|
||||
<if test="firmware != null and firmware != ''">firmware,</if>
|
||||
<if test="transport != null and transport != ''">transport,</if>
|
||||
<if test="streammode != null and streammode != ''">streamMode,</if>
|
||||
<if test="online != null and online != ''">online,</if>
|
||||
<if test="registertime != null">registerTime,</if>
|
||||
<if test="lastconnecttime != null">lastConnectTime,</if>
|
||||
<if test="activeTime != null">active_time,</if>
|
||||
<if test="ip != null">ip,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="hostaddress != null">hostAddress,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
<if test="createBy != null and createBy != ''">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="productId != null">#{productId},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="deviceSipId != null and deviceSipId != ''">#{deviceSipId},</if>
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
|
||||
<if test="model != null and model != ''">#{model},</if>
|
||||
<if test="firmware != null and firmware != ''">#{firmware},</if>
|
||||
<if test="transport != null and transport != ''">#{transport},</if>
|
||||
<if test="streammode != null and streammode != ''">#{streammode},</if>
|
||||
<if test="online != null and online != ''">#{online},</if>
|
||||
<if test="registertime != null">#{registertime},</if>
|
||||
<if test="lastconnecttime != null">#{lastconnecttime},</if>
|
||||
<if test="activeTime != null">#{activeTime},</if>
|
||||
<if test="ip != null">#{ip},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="hostaddress != null">#{hostaddress},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">#{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="updateSipDevice" parameterType="SipDevice">
|
||||
update sip_device
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
<if test="deviceSipId != null and deviceSipId != ''">device_sip_id = #{deviceSipId},</if>
|
||||
<if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
|
||||
<if test="model != null and model != ''">model = #{model},</if>
|
||||
<if test="firmware != null and firmware != ''">firmware = #{firmware},</if>
|
||||
<if test="transport != null and transport != ''">transport = #{transport},</if>
|
||||
<if test="streammode != null and streammode != ''">streamMode = #{streammode},</if>
|
||||
<if test="online != null and online != ''">online = #{online},</if>
|
||||
<if test="registertime != null">registerTime = #{registertime},</if>
|
||||
<if test="lastconnecttime != null">lastConnectTime = #{lastconnecttime},</if>
|
||||
<if test="activeTime != null">active_time = #{activeTime},</if>
|
||||
<if test="ip != null">ip = #{ip},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="hostaddress != null">hostAddress = #{hostaddress},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</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 device_id = #{deviceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSipDeviceByDeviceId" parameterType="Long">
|
||||
delete
|
||||
from sip_device
|
||||
where device_id = #{deviceId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSipDeviceByDeviceIds" parameterType="String">
|
||||
delete from sip_device where device_id in
|
||||
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
|
||||
#{deviceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateSipDeviceStatus" parameterType="SipDevice">
|
||||
update sip_device
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="online != null">online = #{online},</if>
|
||||
<if test="lastconnecttime != null">lastConnectTime = #{lastconnecttime},</if>
|
||||
<if test="activeTime != null">active_time = #{activeTime},</if>
|
||||
<if test="ip != null">ip = #{ip},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="hostaddress != null">hostaddress = #{hostaddress},</if>
|
||||
</trim>
|
||||
where device_sip_id = #{deviceSipId}
|
||||
</update>
|
||||
|
||||
<select id="selectOfflineSipDevice" parameterType="Integer" resultMap="SipDeviceResult">
|
||||
<include refid="selectSipDeviceVo"/>
|
||||
where NOW() > DATE_ADD(lastconnecttime, INTERVAL #{timeout} SECOND )
|
||||
</select>
|
||||
|
||||
<select id="selectSipDeviceBySipId" parameterType="String" resultMap="SipDeviceResult">
|
||||
<include refid="selectSipDeviceVo"/>
|
||||
where device_sip_id = #{deviceSipId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteSipDeviceByByDeviceSipId" parameterType="String">
|
||||
delete
|
||||
from sip_device
|
||||
where device_sip_id = #{deviceSipId}
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user