<?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.tuoheng.admin.mapper.ThInspectionMapper">

    <resultMap id="BaseResultMap" type="com.tuoheng.admin.entity.domain.ThInspection">
        <id column="id" jdbcType="INTEGER" property="id" />
        <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
        <result column="inspection_id" jdbcType="INTEGER" property="inspectionId" />
        <result column="mission_id" jdbcType="INTEGER" property="missionId" />
        <result column="lng" jdbcType="VARCHAR" property="lng" />
        <result column="lat" jdbcType="VARCHAR" property="lat" />
        <result column="host_ip" jdbcType="VARCHAR" property="hostIp" />
        <result column="altitude" jdbcType="VARCHAR" property="altitude" />
        <result column="speed" jdbcType="VARCHAR" property="speed" />
        <result column="fly_time" jdbcType="INTEGER" property="flyTime" />
        <result column="dist_home" jdbcType="VARCHAR" property="distHome" />
        <result column="ysingal" jdbcType="VARCHAR" property="ysingal" />
        <result column="create_user" jdbcType="INTEGER" property="createUser" />
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
        <result column="update_user" jdbcType="INTEGER" property="updateUser" />
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
        <result column="mark" jdbcType="INTEGER" property="mark" />
    </resultMap>

    <sql id="Base_Column_List">
        id, tenant_id, inspection_id, mission_id, lng, lat, host_ip, altitude, speed, fly_time, dist_home, ysingal
        create_user, create_time, update_user, update_time, mark
    </sql>

    <select id="selectListByMissionId" parameterType="java.util.Map" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from th_inspection
        where mission_id = #{id} and tenant_id = #{tenantId}
        and mark = 1
        order by create_time asc
    </select>
</mapper>