|
@@ -26,11 +26,11 @@
|
|
|
|
|
|
|
|
|
|
<select id="getLastFlow" resultType="com.huimv.environ.eco.entity.dto.LastFlowDto">
|
|
<select id="getLastFlow" resultType="com.huimv.environ.eco.entity.dto.LastFlowDto">
|
|
- SELECT CONCAT(b.pigpen_name,a.pigpen_name) room,d.device_code,df.id1_value 'tem',df.id2_value 'hum'
|
|
|
|
- FROM `base_pigpen` a INNER JOIN `base_pigpen` b ON a.parent_id =b.id
|
|
|
|
- LEFT JOIN `eco_device` d ON d.unit_id = a.id
|
|
|
|
|
|
+ SELECT CONCAT(b.pigpen_name,a.pigpen_name) room,df.id1_value 'tem',df.id2_value 'hum'
|
|
|
|
+ FROM `base_pigpen` a INNER JOIN `base_pigpen` b ON a.parent_id =b.id AND a.farm_code = #{farmId}
|
|
|
|
+ LEFT JOIN `eco_device` d ON d.unit_id = a.id AND d.device_type ='1'
|
|
LEFT JOIN `eco_device_flow` df ON d.device_code = df.device_code
|
|
LEFT JOIN `eco_device_flow` df ON d.device_code = df.device_code
|
|
- AND df.id IN (SELECT MAX(df.id) FROM `eco_device_flow` df GROUP BY device_code) AND df.farm_id=#{farmId}
|
|
|
|
|
|
+ AND df.id IN (SELECT MAX(df.id) FROM `eco_device_flow` df GROUP BY device_code)
|
|
ORDER BY a.id DESC,a.parent_id DESC
|
|
ORDER BY a.id DESC,a.parent_id DESC
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|