<?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.GbDeviceMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="gbDeviceResultMap" type="org.springblade.device.entity.Gb28181Device">
        <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="device_id" property="deviceId"/>
        <result column="name" property="name"/>
        <result column="manufacturer" property="manufacturer"/>
        <result column="model" property="model"/>
        <result column="transport" property="transport"/>
        <result column="stream_mode" property="streamMode"/>
        <result column="online" property="online"/>
        <result column="register_time" property="registerTime"/>
        <result column="keepalive_time" property="keepaliveTime"/>
        <result column="ip" property="ip"/>
        <result column="port" property="port"/>
        <result column="host_address" property="hostAddress"/>
        <result column="agency_id" property="agencyId"/>
        <result column="residential_id" property="residentialId"/>
    </resultMap>


    <select id="selectGbDevicePage" resultMap="gbDeviceResultMap">
        select * from smart_gb_device where is_deleted = 0
    </select>

    <delete id="deleteDevice">
        delete from smart_gb_device WHERE id = #{id}
    </delete>

</mapper>
