|
@@ -13,6 +13,7 @@ import com.bizmatics.mhfire.service.DeviceService;
|
|
|
import com.bizmatics.mhfire.service.vo.DeviceMapVO;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -27,17 +28,19 @@ import java.util.List;
|
|
|
public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device> implements DeviceService {
|
|
|
|
|
|
@Override
|
|
|
- public List<DeviceMapVO> getMapList() {
|
|
|
+ public List<DeviceMapVO> getMapList(Date startTime, Date endTime) {
|
|
|
LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.select(Device::getId,Device::getLatitude,Device::getLongitude);
|
|
|
+ queryWrapper.select(Device::getId,Device::getLatitude,Device::getLongitude)
|
|
|
+ .between(null != startTime && endTime != null,Device::getCreateTime,startTime,endTime)
|
|
|
+ .orderByDesc(Device::getCreateTime);
|
|
|
List<Device> list = this.list(queryWrapper);
|
|
|
return BeanMapperUtils.mapList(list,Device.class,DeviceMapVO.class);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonPage<DeviceCollectVO> getCollect(Integer current, Integer size, String deviceType, String deviceCode) {
|
|
|
+ public CommonPage<DeviceCollectVO> getCollect(Integer current, Integer size, String deviceType, String deviceCode,Date startTime, Date endTime) {
|
|
|
Page<DeviceCollectVO> page = new Page<>(current, size);
|
|
|
- page = baseMapper.selectCollect(page,deviceType,deviceCode);
|
|
|
+ page = baseMapper.selectCollect(page,deviceType,deviceCode,startTime,endTime);
|
|
|
return new CommonPage<>(page.getRecords(),page.getTotal(),page.getSize(),page.getCurrent());
|
|
|
}
|
|
|
}
|