|
@@ -10,6 +10,7 @@ import com.zhongshu.card.server.core.domain.org.DeviceInfo;
|
|
|
import com.zhongshu.card.server.core.domain.school.Area;
|
|
import com.zhongshu.card.server.core.domain.school.Area;
|
|
|
import com.zhongshu.card.server.core.domain.school.DeviceBind;
|
|
import com.zhongshu.card.server.core.domain.school.DeviceBind;
|
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
@@ -39,32 +40,36 @@ public class DeviceBindDaoImpl extends BaseImpl implements DeviceBindDaoExtend {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Page<DeviceBind> page(Pageable pageable, DeviceBindSearch param) {
|
|
public Page<DeviceBind> page(Pageable pageable, DeviceBindSearch param) {
|
|
|
- Criteria criteria = buildCriteria(param);
|
|
|
|
|
|
|
+ Criteria criteria = buildCriteriaNotOid(param);
|
|
|
|
|
|
|
|
if (param.getDeviceType() != null) {
|
|
if (param.getDeviceType() != null) {
|
|
|
criteria.and("deviceType").is(param.getDeviceType());
|
|
criteria.and("deviceType").is(param.getDeviceType());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 在线状态
|
|
|
if (param.getOnLineState() != null) {
|
|
if (param.getOnLineState() != null) {
|
|
|
criteria.and("onLineState").is(param.getOnLineState());
|
|
criteria.and("onLineState").is(param.getOnLineState());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 所属区域
|
|
|
if (StringUtils.isNotEmpty(param.getAreaId())) {
|
|
if (StringUtils.isNotEmpty(param.getAreaId())) {
|
|
|
criteria.and("area").is(Area.build(param.getAreaId()));
|
|
criteria.and("area").is(Area.build(param.getAreaId()));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 所属项目code
|
|
|
if (StringUtils.isNotEmpty(param.getProjectInfoCode())) {
|
|
if (StringUtils.isNotEmpty(param.getProjectInfoCode())) {
|
|
|
criteria.and("projectInfoCode").is(param.getProjectInfoCode());
|
|
criteria.and("projectInfoCode").is(param.getProjectInfoCode());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 所属学校oid
|
|
|
if (StringUtils.isNotEmpty(param.getSchoolInfoOid())) {
|
|
if (StringUtils.isNotEmpty(param.getSchoolInfoOid())) {
|
|
|
criteria.and("schoolInfoOid").is(param.getSchoolInfoOid());
|
|
criteria.and("schoolInfoOid").is(param.getSchoolInfoOid());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 所属商户oid
|
|
|
if (StringUtils.isNotEmpty(param.getShopInfoOid())) {
|
|
if (StringUtils.isNotEmpty(param.getShopInfoOid())) {
|
|
|
criteria.and("shopInfoOid").is(param.getShopInfoOid());
|
|
criteria.and("shopInfoOid").is(param.getShopInfoOid());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // 所属商户oid集合
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(param.getShopInfoOids())) {
|
|
|
|
|
+ criteria.and("shopInfoOid").in(param.getShopInfoOids());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 时间范围
|
|
|
if (!CommonUtil.longIsEmpty(param.getStartTime()) && !CommonUtil.longIsEmpty(param.getEndTime())) {
|
|
if (!CommonUtil.longIsEmpty(param.getStartTime()) && !CommonUtil.longIsEmpty(param.getEndTime())) {
|
|
|
criteria.and("createTime").gte(param.getStartTime()).and("createTime").lte(param.getEndTime());
|
|
criteria.and("createTime").gte(param.getStartTime()).and("createTime").lte(param.getEndTime());
|
|
|
}
|
|
}
|
|
@@ -91,7 +96,6 @@ public class DeviceBindDaoImpl extends BaseImpl implements DeviceBindDaoExtend {
|
|
|
Criteria.where("gateWayId").regex(pattern)
|
|
Criteria.where("gateWayId").regex(pattern)
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
Sort sort = buildSort(param);
|
|
Sort sort = buildSort(param);
|
|
|
Query query = Query.query(criteria);
|
|
Query query = Query.query(criteria);
|
|
|
query.with(sort);
|
|
query.with(sort);
|