package com.ruoyi.mall.service.impl;


import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.redis.RedisService;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.mall.domain.Address;
import com.ruoyi.mall.domain.MemberAddress;
import com.ruoyi.mall.domain.ProductCategory;
import com.ruoyi.mall.domain.dto.AddressDTO;
import com.ruoyi.mall.mapper.AddressMapper;
import com.ruoyi.mall.mapper.MemberAddressMapper;
import com.ruoyi.mall.mapper.ProductCategoryMapper;
import com.ruoyi.mall.service.MemberAddressService;
import com.ruoyi.mall.service.ProductCategoryService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.stream.Collectors;

/**
 * <p>
 * 用户地址 服务实现类
 * </p>
 *
 * @author xn
 * @since 2022-09-29
 */
@Service
public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMapper, ProductCategory> implements ProductCategoryService {

    @Autowired
    private ProductCategoryMapper mapper;


    @Override
    public List<ProductCategory> getProductCategorys(Map params){

        QueryWrapper<ProductCategory> qw = new QueryWrapper<>();
        qw.select("id", "parent_id", "type_name", "level", "sort", "icon");
        qw.eq("show_status", 1);//展示
        qw.eq("store_id", 1);//全部
        qw.orderByAsc("sort");
//        qw.le("level", 2);
        return mapper.selectList(qw);
    }
}
