class UserDimensionTerm extends AbstractTermFragmentBuilder {
    public UserDimensionTerm() {
        super("in-dimension", "在维度中的用户数据");
    }

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


        List<Object> values = convertList(column, term);
        if (values.isEmpty()) {
            return EmptySqlFragments.INSTANCE;
        }

        PrepareSqlFragments fragments = PrepareSqlFragments.of();
        List<String> options = term.getOptions();

        if (options.contains("not")) {
            fragments.addSql("not");
        }

        fragments.addSql("exists(select 1 from ",getTableName("s_dimension_user",column)," d where d.user_id =", columnFullName);

        if (!options.isEmpty()) {
            String typeId = options.get(0);
            if (!"not".equals(typeId) && !"any".equals(typeId)) {
                fragments.addSql("and d.dimension_type_id = ?").addParameter(typeId);
            }
        }

        if (!options.contains("any")) {
            fragments.addSql("and d.dimension_id in(",
                             values.stream().map(r -> "?").collect(Collectors.joining(",")), ")")
                     .addParameter(values);
        }
        fragments.addSql(")");

        return fragments;
    
<no_super_class>