ZhuDongming
2019-06-05 246f2dd16a3bea029af143a9267d116d3532e095
增加溯源查询sql
1 files modified
16 ■■■■■ changed files
src/main/resources/mapper/HistoryDailyMapper.xml 16 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/HistoryDailyMapper.xml
@@ -94,4 +94,20 @@
            vdd.monitor_point_id,
            vdd.device_tech
        </select>
    <!-- 根据设备mac地址,时间,污染因子查询一天的平均值 -->
    <select id="getTraceabilityData" resultType="java.util.Map">
        SELECT
            json ->'$.${sensorKey}[0]' AS '${sensorKey}'
        FROM
            history_daily
        <where>
            <if test="mac!=null and mac!=''">
                AND mac=#{mac}
            </if>
            <if test="time!=null and time!=''">
                AND time=#{time}
            </if>
        </where>
    </select>
</mapper>