jinpengyong
2023-11-01 87172c08a55e972ff850ab3542858d11d66505ca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?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.moral.api.mapper.HistorySecondUavMapper">
 
        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.moral.api.entity.HistorySecondUav">
                    <result column="mac" property="mac" />
                    <result column="time" property="time" />
                    <result column="value" property="value" />
                    <result column="organization_id" property="organizationId" />
                    <result column="batch" property="batch" />
        </resultMap>
 
    <select id="reList" resultType="com.moral.api.entity.HistorySecondUav">
        SELECT history_second_uav.time,`value`
        FROM history_second_uav WHERE mac = #{mac}
        AND batch = #{batch}
        HAVING abs(`value`->>'$.flyhig') <![CDATA[>=]]> #{height1}
        and  abs(`value`->>'$.flyhig') <![CDATA[<=]]> #{height2}
    </select>
 
    <select id="reListDetail" resultType="com.moral.api.pojo.dto.uav.UAVGetBD">
        SELECT history_second_uav.time,value->>#{type} as num,value->>'$.flylon' as flyLon,value->>'$.flylat' as flyLat
        FROM history_second_uav WHERE mac = #{mac}
                                  AND batch = #{batch}
        HAVING abs(`value`->>'$.flyhig') <![CDATA[>=]]> #{height1}
           and  abs(`value`->>'$.flyhig') <![CDATA[<=]]> #{height2}
    </select>
</mapper>