package com.gree.mall.miniapp.commonmapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gree.mall.miniapp.bean.goods.CategoryBean;
import com.gree.mall.miniapp.bean.goods.GoodsNewBean;
import com.gree.mall.miniapp.plus.entity.Brand;
import com.gree.mall.miniapp.plus.entity.GoodsCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CategoryMapper {

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<CategoryBean> queryCategory(@Param("companyWechatId") String companyWechatId,@Param("isServiceShow") Boolean isServiceShow);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    IPage<GoodsNewBean> listGoods(IPage page,
                                  @Param("currentCompanyWechatId") String currentCompanyWechatId,
                                  @Param("categoryId")String categoryId,
                                  @Param("sort")Integer sort);

    /**
     * 查询商品分类
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public GoodsCategory queryGoodsCategoryByGoodsId(@Param("goodsId") String goodsId);

    /**
     * 根据一级分类查询品牌
     * @param categoryId
     * @return
     */
    public List<Brand> brandList(@Param("categoryId") String categoryId,@Param("companyWechatId") String companyWechatId);
}
