|
@@ -22,6 +22,8 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
+
|
|
|
import static cc.iotkit.data.model.QTbAlertConfig.tbAlertConfig;
|
|
import static cc.iotkit.data.model.QTbAlertConfig.tbAlertConfig;
|
|
|
import static cc.iotkit.data.model.QTbAlertRecord.tbAlertRecord;
|
|
import static cc.iotkit.data.model.QTbAlertRecord.tbAlertRecord;
|
|
|
|
|
|
|
@@ -72,10 +74,12 @@ public class AlertRecordDataImpl implements IAlertRecordData, IJPACommData<Alert
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Predicate buildPredicate(AlertRecord data) {
|
|
private Predicate buildPredicate(AlertRecord data) {
|
|
|
|
|
+
|
|
|
return PredicateBuilder.instance()
|
|
return PredicateBuilder.instance()
|
|
|
.and(StringUtils.isNotEmpty(data.getTenantId()),()->tbAlertRecord.tenantId.eq(data.getTenantId()))
|
|
.and(StringUtils.isNotEmpty(data.getTenantId()),()->tbAlertRecord.tenantId.eq(data.getTenantId()))
|
|
|
.and(StringUtils.isNotEmpty(data.getUid()),()->tbAlertRecord.uid.eq(data.getUid()))
|
|
.and(StringUtils.isNotEmpty(data.getUid()),()->tbAlertRecord.uid.eq(data.getUid()))
|
|
|
.and(StringUtils.isNotEmpty(data.getLevel()), () -> tbAlertRecord.level.eq(data.getLevel()))
|
|
.and(StringUtils.isNotEmpty(data.getLevel()), () -> tbAlertRecord.level.eq(data.getLevel()))
|
|
|
|
|
+ .and(Objects.nonNull(data.getCreateDept()), () -> tbAlertRecord.createDept.eq(data.getCreateDept()))
|
|
|
.and(StringUtils.isNotEmpty(data.getName()), () -> tbAlertRecord.name.like("%"+data.getName()+"%"))
|
|
.and(StringUtils.isNotEmpty(data.getName()), () -> tbAlertRecord.name.like("%"+data.getName()+"%"))
|
|
|
.build();
|
|
.build();
|
|
|
}
|
|
}
|