细节调整
This commit is contained in:
parent
70ebc1868d
commit
64853e5ffe
|
|
@ -163,13 +163,13 @@ namespace LY.App.Service
|
||||||
var has = entity.startTime <= DateTime.Now && DateTime.Now <= entity.endTime;
|
var has = entity.startTime <= DateTime.Now && DateTime.Now <= entity.endTime;
|
||||||
return new Tuple<bool, long>(has, has ? entity.Id : 0);
|
return new Tuple<bool, long>(has, has ? entity.Id : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return new Tuple<bool, long>(false, 0); ;
|
return new Tuple<bool, long>(false, 0); ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -374,7 +374,7 @@ namespace LY.App.Service
|
||||||
RefAsync<int> total = 0;
|
RefAsync<int> total = 0;
|
||||||
var items = await _db.Queryable<Alarm>().SplitTable()
|
var items = await _db.Queryable<Alarm>().SplitTable()
|
||||||
.WhereIF(input.positionId.HasValue, st => st.positionId == input.positionId.Value)
|
.WhereIF(input.positionId.HasValue, st => st.positionId == input.positionId.Value)
|
||||||
.WhereIF(input.Frequency.HasValue, st => st.freq == input.Frequency.Value)
|
// .WhereIF(input.Frequency.HasValue, st => st.freq == input.Frequency.Value)
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.sn), s => s.serial_number.Contains(input.sn))
|
.WhereIF(!string.IsNullOrEmpty(input.sn), s => s.serial_number.Contains(input.sn))
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.model), st => st.device_type == input.model)
|
.WhereIF(!string.IsNullOrEmpty(input.model), st => st.device_type == input.model)
|
||||||
.WhereIF(input.strartDate.HasValue, st => st.CreateTime >= input.strartDate.Value)
|
.WhereIF(input.strartDate.HasValue, st => st.CreateTime >= input.strartDate.Value)
|
||||||
|
|
@ -387,7 +387,7 @@ namespace LY.App.Service
|
||||||
startTime = SqlFunc.AggregateMin(st.CreateTime),
|
startTime = SqlFunc.AggregateMin(st.CreateTime),
|
||||||
endTime = SqlFunc.AggregateMax(st.CreateTime),
|
endTime = SqlFunc.AggregateMax(st.CreateTime),
|
||||||
sn = st.serial_number,
|
sn = st.serial_number,
|
||||||
Frequency = st.freq,
|
Frequency = SqlFunc.AggregateMax(st.freq),
|
||||||
duration = (SqlFunc.AggregateMax(st.CreateTime) - SqlFunc.AggregateMin(st.CreateTime)).TotalSeconds,
|
duration = (SqlFunc.AggregateMax(st.CreateTime) - SqlFunc.AggregateMin(st.CreateTime)).TotalSeconds,
|
||||||
model = st.device_type,
|
model = st.device_type,
|
||||||
positionId = st.positionId,
|
positionId = st.positionId,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue