Browse Source

气象检设备map

develop
王兴琳 1 year ago
parent
commit
82fc1b0f9d
  1. 48
      zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml

48
zc-business/src/main/resources/mapper/business/DcMeteorologicalDetectorDataMapper.xml

@ -173,31 +173,37 @@ 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">
WITH LatestData AS (
SELECT SELECT
m.* d.iot_device_id,
FROM d.stake_mark,
dc_meteorological_detector_data m d.direction,
WHERE d.device_name,
m.create_time = ( d.device_state,
SELECT MAX(m2.create_time) lm.create_time AS latest_create_time,
FROM dc_meteorological_detector_data m2 lm.rainfall,
WHERE m.iot_device_id = m2.iot_device_id lm.visibility_type,
) lm.visibility,
) lm.atmospheric_pressure,
SELECT lm.temperature,
d.iot_device_id, d.stake_mark, d.direction, d.device_name, d.device_state, lm.humidity,
ld.create_time AS latest_create_time, lm.wind_direction,
ld.rainfall, ld.visibility_type, ld.visibility, ld.atmospheric_pressure, lm.wind_speed,
ld.temperature, ld.humidity, ld.wind_direction, ld.wind_speed, lm.precipitation_type,
ld.precipitation_type, ld.wet_slippery_coefficient, lm.wet_slippery_coefficient,
ld.remote_road_surface_temperature, ld.remote_road_surface_status, lm.remote_road_surface_temperature,
ld.water_film_ice_snow_value lm.remote_road_surface_status,
lm.water_film_ice_snow_value
FROM FROM
dc_device d dc_device d
LEFT JOIN LEFT JOIN
LatestData ld ON dc_meteorological_detector_data lm
d.iot_device_id = ld.iot_device_id ON
d.iot_device_id = lm.iot_device_id
AND lm.id IN (
SELECT MAX(id)
FROM dc_meteorological_detector_data
WHERE iot_device_id = d.iot_device_id
)
WHERE WHERE
d.device_type = 3; d.device_type = 3;

Loading…
Cancel
Save