package com.fzm.mall.server.front.goods.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzm.mall.server.front.goods.model.ShopNavigation;
import com.fzm.mall.server.front.goods.mapper.ShopNavigationMapper;
import com.fzm.mall.server.front.goods.service.IShopNavigationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 店铺中心-店铺导航管理 服务实现类
 * </p>
 *
 * @author fzm
 * @since 2021-05-31
 */
@Service
public class ShopNavigationServiceImpl extends ServiceImpl<ShopNavigationMapper, ShopNavigation> implements IShopNavigationService {

    @Override
    public List<ShopNavigation> getByMerchantId(String merchantId) {
        QueryWrapper<ShopNavigation> q  = new QueryWrapper<>();
        q.eq("merchant_id",merchantId);
        q.eq("status",1);
        q.orderByAsc("display_order");
        return list(q);
    }
}
