swb
2024-07-05 74bf71f3ad49ed5fe67e942c88b68a9354b87972
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
30
31
32
33
<?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.HistorySecondCruiserMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.moral.api.entity.HistorySecondCruiser">
        <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="getDusts" resultType="java.util.Map">
        SELECT
            value ->>'$.flylat' as flyLat,value ->>'$.flylon' as flyLon,value ->>'$.dustld' as dustld,
            `time`
        FROM `history_second_cruiser`
        WHERE mac = #{mac}
          AND `time` <![CDATA[>=]]> #{startTime}
          AND `time` <![CDATA[<]]> #{endTime}
    </select>
 
    <select id="getResult" resultType="com.moral.api.entity.HistorySecondCruiser">
        SELECT
            distinct mac,organization_id
        FROM `history_second_cruiser`
        WHERE
           `time` <![CDATA[>=]]> #{startTime}
          AND `time` <![CDATA[<=]]> #{endTime}
    </select>
</mapper>