| 
						
						
							
								
							
						
						
					 | 
					@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        <result property="deviceName"    column="device_name"    /> | 
					 | 
					 | 
					        <result property="deviceName"    column="device_name"    /> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        <result property="stakeMark"    column="stake_mark"    /> | 
					 | 
					 | 
					        <result property="stakeMark"    column="stake_mark"    /> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        <result property="direction"    column="direction"    /> | 
					 | 
					 | 
					        <result property="direction"    column="direction"    /> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        <result property="deviceState"    column="device_state"    /> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    </resultMap> | 
					 | 
					 | 
					    </resultMap> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    <resultMap type="map" id="countMap"> | 
					 | 
					 | 
					    <resultMap type="map" id="countMap"> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        <result property="timeSlot"    column="time_slot"    /> | 
					 | 
					 | 
					        <result property="timeSlot"    column="time_slot"    /> | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -172,16 +173,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    </select> | 
					 | 
					 | 
					    </select> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    <select id="selectlistAll" parameterType="com.zc.business.domain.DcMeteorologicalDetectorData" resultMap="DcMeteorologicalDetectorDataResult"> | 
					 | 
					 | 
					    <select id="selectlistAll" parameterType="com.zc.business.domain.DcMeteorologicalDetectorData" resultMap="DcMeteorologicalDetectorDataResult"> | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        SELECT mdd1.id,mdd1.iot_device_id,mdd1.rainfall,mdd1.visibility_type,mdd1. visibility,mdd1.atmospheric_pressure, | 
					 | 
					 | 
					        WITH LatestData AS ( | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					               mdd1. temperature,mdd1. humidity,mdd1.wind_direction, mdd1. wind_speed, mdd1. precipitation_type, mdd1.wet_slippery_coefficient, | 
					 | 
					 | 
					            SELECT | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					               mdd1.remote_road_surface_temperature, mdd1. remote_road_surface_status, mdd1. water_film_ice_snow_value,mdd1.create_time, | 
					 | 
					 | 
					                m.* | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					               mdd1.stake_mark,mdd1.device_name,mdd1.direction | 
					 | 
					 | 
					            FROM | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        FROM dc_meteorological_detector_data mdd1 | 
					 | 
					 | 
					                dc_meteorological_detector_data m | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                 JOIN ( | 
					 | 
					 | 
					            WHERE | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            SELECT device_name, MAX(create_time) AS max_create_time | 
					 | 
					 | 
					                m.create_time = ( | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            FROM dc_meteorological_detector_data | 
					 | 
					 | 
					                    SELECT MAX(m2.create_time) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            GROUP BY device_name | 
					 | 
					 | 
					                    FROM dc_meteorological_detector_data m2 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        ) mdd2 | 
					 | 
					 | 
					                    WHERE m.iot_device_id = m2.iot_device_id | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                      ON mdd1.device_name = mdd2.device_name AND mdd1.create_time = mdd2.max_create_time; | 
					 | 
					 | 
					                ) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        ) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        SELECT | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            d.iot_device_id, d.stake_mark, d.direction, d.device_name, d.device_state, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ld.create_time AS latest_create_time, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ld.rainfall, ld.visibility_type, ld.visibility, ld.atmospheric_pressure, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ld.temperature, ld.humidity, ld.wind_direction, ld.wind_speed, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ld.precipitation_type, ld.wet_slippery_coefficient, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ld.remote_road_surface_temperature, ld.remote_road_surface_status, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            ld.water_film_ice_snow_value | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        FROM | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            dc_device d | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                LEFT JOIN | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            LatestData ld ON | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                d.iot_device_id = ld.iot_device_id | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        WHERE | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            d.device_type = 3; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    </select> | 
					 | 
					 | 
					    </select> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					</mapper> | 
					 | 
					 | 
					</mapper> |