class DeviceCategoryTerm extends AbstractTermFragmentBuilder {

    public DeviceCategoryTerm() {
        super("dev-prod-cat", "按产品品类查询");
    }

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


        PrepareSqlFragments sqlFragments = PrepareSqlFragments.of();

        List<Object> idList = convertList(column, term);

        sqlFragments.addSql("exists(select 1 from dev_product prod where prod.id =", columnFullName);

        sqlFragments.addSql("and exists(select 1 from dev_product_category g where g.id = prod.classified_id and ");
        sqlFragments.addSql(
            idList
                .stream()
                .map(r -> "path like (select concat(path,'%') from dev_product_category g2 where g2.id = ?)")
                .collect(Collectors.joining(" or ", "(", ")"))
            , ")")
                    .addParameter(idList);

        sqlFragments.addSql(")");

        return sqlFragments;
    
<no_super_class>