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.PreSale;
import com.fzm.mall.server.front.goods.mapper.PreSaleMapper;
import com.fzm.mall.server.front.goods.service.IPreSaleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商品预售 服务实现类
 * </p>
 *
 * @author fzm
 * @since 2021-08-17
 */
@Service
public class PreSaleServiceImpl extends ServiceImpl<PreSaleMapper, PreSale> implements IPreSaleService {

    @Override
    public PreSale getByGoodsId(String goodsId) {
        QueryWrapper<PreSale> q = new QueryWrapper<>();
        q.eq("goods_id",goodsId);
        q.eq("status",1);
        return getOne(q);
    }
}
