设备信息

This commit is contained in:
zhumeixiao
2024-11-28 09:27:48 +08:00
parent f91997de6e
commit 45c7d57b00
4 changed files with 18 additions and 12 deletions

View File

@ -66,5 +66,5 @@ public interface IDeviceBreakdownService
* @param CreateTimeValue
* @return
*/
public List<IotDeviceBreakdown> getFaultStatistics(String TypeValue,String CreateTimeValue);
public List<IotDeviceBreakdown> getFaultStatistics(String TypeValue,String CreateTimeValue, String EndTimeValue);
}

View File

@ -106,17 +106,18 @@ public class DeviceBreakdownServiceImpl implements IDeviceBreakdownService
* @return
*/
@Override
public List<IotDeviceBreakdown> getFaultStatistics(String TypeValue, String CreateTimeValue){
public List<IotDeviceBreakdown> getFaultStatistics(String TypeValue, String CreateTimeValue,String EndTimeValue){
QueryWrapper<DeviceBreakdown> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("Type", TypeValue)
.le("create_time",CreateTimeValue)
.ge("create_time",CreateTimeValue)
.le("create_time",EndTimeValue)
.select("count(*) as id", "fault_name", "create_time","Type")
.groupBy("fault_name");
List<IotDeviceBreakdown> breakdown = new ArrayList<>();
QueryWrapper<DeviceBreakdown> query = new QueryWrapper<>();
query.eq("Type",TypeValue);
QueryWrapper<DeviceBreakdown> queryTime = new QueryWrapper<>();
queryTime.le("create_time",CreateTimeValue);
queryTime.le("create_time",EndTimeValue).ge("create_time",CreateTimeValue);
if ((deviceBreakdownMapper.selectCount(query) <=0)||(deviceBreakdownMapper.selectCount(queryTime)<=0)) {
return breakdown;
}