package com.gree.mall.manager.commonmapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gree.mall.manager.bean.activity.CustomSecSpecBean;
import com.gree.mall.manager.bean.activity.CustomSpecBean;
import com.gree.mall.manager.bean.activity.SecKillActivitySpecBean;
import com.gree.mall.manager.bean.activity.SecKillActivityStageBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface SecKillMapper {
    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    IPage<CustomSecSpecBean> querySecSpec(IPage page,
                                          @Param("keyword")String keyword,
                                          @Param("status") Integer status,
                                          @Param("companyIds") List<String> companyIds);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    List<SecKillActivitySpecBean> querySecDetail(@Param("secKillId")String secKillId);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    IPage<SecKillActivityStageBean> queryActivity(
            IPage page,
            @Param("status")Integer status,
            @Param("keyword")String keyword,
            @Param("startTime")Date startTime,
            @Param("companyIds") List<String> companyIds);


    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    IPage<CustomSpecBean> querySpecList(
            IPage page,
            @Param("categoryId")String categoryId,
            @Param("keyword")String keyword,
            List<String> companyIds);

    @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
    IPage<CustomSecSpecBean> querySpecListforCoupon(Page<CustomSecSpecBean> objectPage,@Param("companyIds") List<String> companyIds,
                                                    @Param("categoryId")String categoryId, @Param("keyword")String keyword);

}
