swb
2024-11-15 aa1bdb548aa6a6371a8953efacc3986300eee576
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?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.HistoryAqiMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.moral.api.entity.HistoryAqi">
        <result column="guid" property="guid"/>
        <result column="time" property="time"/>
        <result column="value" property="value"/>
    </resultMap>
 
 
    <select id="query" resultType="com.moral.api.pojo.dto.historyAqi.HistoryAqiDto">
        SELECT `value` -> '$.co' as a21005,
        `value` -> '$.o3' as a05024,
        `value` -> '$.no2' as a21004,
        `value` -> '$.so2' as a21026,
        `value` -> '$.pm10' as a34002,
        `value` -> '$.pm2_5' as a34004,
        `value` -> '$.pubtime' as dataTime
        FROM history_aqi where guid=#{guid} and history_aqi.time =(SELECT MAX(time)  FROM history_aqi)
    </select>
</mapper>