Fix query all scope in MySQL and H2 storage. (#2568)

This commit is contained in:
吴晟 Wu Sheng 2019-05-01 00:39:29 +08:00 committed by Jared Tan
parent 4b19bd77cf
commit 24393f3b8d
2 changed files with 2 additions and 2 deletions

View File

@ -45,8 +45,8 @@ public class H2AlarmQueryDAO implements IAlarmQueryDAO {
List<Object> parameters = new ArrayList<>(10);
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
sql.append(" 1=1 ");
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
if (Objects.nonNull(scopeId)) {
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
parameters.add(scopeId.intValue());
}
if (startTB != 0 && endTB != 0) {

View File

@ -45,8 +45,8 @@ public class MySQLAlarmQueryDAO implements IAlarmQueryDAO {
List<Object> parameters = new ArrayList<>(10);
sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where ");
sql.append(" 1=1 ");
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
if (Objects.nonNull(scopeId)) {
sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?");
parameters.add(scopeId.intValue());
}
if (startTB != 0 && endTB != 0) {