/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.seckill.comment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.seckill.comment.dto.SeckillProductSimpleDto;
import com.yami.shop.seckill.comment.model.Seckill;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 秒杀信息
 *
 * @author LGH
 * @date 2019-08-28 09:36:59
 */
public interface SeckillMapper extends BaseMapper<Seckill> {

    IPage<SeckillProductSimpleDto> pageSeckillProd(PageParam<SeckillProductSimpleDto> page);

    IPage<Seckill> getPlatformSeckillPage(@Param("page") PageParam<Seckill> page, @Param("seckill") Seckill seckill);

    int updateStatus(@Param("seckillId") Long seckillId, @Param("status") int status);

    void returnStocksByOrderNumber(@Param("orderNumber") String orderNumber);

    void returnStocks(@Param("now") Date now);

    int updateStocksById(@Param("seckillId") Long seckillId, @Param("prodCount") Integer prodCount);

    void changeProdTypeBySeckillIdList(@Param("seckillIds") List<Long> seckillIds);

    void changeSeckillStatusBySeckillIdList(@Param("seckillIds") List<Long> seckillIds);

    IPage<SeckillProductSimpleDto> pageSeckillProdNew(PageParam<SeckillProductSimpleDto> page,
                                                      @Param("lat") String lat,
                                                      @Param("lon") String lon,
                                                      @Param("distance") String distance,
                                                      @Param("list") List<Long> list);
}
