<?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.inspect.metadata.mqtt.mapper.HrDroneMapper">
    <resultMap id="BaseResultMap" type="com.inspect.metadata.mqtt.domain.HrDrone">
        <id property="droneId" column="drone_id"/>
        <result property="nestCode" column="nest_code"/>
        <result property="UAVOnoffstate" column="uav_onoffstate"/>
        <result property="droneBaseHeadDirection" column="drone_base_head_direction"/>
        <result property="droneHeadDirection" column="drone_head_direction"/>
        <result property="droneAlt" column="drone_alt"/>
        <result property="droneLat" column="drone_lat"/>
        <result property="droneLng" column="drone_lng"/>
        <result property="droneRelativeAlt" column="drone_relative_alt"/>
        <result property="droneFlyInSecond" column="drone_fly_in_second"/>
        <result property="droneFlyDistance" column="drone_fly_distance"/>
        <result property="remainFlightTimeInSecond" column="remain_flight_time_in_second"/>
        <result property="droneVSpeed" column="drone_v_speed"/>
        <result property="droneHSpeed" column="drone_h_speed"/>
        <result property="flightMode" column="flight_mode"/>
        <result property="dronePitch" column="drone_pitch"/>
        <result property="droneRoll" column="drone_roll"/>
        <result property="droneYaw" column="drone_yaw"/>
        <result property="satelliteCount" column="satellite_count"/>
        <result property="droneUavState" column="drone_uav_state"/>
        <result property="gimbalPitch" column="gimbal_pitch"/>
        <result property="gimbalRoll" column="gimbal_roll"/>
        <result property="gimbalYaw" column="gimbal_yaw"/>
        <result property="rtkState" column="rtk_state"/>
        <result property="flyingAction" column="flying_action"/>
        <result property="zoomRatio" column="zoom_ratio"/>
        <result property="headMode" column="head_mode"/>
        <result property="lensMode" column="lens_mode"/>
        <result property="loudState" column="loud_state"/>
        <result property="lightconnect" column="lightconnect"/>
        <result property="lightonoff" column="lightonoff"/>
        <result property="lightflash" column="lightflash"/>
        <result property="lightluminance" column="lightluminance"/>
        <result property="flightCount" column="flight_count"/>
        <result property="uavcontrolpower" column="uavcontrolpower"/>
        <result property="uavline" column="uavline"/>
        <result property="remote" column="remote"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>

    <sql id="selectDroneVo">
        select drone_id,
               nest_code,
               uav_onoffstate,
               drone_base_head_direction,
               drone_head_direction,
               drone_alt,
               drone_lat,
               drone_lng,
               drone_relative_alt,
               drone_fly_in_second,
               drone_fly_distance,
               remain_flight_time_in_second,
               drone_v_speed,
               drone_h_speed,
               flight_mode,
               drone_pitch,
               drone_roll,
               drone_yaw,
               satellite_count,
               drone_uav_state,
               gimbal_pitch,
               gimbal_roll,
               gimbal_yaw,
               rtk_state,
               flying_action,
               zoom_ratio,
               head_mode,
               lens_mode,
               loud_state,
               lightconnect,
               lightonoff,
               lightflash,
               lightluminance,
               flight_count,
               uavcontrolpower,
               uavline,
               remote,
               create_time,
               update_time
        from basedata_hr_drone
    </sql>

    <select id="selectDroneList" resultMap="BaseResultMap">
        <include refid="selectDroneVo" />
        <where>
            <if test="nestCode != null ">and nestCode = #{nestCode}</if>
        </where>
    </select>
</mapper>