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.GoodsNewBean;
import com.gree.mall.miniapp.bean.order.OrderStatusBean;
import com.gree.mall.miniapp.bean.order.ShoppingCartList;
import com.gree.mall.miniapp.bean.seckill.SecKillExtends;
import com.gree.mall.miniapp.bean.seckill.SecKillList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AppMapper {

    /**
     * 查询购物车的商品清单
     * @param userId
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public List<ShoppingCartList> queryShoppingCartList(@Param("userId") String userId);


    /**
     * 查询各订单状态数量
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public OrderStatusBean orderStatusCount(@Param("userId") String userId);


    /**
     * 秒杀时间段
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public List<SecKillExtends> queryTimeList(@Param("companyWechatId") String companyWechatId);

    /**
     * 秒杀商品列表
     * @return
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public List<SecKillList> querySecKillList(@Param("time") String time);

    /**
     * 精选分类商品
     */
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    public IPage<GoodsNewBean> queryNewGoods(
            IPage ipage,
            @Param("objId") String objId,
            @Param("type") String type,
            @Param("companyWechatId") String companyWechatId,
            @Param("sort") Integer sort
    );


}
