dev #2
@ -152,4 +152,13 @@ public class EmsSiteConfigController extends BaseController{
|
||||
List<PointQueryResponse> result = iEmsDeviceSettingService.getSingleSiteDevicePoints(request);
|
||||
return getDataTable2(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定站点下的所有设备类别
|
||||
*/
|
||||
@GetMapping("/getSiteAllDeviceCategory")
|
||||
public AjaxResult getSiteAllDeviceCategory(String siteId)
|
||||
{
|
||||
return success(iEmsDeviceSettingService.getSiteAllDeviceCategory(siteId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,5 +88,5 @@ public interface EmsDevicesSettingMapper
|
||||
public List<Map<String, Object>> getClusterIdsByFuzzyQuery(@Param("siteId")String siteId, @Param("deviceCategory")String deviceCategory,
|
||||
@Param("parentId")String parentId);
|
||||
|
||||
public List<String> getDeviceIdsBySiteIdAndCategory(@Param("siteId")String siteId,@Param("deviceCategory")String deviceCategory);
|
||||
public List<String> getAllDeviceCategoryBySiteId(String siteId);
|
||||
}
|
||||
|
||||
@ -26,4 +26,6 @@ public interface IEmsDeviceSettingService
|
||||
public List<DeviceCategory> getDeviceCategory();
|
||||
|
||||
public List<PointQueryResponse> getSingleSiteDevicePoints(PointDataRequest request);
|
||||
|
||||
public List<String> getSiteAllDeviceCategory(String siteId);
|
||||
}
|
||||
|
||||
@ -219,6 +219,12 @@ public class EmsDeviceSettingServiceImpl implements IEmsDeviceSettingService
|
||||
.sorted(finalComparator)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSiteAllDeviceCategory(String siteId) {
|
||||
return emsDevicesMapper.getAllDeviceCategoryBySiteId(siteId);
|
||||
}
|
||||
|
||||
// 辅助方法:根据值查找对应的对象(用于比较器中获取完整对象)
|
||||
private PointQueryResponse findByValue(List<PointQueryResponse> list, Object value) {
|
||||
return list.stream()
|
||||
|
||||
@ -216,7 +216,12 @@
|
||||
and device_category = #{deviceCategory}
|
||||
</select>
|
||||
|
||||
<select id="getDeviceIdsBySiteIdAndCategory" resultType="java.lang.String">
|
||||
select DISTINCT device_id from ems_devices_setting where site_id = #{siteId} and device_category = #{deviceCategory}
|
||||
<select id="getAllDeviceCategoryBySiteId" resultType="java.lang.String">
|
||||
select DISTINCT device_category
|
||||
from ems_devices_setting
|
||||
where 1=1
|
||||
<if test="siteId !=null and siteId !=''">
|
||||
and site_id = #{siteId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user