package com.yiqi.app.service.impl;

import java.util.List;

import com.yiqi.app.domain.vo.weapp.WeAppGoodsMarketVO;
import com.yiqi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.yiqi.app.mapper.AppGoodsMarketMapper;
import com.yiqi.app.domain.AppGoodsMarket;
import com.yiqi.app.service.IAppGoodsMarketService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 购物车Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-01
 */
@Service
public class AppGoodsMarketServiceImpl extends ServiceImpl<AppGoodsMarketMapper,AppGoodsMarket> implements IAppGoodsMarketService {

    /**
     * 查询购物车
     *
     * @param id 购物车主键
     * @return 购物车
     */
    @Override
    public AppGoodsMarket selectAppGoodsMarketById(Long id) {
        return baseMapper.selectAppGoodsMarketById(id);
    }

    /**
     * 查询购物车列表
     *
     * @param appGoodsMarket 购物车
     * @return 购物车
     */
    @Override
    public List<WeAppGoodsMarketVO> selectAppGoodsMarketList(AppGoodsMarket appGoodsMarket) {
        return baseMapper.selectAppGoodsMarketList(appGoodsMarket);
    }

    /**
     * 新增购物车
     *
     * @param appGoodsMarket 购物车
     * @return 结果
     */
    @Override
    public int insertAppGoodsMarket(AppGoodsMarket appGoodsMarket) {
        appGoodsMarket.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertAppGoodsMarket(appGoodsMarket);
    }

    /**
     * 修改购物车
     *
     * @param appGoodsMarket 购物车
     * @return 结果
     */
    @Override
    public int updateAppGoodsMarket(AppGoodsMarket appGoodsMarket) {
        return baseMapper.updateAppGoodsMarket(appGoodsMarket);
    }

    /**
     * 批量删除购物车
     *
     * @param ids 需要删除的购物车主键
     * @return 结果
     */
    @Override
    public int deleteAppGoodsMarketByIds(Long[] ids) {
        return baseMapper.deleteAppGoodsMarketByIds(ids);
    }

    /**
     * 删除购物车信息
     *
     * @param id 购物车主键
     * @return 结果
     */
    @Override
    public int deleteAppGoodsMarketById(Long id) {
        return baseMapper.deleteAppGoodsMarketById(id);
    }



}
