feat(sensor): 添加传感器设备详情视图功能
parent
153e42423f
commit
edd19b5a33
|
|
@ -79,7 +79,7 @@ public class SensorDeviceQueryExe {
|
|||
}
|
||||
|
||||
public SingleResponse<SensorDeviceCO> getById(Long id) {
|
||||
SensorDeviceDO d = sensorDeviceRepository.getById(id);
|
||||
SensorDeviceDO d = sensorDeviceRepository.detailView(id);
|
||||
if (d == null || "TRUE".equals(d.getDeleteEnum())) {
|
||||
return SingleResponse.buildFailure("记录不存在或已被删除");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,4 +30,6 @@ public interface SensorDeviceMapper extends BaseMapper<SensorDeviceDO> {
|
|||
IPage<SensorDeviceScreenCO> screenList(IPage<SensorDeviceScreenCO> page, @Param("params") Map<String, Object> params);
|
||||
|
||||
List<SensorDeviceFireStatusCO> fireSituation(@Param("params") Map<String, Object> params);
|
||||
|
||||
SensorDeviceDO detailView(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,6 @@ public interface SensorDeviceRepository extends BaseRepository<SensorDeviceDO> {
|
|||
PageResponse<SensorDeviceScreenCO> screenList(Map<String, Object> params);
|
||||
|
||||
List<SensorDeviceFireStatusCO> fireSituation(Map<String, Object> params);
|
||||
|
||||
SensorDeviceDO detailView(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,4 +50,9 @@ public class SensorDeviceRepositoryImpl extends BaseRepositoryImpl<SensorDeviceM
|
|||
public List<SensorDeviceFireStatusCO> fireSituation(Map<String, Object> params) {
|
||||
return sensorDeviceMapper.fireSituation(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SensorDeviceDO detailView(Long id) {
|
||||
return sensorDeviceMapper.detailView(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,4 +75,16 @@
|
|||
</where>
|
||||
GROUP BY sd.sensor_status
|
||||
</select>
|
||||
|
||||
<select id="detailView" resultType="com.zcloud.persistence.dataobject.SensorDeviceDO">
|
||||
SELECT
|
||||
sd.*,
|
||||
st.type_name AS sensorTypeName
|
||||
FROM iot_alarm_sensor_device sd
|
||||
LEFT JOIN iot_alarm_sensor_type st ON sd.sensor_type_id = st.id AND st.delete_enum = 'FALSE'
|
||||
<where>
|
||||
sd.id = #{id}
|
||||
AND sd.delete_enum = 'FALSE'
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue