<?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="org.springblade.device.mapper.GbDeviceChannelMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="gbDeviceChannelResultMap" type="org.springblade.device.entity.GbDeviceChannel">
        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="update_user" property="updateUser"/>
        <result column="status" property="status"/>
        <result column="update_time" property="updateTime"/>
        <result column="create_time" property="createTime"/>
        <result column="channel_id" property="channelId"/>
        <result column="device_id" property="deviceId"/>
        <result column="name" property="name"/>
        <result column="manufacture" property="manufacture"/>
        <result column="model" property="model"/>
        <result column="address" property="address"/>
        <result column="parent_id" property="parentId"/>
        <result column="ip_address" property="ipAddress"/>
        <result column="port" property="port"/>
        <result column="ptz_type" property="ptzType"/>
        <result column="longitude" property="longitude"/>
        <result column="latitude" property="latitude"/>
        <result column="stream_id" property="streamId"/>
        <result column="parental" property="parental"/>
        <result column="has_audio" property="hasAudio"/>
        <result column="agency_id" property="agencyId"/>
        <result column="residential_id" property="residentialId"/>
        <result column="building_id" property="buildingId"/>
        <result column="floor_id" property="floorId"/>
        <result column="install_address" property="installAddress"/>
        <result column="channel_no" property="channelNo"/>
        <result column="tenant_id" property="tenantId"/>
    </resultMap>


    <select id="selectGbDeviceChannelPage" resultMap="gbDeviceChannelResultMap">
        select * from smart_gb_device_channel where is_deleted = 0
    </select>

    <delete id="deleteChannel">
        delete from smart_gb_device_channel WHERE device_id = #{deviceId} and tenant_id = #{tenantId}
    </delete>

</mapper>
