<?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>
|