class AlarmBindRuleTerm extends AbstractTermFragmentBuilder {

    public AlarmBindRuleTerm() {
        super("alarm-bind-rule", "告警绑定的规则");
    }

    @Override
    public SqlFragments createFragments(String columnFullName,
                                        RDBColumnMetadata column,
                                        Term term) {<FILL_FUNCTION_BODY>}
}


        PrepareSqlFragments sqlFragments = PrepareSqlFragments.of();
        if (term.getOptions().contains("not")) {
            sqlFragments.addSql("not");
        }
        sqlFragments
            .addSql("exists(select 1 from ", getTableName("s_alarm_rule_bind", column), " _bind where _bind.rule_id =", columnFullName);

        List<Object> alarmId = convertList(column, term);
        sqlFragments
            .addSql(
                "and _bind.alarm_id in (",
                alarmId.stream().map(r -> "?").collect(Collectors.joining(",")),
                ")")
            .addParameter(alarmId);

        sqlFragments.addSql(")");

        return sqlFragments;
    
<no_super_class>