xufenglei
2018-05-14 c0d88c1f82394c0374d2d592f4d2bca951d6334e
src/main/resources/mapper/HistoryMinutelyMapper.xml
@@ -20,8 +20,8 @@
   
   <select id="getMonitorPointOrDeviceAvgData" resultType="java.util.Map">
      SELECT
         DATE_FORMAT(time, #{typeFormat}) time,
         <foreach  collection="sensorKeys" separator="," item="sensorKey">
         DATE_FORMAT(time, #{typeFormat}) time
         <foreach  collection="sensorKeys" open="," separator="," item="sensorKey">
            AVG(json->'$.${sensorKey}[0]') AS '${sensorKey}'
         </foreach>
      FROM
@@ -53,6 +53,9 @@
            <if test="monitorPointId != null">
            AND mp.id =   #{monitorPointId}
            </if>
            <if test="professionId != null">
            AND d.profession_id = #{professionId}
            </if>
         )   
      </if>