瀏覽代碼

报表修改

wangyangyang 4 年之前
父節點
當前提交
1534fdc5ac

+ 5 - 5
sms_water/src/main/resources/mapper/DayReportMapper.xml

@@ -103,7 +103,7 @@
         b.parent_scene_id as "parentSceneId",
         c.SCENE_NAME as "parentSceneName"
         FROM sms_day_report a
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         inner join sms_scene c on b.PARENT_SCENE_ID=c.id
         <where>
             b.IS_REPORT=1
@@ -133,7 +133,7 @@
         INNER JOIN sms_device_attribute b on a.ATTRIBUTE_ID=b.ID
         INNER JOIN sms_day_report c on a.ATTRIBUTE_ID=c.ATTRIBUTE_ID and a.DEVICE_ID=c.DEVICE_ID
         where
-        a.IS_REPORT=1
+        a.IS_REPORT=1 and a.`STATUS`=1
         <if test="report.deviceIds != null and report.deviceIds.size() > 0">
             and a.DEVICE_ID in
             <foreach collection="report.deviceIds" item="dramaId" open="(" close=")" separator=",">
@@ -181,7 +181,7 @@
         <if test="report.month != null ">and c.`MONTH`=#{report.month}</if>
         <if test="report.day != null ">and c.`DAY`=#{report.day}</if>
         <if test="report.parentSceneId != null ">and a.PARENT_SCENE_ID=#{report.parentSceneId}</if>
-        and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6)) tab
+        and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6) and a.`STATUS`=1) tab
         group by tab.year,tab.month,tab.day,tab.HOUR
         order by tab.year desc,tab.month desc,tab.day desc,tab.hour desc
     </select>
@@ -195,7 +195,7 @@
         a.COLLECT_DATE as "collectDate"
         FROM sms_day_report a
         inner join sms_device d on d.id = a.DEVICE_ID
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         <if test="dayReport.type == 1">
                and b.PARM_TYPE = 13
            </if>
@@ -243,7 +243,7 @@
         a.year,a.month,a.day,a.hour
         FROM sms_day_report a
         inner join sms_device d on d.id = a.DEVICE_ID
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
             and (b.PARM_TYPE = 7 or b.PARM_TYPE = 10  or b.PARM_TYPE = 11)
         <where>
             <if test="dayReport.tenantId != null  and dayReport.tenantId != ''">and a.tenant_id =

+ 6 - 6
sms_water/src/main/resources/mapper/MonthReportMapper.xml

@@ -102,7 +102,7 @@
         b.parent_scene_id as "parentSceneId",
         c.SCENE_NAME as "parentSceneName"
         FROM sms_month_report a
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         inner join sms_scene c on b.PARENT_SCENE_ID=c.id
         <where>
             b.IS_REPORT=1
@@ -131,7 +131,7 @@
         INNER JOIN sms_device_attribute b on a.ATTRIBUTE_ID=b.ID
         INNER JOIN sms_month_report c on a.ATTRIBUTE_ID=c.ATTRIBUTE_ID and a.DEVICE_ID=c.DEVICE_ID
         where
-        a.IS_REPORT=1
+        a.IS_REPORT=1 and  a.`STATUS`=1
         <if test="report.deviceIds != null and report.deviceIds.size() > 0">
             and a.DEVICE_ID in
             <foreach collection="report.deviceIds" item="dramaId" open="(" close=")" separator=",">
@@ -177,7 +177,7 @@
         <if test="report.year != null ">and c.`YEAR`=#{report.year}</if>
         <if test="report.month != null ">and c.`MONTH`=#{report.month}</if>
         <if test="report.parentSceneId != null ">and c.PARENT_SCENE_ID=#{report.parentSceneId}</if>
-        and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6)) tab
+        and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6) and  a.`STATUS`=1) tab
         group by tab.year,tab.month,tab.day
         order by tab.year desc,tab.month desc,tab.day desc
     </select>
@@ -191,7 +191,7 @@
         a.COLLECT_DATE as "collectDate"
         FROM sms_month_report a
         inner join sms_device d on d.id = a.DEVICE_ID
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         <if test="monthReport.type == 1">
             and b.PARM_TYPE = 13
         </if>
@@ -200,7 +200,7 @@
         </if>
         <where>
             <if test="monthReport.tenantId != null  and monthReport.tenantId != ''">and a.tenant_id =
-                #{dayReport.tenantId}
+                #{monthReport.tenantId}
             </if>
             <if test="monthReport.year != null ">and a.year = #{monthReport.year}</if>
             <if test="monthReport.month != null ">and a.month = #{monthReport.month}</if>
@@ -238,7 +238,7 @@
         a.year,a.month,a.day
         FROM sms_month_report a
         inner join sms_device d on d.id = a.DEVICE_ID
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         and (b.PARM_TYPE = 7 or b.PARM_TYPE = 10  or b.PARM_TYPE = 11)
         <where>
             <if test="monthReport.tenantId != null  and monthReport.tenantId != ''">and a.tenant_id =

+ 5 - 5
sms_water/src/main/resources/mapper/YearReportMapper.xml

@@ -101,7 +101,7 @@
         b.parent_scene_id as "parentSceneId",
         c.SCENE_NAME as "parentSceneName"
         FROM sms_year_report a
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         inner join sms_scene c on b.PARENT_SCENE_ID=c.id
         <where>
             b.IS_REPORT=1
@@ -129,7 +129,7 @@
         INNER JOIN sms_device_attribute b on a.ATTRIBUTE_ID=b.ID
         INNER JOIN sms_year_report c on a.ATTRIBUTE_ID=c.ATTRIBUTE_ID and a.DEVICE_ID=c.DEVICE_ID
         where
-        a.IS_REPORT=1
+        a.IS_REPORT=1 and  a.`STATUS`=1
         <if test="report.deviceIds != null and report.deviceIds.size() > 0">
             and a.DEVICE_ID in
             <foreach collection="report.deviceIds" item="dramaId" open="(" close=")" separator=",">
@@ -174,7 +174,7 @@
         <if test="report.year != null ">and c.`YEAR`=#{report.year}</if>
         <if test="report.month != null ">and c.`MONTH`=#{report.month}</if>
         <if test="report.parentSceneId != null ">and a.PARENT_SCENE_ID=#{report.parentSceneId}</if>
-        and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6)) tab
+        and (a.PARM_TYPE =3 or a.PARM_TYPE =4 or a.PARM_TYPE =5 or a.PARM_TYPE =6) and  a.`STATUS`=1) tab
         group by tab.year,tab.month
         order by tab.year desc,tab.month desc
     </select>
@@ -189,7 +189,7 @@
         a.COLLECT_DATE as "collectDate"
         FROM sms_year_report a
         inner join sms_device d on d.id = a.DEVICE_ID
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         <if test="yearReport.type == 1">
             and b.PARM_TYPE = 13
         </if>
@@ -235,7 +235,7 @@
         a.year,a.month
         FROM sms_year_report a
         inner join sms_device d on d.id = a.DEVICE_ID
-        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID
+        inner join sms_device_parm b on a.DEVICE_ID = b.DEVICE_ID and a.ATTRIBUTE_ID=b.ATTRIBUTE_ID and b.`STATUS`=1
         and (b.PARM_TYPE = 7 or b.PARM_TYPE = 10  or b.PARM_TYPE = 11)
         <where>
             <if test="yearReport.tenantId != null  and yearReport.tenantId != ''">and a.tenant_id =