|
@@ -3,16 +3,18 @@
|
|
|
<mapper namespace="org.jeecg.modules.deviceLesm.mapper.DevicePointMapper">
|
|
|
|
|
|
<select id="getPointInformation" parameterType="java.lang.String" resultType="org.jeecg.modules.deviceLesm.entity.DeviceRegionInformation">
|
|
|
- SELECT *, COUNT(*) as sum FROM (SELECT
|
|
|
- di.device_region_id,dp.gather_status,dp.device_id
|
|
|
- FROM
|
|
|
- device_information AS di
|
|
|
+ SELECT
|
|
|
+ di.device_region_id,
|
|
|
+ dp.gather_status,
|
|
|
+ dp.device_id,
|
|
|
+ COUNT(*) AS sum
|
|
|
+ FROM
|
|
|
+ ( SELECT id, device_region_id FROM device_information WHERE device_region_id = #{deviceRegionId} ) AS di
|
|
|
LEFT JOIN device_point AS dp ON dp.device_id = di.id
|
|
|
- WHERE
|
|
|
- di.device_region_id = #{deviceRegionId}
|
|
|
- ) dip
|
|
|
- WHERE dip.device_id is NOT null
|
|
|
+ WHERE
|
|
|
+ dp.device_id IS NOT NULL
|
|
|
GROUP BY
|
|
|
- gather_status
|
|
|
+ gather_status,
|
|
|
+ dp.device_id;
|
|
|
</select>
|
|
|
</mapper>
|