|
@@ -1,12 +1,14 @@
|
|
|
package com.usky.park.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.usky.park.domain.DataGrHistory;
|
|
|
import com.usky.park.domain.DataLgHistory;
|
|
|
import com.usky.park.mapper.DataLgHistoryMapper;
|
|
|
import com.usky.park.service.DataLgHistoryService;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
+import org.apache.catalina.security.SecurityUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.HashMap;
|
|
@@ -28,12 +30,11 @@ public class DataLgHistoryServiceImpl extends AbstractCrudService<DataLgHistoryM
|
|
|
{
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
LambdaQueryWrapper<DataLgHistory> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(DataLgHistory::getAttributeName,"switch_status")
|
|
|
- .eq(DataLgHistory::getAttributeData,"1")
|
|
|
- .eq(DataLgHistory::getDeviceId,deviceId)
|
|
|
- .between(DataLgHistory::getDataTime,startDate,endDate);
|
|
|
+ queryWrapper.eq(StringUtils.isNotBlank(deviceId),DataLgHistory::getDeviceId,deviceId)
|
|
|
+ .eq(DataLgHistory::getAttributeName,"switch_status")
|
|
|
+ .between(DataLgHistory::getDataTime,startDate,endDate)
|
|
|
+ .eq(DataLgHistory::getAttributeData,"1");
|
|
|
int count = this.count(queryWrapper);
|
|
|
- map.put("device_id",deviceId);
|
|
|
map.put("count",count);
|
|
|
|
|
|
return map;
|