package com.fzm.mall.server.front.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzm.mall.server.front.goods.model.GoodSpu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 商品表 Mapper 接口
 * </p>
 *
 * @author fzm
 * @since 2021-03-02
 */
@Mapper
public interface GoodSpuMapper extends BaseMapper<GoodSpu> {
    @Select("select template_id from goods_spu where goods_id = #{goodsId}")
    String getTemplateIdByGoodsId(@Param("goodsId") String goodsId);

    @Select("select a.commodity_pass from goods_spu a left join goods_sku b on a.goods_id = b.goods_id where b.sku_id = #{skuId} ")
    int getCommodityBySkuId(@Param("skuId") String skuId);

    @Select("select nft_sales_type from  goods_sku  where sku_id = #{skuId} ")
    int getNftSalesType(@Param("skuId") String skuId);
}
