+ "join (%s) v on d.dimension_name = v.dimension_name and d.value = v.value "
<BUG>+ "where sa.id = d.sub_alarm_id and sa.metric_name = :metric_name "
+ "group by d.sub_alarm_id having count(d.sub_alarm_id) = %s";</BUG>
private static final String FIND_BY_METRIC_DEF_NO_DIMS_SQL = "select * from sub_alarm sa where sa.metric_name = :metric_name "
<BUG>+ "and (select count(*) from sub_alarm_dimension where sub_alarm_id = sa.id) = 0";
private final DBI db;</BUG>
@Inject
public SubAlarmDAOImpl(DBI db) {
this.db = db;
}

+ "join (%s) v on d.dimension_name = v.dimension_name and d.value = v.value "
+ "where sa.id = d.sub_alarm_id and sa.metric_name = :metric_name and a.tenant_id = :tenant_id and a.id = sa.alarm_id and a.deleted_at is null "
+ "group by d.sub_alarm_id having count(d.sub_alarm_id) = %s";
private static final String FIND_BY_METRIC_DEF_NO_DIMS_SQL = "select * from sub_alarm sa where sa.metric_name = :metric_name "
+ "and a.tenant_id = :tenant_id and a.id = sa.alarm_id and a.deleted_at is null and (select count(*) from sub_alarm_dimension where sub_alarm_id = sa.id) = 0";
private final DBI db;
@Inject
public SubAlarmDAOImpl(DBI db) {
this.db = db;
}
