Fix query all scope in MySQL and H2 storage. (#2568)
This commit is contained in:
parent
4b19bd77cf
commit
24393f3b8d
|
|
@ -45,8 +45,8 @@ public class H2AlarmQueryDAO implements IAlarmQueryDAO {
|
||||||
List<Object> parameters = new ArrayList<>(10);
|
List<Object> parameters = new ArrayList<>(10);
|
||||||
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
|
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
|
||||||
sql.append(" 1=1 ");
|
sql.append(" 1=1 ");
|
||||||
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
|
|
||||||
if (Objects.nonNull(scopeId)) {
|
if (Objects.nonNull(scopeId)) {
|
||||||
|
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
|
||||||
parameters.add(scopeId.intValue());
|
parameters.add(scopeId.intValue());
|
||||||
}
|
}
|
||||||
if (startTB != 0 && endTB != 0) {
|
if (startTB != 0 && endTB != 0) {
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ public class MySQLAlarmQueryDAO implements IAlarmQueryDAO {
|
||||||
List<Object> parameters = new ArrayList<>(10);
|
List<Object> parameters = new ArrayList<>(10);
|
||||||
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
|
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
|
||||||
sql.append(" 1=1 ");
|
sql.append(" 1=1 ");
|
||||||
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
|
|
||||||
if (Objects.nonNull(scopeId)) {
|
if (Objects.nonNull(scopeId)) {
|
||||||
|
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
|
||||||
parameters.add(scopeId.intValue());
|
parameters.add(scopeId.intValue());
|
||||||
}
|
}
|
||||||
if (startTB != 0 && endTB != 0) {
|
if (startTB != 0 && endTB != 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue