|
@@ -19,7 +19,7 @@ import java.util.List;
|
|
@Service
|
|
@Service
|
|
public class AlarmCountService extends ServiceImpl<AlarmCountMapper, AlarmCount> {
|
|
public class AlarmCountService extends ServiceImpl<AlarmCountMapper, AlarmCount> {
|
|
|
|
|
|
- public List<AlarmCount> getAlarmCount(List<String> snapIdList, Date startTime, Date endTime) {
|
|
|
|
|
|
+ public List<AlarmCount> getAlarmCount(List<Long> snapIdList, Date startTime, Date endTime) {
|
|
|
|
|
|
List<AlarmCount> resultList = new ArrayList<>();
|
|
List<AlarmCount> resultList = new ArrayList<>();
|
|
|
|
|
|
@@ -29,20 +29,20 @@ public class AlarmCountService extends ServiceImpl<AlarmCountMapper, AlarmCount>
|
|
int remainder = snapIdList.size() % 1000;
|
|
int remainder = snapIdList.size() % 1000;
|
|
if (remainder == 0) {
|
|
if (remainder == 0) {
|
|
for (int i = 0; i < selectCount; i++) {
|
|
for (int i = 0; i < selectCount; i++) {
|
|
- List<String> subSnapIdList = snapIdList.subList(1000 * i, 1000 * (i + 1));
|
|
|
|
|
|
+ List<Long> subSnapIdList = snapIdList.subList(1000 * i, 1000 * (i + 1));
|
|
List<AlarmCount> subList = baseMapper.getAlarmCountBySnapIdList(subSnapIdList, startTime, endTime);
|
|
List<AlarmCount> subList = baseMapper.getAlarmCountBySnapIdList(subSnapIdList, startTime, endTime);
|
|
resultList.addAll(subList);
|
|
resultList.addAll(subList);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
|
|
for (int i = 0; i < selectCount; i++) {
|
|
for (int i = 0; i < selectCount; i++) {
|
|
- List<String> subSnapIdList = snapIdList.subList(1000 * i, 1000 * (i + 1));
|
|
|
|
|
|
+ List<Long> subSnapIdList = snapIdList.subList(1000 * i, 1000 * (i + 1));
|
|
List<AlarmCount> subList = baseMapper.getAlarmCountBySnapIdList(subSnapIdList, startTime, endTime);
|
|
List<AlarmCount> subList = baseMapper.getAlarmCountBySnapIdList(subSnapIdList, startTime, endTime);
|
|
resultList.addAll(subList);
|
|
resultList.addAll(subList);
|
|
}
|
|
}
|
|
//将数组剩余元素进行查询
|
|
//将数组剩余元素进行查询
|
|
|
|
|
|
- List<String> lastSnapIdList = snapIdList.subList(snapIdList.size() - remainder, snapIdList.size());
|
|
|
|
|
|
+ List<Long> lastSnapIdList = snapIdList.subList(snapIdList.size() - remainder, snapIdList.size());
|
|
List<AlarmCount> lastSubList = baseMapper.getAlarmCountBySnapIdList(lastSnapIdList, startTime, endTime);
|
|
List<AlarmCount> lastSubList = baseMapper.getAlarmCountBySnapIdList(lastSnapIdList, startTime, endTime);
|
|
resultList.addAll(lastSubList);
|
|
resultList.addAll(lastSubList);
|
|
}
|
|
}
|