浏览代码

汇总数据

wangyangyang 4 年之前
父节点
当前提交
8b72de4da0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      sms_water/src/main/resources/mapper/MonitorInfoMapper.xml

+ 1 - 1
sms_water/src/main/resources/mapper/MonitorInfoMapper.xml

@@ -104,7 +104,7 @@
         INNER JOIN sms_day_report c on a.ATTRIBUTE_ID=c.ATTRIBUTE_ID and a.DEVICE_ID=c.DEVICE_ID
         INNER JOIN (select b.PARM_TYPE,max(d.collect_date) collect_date
         from sms_day_report d
-        INNER JOIN sms_device_parm b on d.ATTRIBUTE_ID=b.ID and  b.`STATUS`=1
+        INNER JOIN sms_device_parm b on d.DEVICE_ID=b.DEVICE_ID and d.ATTRIBUTE_ID = b.ATTRIBUTE_ID and  b.`STATUS`=1
         where d.DEVICE_ID = #{report.deviceId}
         <if test="report.year != null ">and d.`YEAR`=#{report.year}</if>
         <if test="report.month != null ">and d.`MONTH`=#{report.month}</if>