| 
					
				 | 
			
			
				@@ -388,7 +388,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="statsDeviceParm" resultMap="deviceDataMap"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SELECT t6.id device_id,t6.device_code,t6.device_name,t7.attribute_id,t7.parm_type attribute_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				          case when t7.attribute_id is  null then null when t8.id is null then 0 else 1 end is_alarm 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <if test="type == 4 ">,t8.latest_value</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="type == 4 ">,t9.latest_value</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         from sms_scene t1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <include refid="deviceInnerJoins"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join sms_device_parm t7 on  t7.scene_id=t2.scene_id and  t7.device_id=t2.device_id 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -408,7 +408,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             from sms_day_report b1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             where b1.year = year(now() + interval-1 day) and b1.month = month(now() + interval-1 day) and b1.day = day(now() + interval-1 day) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             group by b1.device_id,b1.attribute_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            )t8 on t8.device_id=t2.device_id and t8.attribute_id =t7.attribute_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            )t9 on t9.device_id=t2.device_id and t9.attribute_id =t7.attribute_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="type == 5 "> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and t7.parm_type in(14) 
			 |