|
|
@@ -1,7 +1,7 @@
|
|
|
package com.zhongshu.iot.server.core.dao.iot.impl;
|
|
|
|
|
|
-import com.github.microservice.components.data.mongo.mongo.helper.DBHelper;
|
|
|
import com.github.microservice.busInfoModel.thing.IotThingSearch;
|
|
|
+import com.github.microservice.components.data.mongo.mongo.helper.DBHelper;
|
|
|
import com.zhongshu.iot.server.core.dao.base.BaseImpl;
|
|
|
import com.zhongshu.iot.server.core.dao.iot.extend.IotThingDaoExtend;
|
|
|
import com.zhongshu.iot.server.core.domain.iot.IotThing;
|
|
|
@@ -58,6 +58,16 @@ public class IotThingDaoImpl extends BaseImpl implements IotThingDaoExtend {
|
|
|
criteria.and("iotTemplateId").is(param.getIotTemplateId());
|
|
|
}
|
|
|
|
|
|
+ // 状态
|
|
|
+ if (param.getState() != null) {
|
|
|
+ criteria.and("state").is(param.getState());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 所属产品
|
|
|
+ if (StringUtils.isNotEmpty(param.getProductCode())) {
|
|
|
+ criteria.and("productCode").is(param.getProductCode());
|
|
|
+ }
|
|
|
+
|
|
|
if (!CommonUtil.longIsEmpty(param.getStartUpdateTime()) && !CommonUtil.longIsEmpty(param.getEndUpdateTime())) {
|
|
|
criteria.and("updateTime").gte(param.getStartUpdateTime()).lt(param.getEndUpdateTime());
|
|
|
} else if (!CommonUtil.longIsEmpty(param.getStartUpdateTime()) && CommonUtil.longIsEmpty(param.getEndUpdateTime())) {
|
|
|
@@ -76,10 +86,6 @@ public class IotThingDaoImpl extends BaseImpl implements IotThingDaoExtend {
|
|
|
Pattern pattern = Pattern.compile("^.*" + param.getCode() + ".*$");
|
|
|
criterias.add(Criteria.where("code").is(pattern));
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(param.getProductCode())) {
|
|
|
- Pattern pattern = Pattern.compile("^.*" + param.getProductCode() + ".*$");
|
|
|
- criterias.add(Criteria.where("productCode").is(pattern));
|
|
|
- }
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(criterias)) {
|
|
|
criteria.andOperator(criterias.toArray(new Criteria[]{}));
|