xufenglei
2019-07-22 06425536454fa2bc15fc2aaf1c59d7d78571fc80
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>