jiangping
2025-04-15 3cea15af53d4eb5fb9ccdd1b7a31ec494ba41d6c
server/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
@@ -199,6 +199,7 @@
                .eq(category.getType() != null, Category::getType, category.getType())
                .eq(category.getParentId() != null, Category::getParentId, category.getParentId())
                .eq(category.getNamePath() != null, Category::getNamePath, category.getNamePath())
                .isNull(category.getIsRoot() != null &&category.getIsRoot().equals(Constants.ONE), Category::getParentId)
                .eq(category.getIdPath() != null, Category::getIdPath, category.getIdPath())
                .orderByAsc( Category::getSortnum);
        return categoryMapper.selectJoinList(Category.class,queryWrapper);
@@ -267,10 +268,11 @@
    @Override
    public List<CategoryVO>  getCategoryVOTree(Integer categoryType){
    public List<CategoryVO>  getCategoryVOTree(String categoryType,Integer categoryId){
        List<Category> categoryList = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
                .eq(Category::getIsdeleted, Constants.ZERO)
                .eq(Objects.nonNull(categoryType),Category::getType,categoryType)
                .in(Objects.nonNull(categoryType),Category::getType,categoryType.split(","))
                .apply(Objects.nonNull(categoryId)," find_in_set("+categoryId+", REPLACE(ID_PATH,'/',',')  )  ")
                .orderByAsc(Category::getSortnum,Category::getId)
        );
        List<CategoryVO>  categoryVOList = new ArrayList<>();
@@ -290,10 +292,11 @@
    @Override
    public List<CategoryVO>  getCategoryVOList(Integer categoryType){
    public List<CategoryVO>  getCategoryVOList(Integer categoryType,Integer isRoot){
        List<Category> categoryList = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
                .eq(Category::getIsdeleted, Constants.ZERO)
                .eq(Objects.nonNull(categoryType),Category::getType,categoryType)
                .isNull(Constants.equalsInteger(isRoot,Constants.ONE),Category::getParentId)
                .orderByAsc(Category::getSortnum,Category::getId)
        );
        List<CategoryVO>  categoryVOList = new ArrayList<>();