package com.ruoyi.frequency.mallgoods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.controller.req.GoodsPageReq;
import com.ruoyi.controller.resp.GoodsDetailResp;
import com.ruoyi.controller.resp.GoodsPageResp;
import com.ruoyi.frequency.mallgoods.entity.MallGoods;
import com.ruoyi.frequency.mallspecifications.entity.MallSpecifications;
import com.ruoyi.vo.UserVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品Mapper接口
 *
 * @author liwenlong
 * @date 2024-01-25
 */
public interface MallGoodsMapper  extends BaseMapper<MallGoods>
{
    /**
     * 查询商品
     *
     * @param id 商品主键
     * @return 商品
     */
    public MallGoods selectMallGoodsById(Long id);

    /**
     * 查询商品列表
     *
     * @param mallGoods 商品
     * @return 商品集合
     */
    public List<MallGoods> selectMallGoodsList(MallGoods mallGoods);

    /**
     * 新增商品
     *
     * @param mallGoods 商品
     * @return 结果
     */
    public int insertMallGoods(MallGoods mallGoods);

    /**
     * 修改商品
     *
     * @param mallGoods 商品
     * @return 结果
     */
    public int updateMallGoods(MallGoods mallGoods);

    Page<GoodsPageResp> goodsPage(@Param("page") Page<Object> objectPage, @Param("req") GoodsPageReq req, @Param("userVo")   UserVo userVo);

    GoodsDetailResp goodsDetail(@Param("goodsId") Long goodsId, @Param("userVo") UserVo userVo);

    Boolean addSales(@Param("list") List<MallGoods> mallGoodsList );

    Boolean subSales(@Param("list") List<MallGoods> mallGoodsList );
}
